trinidi.resolution#
Resolution Operator
Functions
|
Generate a list of resolution function kernels. |
|
Resolution function kernel based on [4]. |
Classes
|
ResolutionOperator Class |
- class trinidi.resolution.ResolutionOperator(output_shape, t_A, kernels=None)[source]#
Bases:
object
ResolutionOperator Class
Initialize a ResolutionOperator object.
- Parameters:
output_shape – Output shape of operator, i.e. measurement shape.
kernels (list of nd-arrays) – list of convolution kernels.
None
results in identity operator. Each kernel must sum to 1.
- call_on_any_array(array)[source]#
Call ResolutionOperator on an array of size (…, N_F).
Note: New ResolutionOperator object is created every time this function is called. Thus, is is not recommended to use this function when fast performance is required.
- trinidi.resolution.lansce_fp5_kernel(t_A, Δt, flight_path_length)[source]#
Resolution function kernel based on [4].
- Parameters:
t_A (scalar) – time-of-arrival of the neutron in \(\mathrm{μs}\).
Δt (scalar) – time sampling bin width in \(\mathrm{μs}\).
flight_path_length (scalar) – flight path length in \(\mathrm{m}\).
- Returns:
Kernel array.
- trinidi.resolution.equispaced_kernels(t_A, num_kernels, kernel_generator)[source]#
Generate a list of resolution function kernels.
Generate a list of resolution function kernels that correspond to equispaced time-of-flights and a given kernel_generator.
- Parameters:
t_A (array) – time-of-arrival array of the neutrons in \(\mathrm{μs}\).
num_kernels (int) – Number of kernels to be generated. If 1, single kernel with average time-of-arrival is being generated.
kernel_generator (function) – Function with single argument that generates a kernel array based on the time-of-arrival.
- Returns:
list of Kernel arrays.