Skip to content

SANS Q Resolution stored as generic function #111

@wpotrzebowski

Description

@wpotrzebowski

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$
where L1 and L2 are the collimation length and sample-to-detector distance respectively and
$\frac{1}{L_3} = \frac{1}{L_1} + \frac{1}{L_2}$
and the overall effective standard deviation in wavelength is defined as:
$(\sigma_{\lambda})^2 = (\Delta \lambda )^2 / 12 + (\sigma_{moderator})^2$

$\Delta\lambda$ is the wavelength bin width used when histogramming the data (either using monitor time bins or specifically set event time bins). $\Delta R$ is the detector resolution (virtual ring width on the detector (mm)). For LOKI this parameter will depend on the sample-detector distance and how many pixels per straw will be taken into account. $R1$ and $R2$ are source and sample apertures in mm. ($\Delta R$, $R1$ and $R2$ should be passed from instrument control to metadata).

$\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):

$r_{sample-apperture}*r_{binning}*r_{detector-pixelation}*r_{TOF}*r_{wavelength}$

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

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Blocked

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions