BilbySANSDataProcessor v1

../_images/BilbySANSDataProcessor-v1_dlg.png

BilbySANSDataProcessor dialog.

Summary

BILBY SANS data reduction. Converts a workspace in wavelength into a 1D or 2D workspace of momentum transfer, assuming elastic scattering.

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace Mandatory Particle counts as a function of wavelength
InputMaskingWorkspace Input MatrixWorkspace   Mask for the scattering data
BlockedBeamWorkspace Input MatrixWorkspace   Blocked beam scattering
EmptyBeamSpectrumShapeWorkspace Input MatrixWorkspace Mandatory Empty beam transmission, where only a given wavelength slice is considered
SensitivityCorrectionMatrix Input MatrixWorkspace   Detector sensitivity calibration data set
TransmissionWorkspace Input MatrixWorkspace Mandatory Sample transmission workspace
TransmissionEmptyBeamWorkspace Input MatrixWorkspace Mandatory Empty beam transmission workspace
TransmissionMaskingWorkspace Input MatrixWorkspace Mandatory Mask for the transmission data
FitMethod Input string log Function to use to fit transmission; can be Linear, Log, Polynomial (first letter shall be capital)
PolynomialOrder Input string 3 Used only for Polynomial function, but needed as an input parameter anyway
ScalingFactor Input number 1 Attenuating factor
SampleThickness Input number 1 Thickness of sample
BinningWavelength Input dbl list Mandatory Wavelength boundaries for reduction: a comma separated list of first bin boundary, width, last bin boundary
BinningWavelengthTransm Input dbl list Mandatory Wavelengths boundaries for transmission binning: a comma separated list of first bin boundary, width, last bin
BinningQ Input dbl list Mandatory Output Q-boundaries: a comma separated list of first bin boundary, width, last bin boundary
Timemode Input boolean True If data collected in ToF or monochromatic mode
AccountForGravity Input boolean True Whether to correct for the effects of gravity
SolidAngleWeighting Input boolean True If True, pixels will be weighted by their solid angle
RadiusCut Input number 1 To increase resolution some wavelengths are excluded within this distance from the beam center (mm). Note that RadiusCut and WaveCut both need to be larger than 0 to affect the effective cutoff. See the algorithm description for a detailed explanation of the cutoff.
WaveCut Input number 1 To increase resolution by starting to remove some wavelengths below this threshold (angstrom). Note that WaveCut and RadiusCut both need to be larger than 0 to affect on the effective cutoff. See the algorithm description for a detailed explanation of the cutoff.
WideAngleCorrection Input boolean True If true, the wide angle correction for transmissions will be applied
Reduce2D Input boolean False If true, 2D data reduction will be performed
OutputWorkspace Output MatrixWorkspace Mandatory Name of the workspace that contains the result of the calculation. Created automatically.
OutputWorkspaceTransmissionFit Output MatrixWorkspace Mandatory Counts vs wavelength, fit for the sample transmission

Description

The main equation Bilby is using for the I(Q) calculation is the following:

I(Q)=\frac{1}{d_{sam}}.\frac{\sum_{R, \lambda \subset Q}C_{sam,corr}(R,\lambda)}{M \sum_{R,\lambda \subset Q}T_{corr}(R, \lambda)\frac{I_{empty\_beam}(\lambda)}{M_{empty\_beam}att_{empty\_beam}}\Omega(R)Det_{flood}(R)}

Where C_{sam, corr} is the measured counts per pixel per wavelength, I_{empty\_beam} is the intensity of the empty beam collected for M_{empty\_beam} time, M is a time measure for the data collection, att_{empty\_beam} is attenuation factor, \Omega(R) is solid angle, Det_{flood} is a detector response function, T_{corr} is the sample transmission, and d_{sam} is the sample thickness.

Details are described in the paper [1]. The core algorithms the BilbySANSDataProcessor is utilising are Q1D and TOFSANSResolutionByPixel. Please refer to those pages for details of the input parameters. The unit of the output workspace is 1/cm. Absolute scale calibration done relatively to the empty beam transmission measurements.

Usage

See https://github.com/hortica/Mantid_Bilby/tree/master/example_data_reduction_settings page to download a set of the test input data.

Please note, currently we do not have a User Interface, so we are working with csv lists.

The steps to make the Bilby data reduction work are listed below:

  • Two csv files, similar to (input_csv_example.csv and mantid_reduction_settings_example.csv) should be created during the experiment; the names can be different, the format (especially the top line in each) must stay the same

  • Download Mantid from http://download.mantidproject.org/

  • Add the folder with your *.tar files AND the two csv files (input_csv_example.csv and mantid_reduction_settings_example.csv) to the path (added to “Mantid User Directories”)
    • To keep it simple, one can put tar and csv files in one folder, but you can add as many folders on the paths as you want
  • Open the Script menu in Mantid: press “View”, and then “Script window”; alternalively just press F3

  • The script below shows an example script to run the Bilby reduction the reduction_settings_file options should be changed to the correct .csv file file and save_files set to true.

  • Run the reducer, Execute -> Execute All in the Menu
    • All output 1D files will be saved in the folder you define in the mantid_reduction_settings_example.csv
from BilbyReductionScript import RunBilbyReduction
run_bilby_reduction = RunBilbyReduction('mantid_reduction_settings_example.csv', '0', '0', 'shift_assembled.csv', False)
output_workspace, transmission_fit = run_bilby_reduction.run_bilby_reduction()
scale, aka attenuation factor 0.0029

References

[1]A. Sokolova, A. E. Whitten, L. de Campo, J. Christoforidis, A. Eltobaji, J. Barnes, F. Darmann and A. Berry (2019). Journal of Applied Crystallography Volume 52 (1) doi: 10.1107/S1600576718018009

Source

Python: BilbySANSDataProcessor.py (last modified: 2019-01-18)

Categories: Algorithm Index | Workflow\SANS