ess.reduce.unwrap.to_wavelength.WavelengthInterpolator#
- class ess.reduce.unwrap.to_wavelength.WavelengthInterpolator(lookup, distance_unit, time_unit, wavelength_unit='angstrom', backend=FrameUnwrapBackend.numba)[source]#
- __init__(lookup, distance_unit, time_unit, wavelength_unit='angstrom', backend=FrameUnwrapBackend.numba)[source]#
Interpolator object that converts event_time_offset and distances to wavelengths.
Note that interpolating wavelength directly instead of time-of-flight can lead to higher interpolation errors. Considering
\[\lambda = \frac{t - t_0(t, L)}{L}\]while
\[\]t_{of} = t - t_0(t, L)
and assuming \(t_0(t, L)\) is an affine function, or slowly varying relative to grid density, linear interpolation in \(t\) and \(L\) will represent \(t_{tof}\) exactly.
But linear interpolation does not represent \(\lambda\) exactly even if \(t_0\) is slowly varying or affine, so the interpolation error is probably larger when we interpolate \(\lambda\) rather than when we interpolate \(t_{of}\).
For this reason, we internally convert to tof and then back to wavelength before returning the result.
Methods
__init__(lookup, distance_unit, time_unit[, ...])Interpolator object that converts event_time_offset and distances to wavelengths.