scipp / essdiffraction

Diffraction data reduction for the European Spallation Source
https://scipp.github.io/essdiffraction/
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Compute positions, wavelength, 2theta from calibration #60

Open nvaytet opened 4 months ago

nvaytet commented 4 months ago

In #55 the computation of d-spacing from calibration was effectively removed because we needed the wavelength, 2theta coordinates for adding masks. We should be able to compute them from the final d-spacing, by first altering the detector positions?

SimonHeybrock commented 4 months ago

Not sure what you are suggesting, but I don't think this is possible in general? Firstly, calibration gives a single parameter (d-spacing), so full position cannot be defined, and secondly, I think there is (or at least can be) non-linear terms in the "d-spacing from calibration" definition, so it is not clear you can reverse and compute the raw parameter values.

jl-wynen commented 4 months ago

You cannot reverse the transform to get the true positions back. But we can do a liner transformation from d back to tof by setting some artificial time offset and positions. I don't like this a bit. But it is needed for writing CIF files anyway.

jl-wynen commented 2 months ago

Context

We currently compute wavelength and 2theta using the 'normal' way without calibration. We then use those values to add masks and focus into 2theta bins. This makes the resulting 2theta and d-spacing coords inconsistent. To fix this, we would have to compute wavelength and 2theta (and potentially positions) using calibration.

The usual powder calibrations account for a number of factors such as errors in measured detector positions and the time of flight and wavelength profile of the beam. Since all those are combined into the calibration parameters, it is unclear how to disentangle them to obtain calibrated wavelength and positions separately.

Potential solution: leave it as is

It may be that the differences between results with and without calibration are below the required precision for wavelength and 2theta. In this case, we can keep using the current solution. I think this is what Mantid does. We need input from the instrument team to decide.