\(\renewcommand\AA{\unicode{x212B}}\)

PolarizationEfficienciesWildes v1

Summary

Calculates the efficiencies of the polarizer, flippers and the analyser for a two-flipper instrument setup.

See Also

PolarizationCorrectionWildes

Properties

Name

Direction

Type

Default

Description

InputNonMagWorkspace

Input

WorkspaceGroup

Mandatory

Group workspace containing the transmission measurements for the non-magnetic sample

InputMagWorkspace

Input

WorkspaceGroup

Group workspace containing the transmission measurements for the magnetic sample.

Flippers

Input

string

00,01,10,11

Flipper configurations of the input group workspace(s).

InputPolarizerEfficiency

Input

MatrixWorkspace

Workspace containing the known wavelength-dependent efficiency for the polarizer.

InputAnalyserEfficiency

Input

MatrixWorkspace

Workspace containing the known wavelength-dependent efficiency for the analyser.

OutputFpEfficiency

Output

MatrixWorkspace

Mandatory

Output workspace containing the polarizing flipper efficiencies

OutputFaEfficiency

Output

MatrixWorkspace

Mandatory

Output workspace containing the analysing flipper efficiencies

OutputPolarizerEfficiency

Output

MatrixWorkspace

Output workspace containing the polarizer efficiencies.

OutputAnalyserEfficiency

Output

MatrixWorkspace

Output workspace containing the analyser efficiencies.

IncludeDiagnosticOutputs

Input

boolean

False

Whether to include additional diagnostic outputs.

OutputPhi

Output

MatrixWorkspace

phi

Output workspace containing the values for Phi.

OutputRho

Output

MatrixWorkspace

rho

Output workspace containing the values for Rho.

OutputAlpha

Output

MatrixWorkspace

alpha

Output workspace containing the values for Alpha.

OutputTwoPMinusOne

Output

MatrixWorkspace

two_p_minus_one

Output workspace containing the values for the term (2p-1).

OutputTwoAMinusOne

Output

MatrixWorkspace

two_a_minus_one

Output workspace containing the values for the term (2a-1).

Description

This algorithm calculates the instrument component efficiencies in a polarized analysis experiment by implementing the Wildes [1] approach for calibrating an instrument with two flippers.

A non-magnetic transmission run should be provided via the InputNonMagWorkspace property. This can be used to calculate both flipper efficiencies and phi, as follows:

\[\phi = \frac{(I^{00}_{1} - I^{01}_{1})(I^{00}_{1} - I^{10}_{1})}{I^{00}_{1}I^{11}_{1} - I^{01}_{1}I^{10}_{1}}\]
\[f_p = \frac{I^{00}_{1} - I^{01}_{1} - I^{10}_{1} + I^{11}_{1}}{2(I^{00}_{1} - I^{01}_{1})}\]
\[f_a = \frac{I^{00}_{1} - I^{01}_{1} - I^{10}_{1} + I^{11}_{1}}{2(I^{00}_{1} - I^{10}_{1})}\]

The algorithm will only be able to calculate polarizer and/or analyser efficiencies if you also provide a magnetic transmission run via the InputMagWorkspace property. This can used to calculate the polarizer and analyser efficiencies as follows:

\[(2p-1)^2 = \phi\Bigg(\frac{(1-2f_a)I^{00}_{2} + (2f_a-1)I^{10}_{2} - I^{01}_{2} + I^{11}_{2}}{(1-2f_p)I^{00}_{2} + (2f_p-1)I^{01}_{2} - I^{10}_{2} + I^{11}_{2}}\Bigg)\]

From which you can solve for the polarizer efficiency (\(p\)) and then solve for the analyser efficiency (\(a\)) from the following relationship:

\[\phi = (2p-1)(2a-1)\]

Alternatively, previously calculated polarizer and/or analyser efficiency workspaces can be passed to the InputPolarizerEfficiency and InputAnalyserEfficiency properties respectively. If workspaces are provided for both then they are used directly as the output polarizer and analyser efficiencies. If only one is provided then it is used to solve for the other efficiency.

