-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SANS Q Resolution stored as generic function #111
Comments
Most likely some differences, but it may be worth comparing to the implementation in https://github.com/scipp/essreflectometry/blob/main/src/essreflectometry/amor/resolution.py for reflectometry, at least to align naming, etc. |
Looking at the equation:
Also, the equation seems to differ from what is in the Mantid docs? There, I don't understand why they add the tof resolution to the wavelength resolution, it doesn't seem to make much sense. You either have your data as a function of wavelength or tof, not both at the same time? |
So in your equations above, Now I looked again and it seems I made a mistake, the Regarding
I found https://docs.mantidproject.org/v3.9.0/algorithms/TOFSANSResolutionByPixel-v1.html which is more in agreement with the original equation you posted above? |
Yes, sorry I provided initially wrong link. It should this one https://docs.mantidproject.org/nightly/algorithms/TOFSANSResolutionByPixel-v1, which I belive provides the same equation as from v3.9.0 |
The implementation Neil mentioned above should be an appropriate baseline for our HC. Then, we simply need the output stored in the nxcansas as an additional dQ/Q column, for the corresponding bin centres. |
Extra info from chat: We may (at least initially) simply use the maximum (across pixels contributing to any given Q-bin) Q-resolution. Note to self: Don't forget to exclude masked pixels. |
Executive summary
Implement Q SANS resolution as a per q function and store it to NXCanSAS format
Context and background knowledge
In time-of-flight SANS the resolution curves from all the wavelengths contributing to a particular Q value are averaged together, weighted by the number of neutrons detected at each wavelength. Since the resolution width is inversely proportional to wavelength this often gives a curve that is noticeably sharper in the peak and broader in the tails than a simple Gaussian.
Therefore, we need a q resolution description beyond a single value
Inputs
We need individual terms contributing to https://docs.mantidproject.org/nightly/algorithms/TOFSANSResolutionByPixel-v1
$\Delta\lambda$ values are found from the wavelength binning. For event mode $\Delta\lambda$ is very small however in practice one introduces binning from monitors or set event time bins before rebinning into user-provided wavelength steps. In any event, one should choose the largest value.
Methodology
The SANS resolution using Mildener-Carpenter approximation is defined as
$(\sigma_Q )^2 = \frac{4\pi^2}{12\lambda^2} [ 3(\frac{R_1}{L_1})^2 + 3(\frac{R_2}{L_3})^2 + (\frac{\Delta R}{L_2})^2 ] + Q^2(\frac{\sigma_{\lambda}}{\lambda})^2$
$\frac{1}{L_3} = \frac{1}{L_1} + \frac{1}{L_2}$
$(\sigma_{\lambda})^2 = (\Delta \lambda )^2 / 12 + (\sigma_{moderator})^2$
where L1 and L2 are the collimation length and sample-to-detector distance respectively and
and the overall effective standard deviation in wavelength is defined as:
$\delta {moderator} $ is moderator time spread (microseconds) as a function of wavelength (Angstroms). At ISIS it is measured at LET (and probably on others instruments too). It is however not entirerly clear how this will be done at ESS
but it should be assumed that this function will be supplied in metadata.
The resolution equation above is an approximation assuming that each of the terms is approximated by Gaussian distribution. This approach however can be extended by defining the Q resolution as a convolution of resolution kernels (schematically):
The convolution of kernels can be then performed using e.g.
np.convolve
as demonstrated in the attached notebook.The wavelength independent terms won't change for given Q and can be calculated in advance and cached as a function, however for a wavelength-dependent term the range of wavelength contribution to a given q should be taken into account and convolution of multiple wavelength resolution should be computed.
Outputs
Save to NXCanSAS format. Placeholder /entry/data/q/resolutions and /entry/data/q/resolutions_descriptions
Which interfaces are required?
Python module / function
Test cases
At minimum, generated resolution function FWHM should be compared with dQ value from Milldener-Carpenter equation
Comments
No response
The text was updated successfully, but these errors were encountered: