FlipperEfficiency v1

Summary

Calculate the efficiency of the polarization or analyzer flipper.

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

WorkspaceGroup

Mandatory

Group workspace containing flipper transmissions for all 4 polarization states.

Flipper

Input

string

Polarizer

Allowed values: [‘Polarizer’, ‘Analyzer’]

SpinStates

Input

string

11,10,01,00

Order of individual flipper configurations in the input group workspace, e.g. “01,11,00,10”

OutputWorkspace

Output

MatrixWorkspace

Workspace containing the wavelength-dependent efficiency for the flipper.

OutputFilePath

Input

string

File name or path for the output to be saved to.

Description

Calculates the efficiency of a single flipper as a function of wavelength, as described by Wildes [1] and by Krycka et al. [2]. The input workspace must be a group of four single spectrum workspaces, each representing the transmission of a known spin state as specified by the SpinStates parameter. These four spin state transmissions are used to calculate the proportion of neutrons lost to the flipper as a function of wavelength.

With the Flipper property, the efficiency of the analyzer or polarizer flipper is calculated by choosing, respectively, Analyzer or Polarizer.

The polarization of the polarizer flipper, \(P_{F_{P}}\), is given by:

\[P_{F_{P}} = \frac{(\frac{T_{11} - T_{10}}{T_{11} + T_{10}})}{(\frac{T_{00} - T_{01}}{T_{00} + T_{01}})}\]

While the polarization of the analyzer flipper, \(P_{F_{A}}\) is:

\[P_{F_{A}} = \frac{(\frac{T_{11} - T_{01}}{T_{11} + T_{01}})}{(\frac{T_{00} - T_{10}}{T_{00} + T_{10}})}\]

And the efficiency is calculated from the polarization as :

\[\epsilon_{F} = \frac{1 + P_{F}}{2}\]

The errors are calculated with error propagation from the partial derivatives with respect ot the transmission amplitudes:

\[\sigma_{\epsilon_{F}} = \sqrt{\sum_{i,j=0,1} \left( \frac{\partial{\epsilon_{F}}}{\partial{T_{ij}}} \right)^{2} \, \sigma_{i,j}^2 }\]

Outputs

If an output file path is provided, a NeXus file containing the output workspace will be saved. If an absolute path is provided, the output workspace will be saved to the given path. If only a filename or a relative path is provided, the output workspace will be saved with that filename into the location set in the Default Save Directory field of the File -> Manage User Directories window.

A workspace will not be output by the algorithm unless an output workspace name is provided.

An output workspace name, output file path, or both must be given.

Usage

Example - Calculate Flipper Efficiency

CreateSampleWorkspace(OutputWorkspace='out_00', Function='User Defined', UserDefinedFunction='name=Lorentzian, Amplitude=48000, PeakCentre=2.65, FWHM=1.2', XUnit='wavelength', NumBanks=1, BankPixelWidth=1, XMin=0, XMax=16.5, BinWidth=0.1)
CreateSampleWorkspace(OutputWorkspace='out_11', Function='User Defined', UserDefinedFunction='name=Lorentzian, Amplitude=47000, PeakCentre=2.65, FWHM=1.2', XUnit='wavelength', NumBanks=1, BankPixelWidth=1, XMin=0, XMax=16.5, BinWidth=0.1)
CreateSampleWorkspace(OutputWorkspace='out_10', Function='User Defined', UserDefinedFunction='name=Lorentzian, Amplitude=22685, PeakCentre=2.55, FWHM=0.6', XUnit='wavelength', NumBanks=1, BankPixelWidth=1, XMin=0, XMax=16.5, BinWidth=0.1)
CreateSampleWorkspace(OutputWorkspace='out_01', Function='User Defined', UserDefinedFunction='name=Lorentzian, Amplitude=22685, PeakCentre=2.55, FWHM=0.6', XUnit='wavelength', NumBanks=1, BankPixelWidth=1, XMin=0, XMax=16.5, BinWidth=0.1)

group = GroupWorkspaces(['out_00','out_11','out_10','out_01'])

group = ConvertUnits(group, "Wavelength")

out = FlipperEfficiency(group, SpinStates="00, 11, 10, 01")

print("Flipper efficiency at a wavelength of {:.1f} Å is ".format(mtd['out'].dataX(0)[3]) + str(mtd['out'].dataY(0)[3]))

Output:

Flipper efficiency at a wavelength of 0.3 Å is ...

References

Categories: AlgorithmIndex | SANS\PolarizationCorrections

Source

C++ header: FlipperEfficiency.h

C++ source: FlipperEfficiency.cpp