Both types of input workspace group should contain four child workspaces. A flipper configuration must be passed to the Flippers property to identify which child workspaces in the input group(s) correspond to which instrument configurations. The Flippers property takes a string in the form '00, 01, 10, 11', which would indicate both flippers off, analyzer flipper on, polarizer flipper on, both flippers on. The flipper configuration can be provided in any order that matches the child workspaces in the input group(s).

Outputs

As a minimum, the algorithm calculates the polarizing and analysing flipper efficiencies, producing two output workspaces that give these values as a function of wavelength.

If the OutputPolarizerEfficiency property is set then an output workspace will be produced giving the polarizer efficiency as a function of wavelength.

If the OutputAnalyserEfficiency property is set then an output workspace will be produced giving the analyser efficiency as a function of wavelength.

If property IncludeDiagnosticOutputs is set to True then the following diagnostic output workspace properties will be set, again with values calculated as a function of wavelength:

  • OutputPhi - outputs the value that was calculated for \(\phi\).

  • OutputRho - calculates \(2f_p - 1\).

  • OutputAlpha - calculates \(2f_a - 1\).

  • OutputTwoPMinusOne - calculates \(2p-1\). This will only be included in the diagnostic output if the OutputPolarizerEfficiency property has also been set.

  • OutputTwoAMinusOne - calculates \(2a-1\). This will only be included in the diagnostic output if the OutputAnalyserEfficiency property has also been set.

Workspace names are automatically provided for each of the diagnostic outputs (see the property default values), but can be overwritten if desired.

Usage

Example - PolarizationEfficienciesWildes

ws00 = CreateSampleWorkspace(XUnit="Wavelength", NumBanks=1, BankPixelWidth=1, Function="User Defined", UserDefinedFunction="name=UserFunction, Formula=x*0+12")
ws01 = CreateSampleWorkspace(XUnit="Wavelength", NumBanks=1, BankPixelWidth=1, Function="User Defined", UserDefinedFunction="name=UserFunction, Formula=x*0+1")
ws10 = CreateSampleWorkspace(XUnit="Wavelength", NumBanks=1, BankPixelWidth=1, Function="User Defined", UserDefinedFunction="name=UserFunction, Formula=x*0+2")
ws11 = CreateSampleWorkspace(XUnit="Wavelength", NumBanks=1, BankPixelWidth=1, Function="User Defined", UserDefinedFunction="name=UserFunction, Formula=x*0+10")

nonMag = GroupWorkspaces([ws00, ws01, ws10, ws11])

wsM00 = CreateSampleWorkspace(XUnit="Wavelength", NumBanks=1, BankPixelWidth=1, Function="User Defined", UserDefinedFunction="name=UserFunction, Formula=x*0+6")
wsM01 = CreateSampleWorkspace(XUnit="Wavelength", NumBanks=1, BankPixelWidth=1, Function="User Defined", UserDefinedFunction="name=UserFunction, Formula=x*0+0.2")
wsM10 = CreateSampleWorkspace(XUnit="Wavelength", NumBanks=1, BankPixelWidth=1, Function="User Defined", UserDefinedFunction="name=UserFunction, Formula=x*0+0.3")
wsM11 = CreateSampleWorkspace(XUnit="Wavelength", NumBanks=1, BankPixelWidth=1, Function="User Defined", UserDefinedFunction="name=UserFunction, Formula=x*0+1")

mag = GroupWorkspaces([wsM00, wsM01, wsM10, wsM11])

PolarizationEfficienciesWildes('nonMag', 'mag', Flippers='00,01,10,11', IncludeDiagnosticOutputs=False, OutputFpEfficiency="fp", OutputFaEfficiency="fa", OutputPolarizerEfficiency="p", OutputAnalyserEfficiency="a")
fp = AnalysisDataService.retrieve("fp")
print("Polarizing flipper efficiency is: {:.4}".format(fp.readY(0)[0]))

Output:

Polarizing flipper efficiency is: 0.8636

References

Categories: AlgorithmIndex | Reflectometry\PolarizationCorrections

Source

C++ header: PolarizationEfficienciesWildes.h

C++ source: PolarizationEfficienciesWildes.cpp