FlipperEfficiency v1

Summary

Calculate the efficiency of the polarization flipper.

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

WorkspaceGroup

Mandatory

Group workspace containing flipper transmissions for all 4 polarization states.

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.

The polarization of the flipper PF is given by:

PF=(T11T10T11+T10)(T00T01T00+T01)

Since the efficiency ϵF is equal to 1+PF2, we can calculate the efficiency of the flipper directly using:

ϵF=T11T00T10T01(T11+T10)(T00T01)

The errors are calculated as follows:

σϵF=|ϵFT11|2σT112+|ϵFT00|2σT002+|ϵFT10|2σT102+|ϵFT01|2σT012

Where:

ϵFT11=T10(T00+T01)(T11+T10)2(T00T01)
ϵFT00=T01(T10T11)(T11+T10)(T00T01)2
ϵFT10=T11(T00+T01)(T11+T10)2(T00T01)
ϵFT01=T00(T11T10)(T11+T10)(T00T01)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