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

PolarizerEfficiency v1

Summary

Calculates the efficiency of a polarizer.

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

WorkspaceGroup

Mandatory

Input group workspace to use for polarization calculation

AnalyserEfficiency

Input

MatrixWorkspace

Mandatory

Analyser efficiency as a function of wavelength

OutputWorkspace

Output

MatrixWorkspace

Polarizer efficiency as a function of wavelength

SpinStates

Input

string

11,10,01,00

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

OutputFilePath

Input

string

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

Description

Calculates how the efficiency of a polarizer varies with wavelength. The ordering of the workspaces in InputWorkspace is taken from the SpinStates parameter, and the analyser efficiency, \(\epsilon_{cell}\), is given by AnalyserEfficiency.

The polarization of the polarizer, \(P_{SM}\), is given by [1]

\[P_{SM} = \frac{T_{00} - T_{01}}{2P_{cell}(T_{00} + T_{01})}\]

Since the efficiency, \(\epsilon_{SM}\), is given by \(\frac{1 + P_{SM}}{2}\), we have that

\[\epsilon_{SM} = \frac{1}{2} + \frac{T_{00} - T_{01}}{2(2\epsilon_{cell} - 1)(T_{00} + T_{01})}\]

The error in the calculation can then be determined thus:

\[\sigma_{\epsilon_{SM}} = \sqrt{|\frac{\partial \epsilon_{SM}}{\partial T_{00}}|^2 * \sigma^2_{T_{00}} + |\frac{\partial \epsilon_{SM}}{\partial T_{01}}|^2 * \sigma^2_{T_{01}} + |\frac{\partial \epsilon_{SM}}{\partial \epsilon_{cell}}|^2 * \sigma^2_{\epsilon_{cell}}}\]

where:

\[\frac{\partial \epsilon_{SM}}{\partial T_{00}} = \frac{T_{01}}{(2\epsilon_{cell} - 1)(T_{00} + T_{01})^2}\]
\[\frac{\partial \epsilon_{SM}}{\partial T_{01}} = \frac{-T_{00}}{(2\epsilon_{cell} - 1)(T_{00} + T_{01})^2}\]
\[\frac{\partial \epsilon_{SM}}{\partial \epsilon_{cell}} = \frac{T_{01} - T_{00}}{(2\epsilon_{cell} - 1)^2(T_{00} + T_{01})}\]

Usage

Example - Calculate Polarizer Efficiency

wsPara = CreateSampleWorkspace('Histogram', Function='User Defined', UserDefinedFunction='name=UserFunction,Formula=0.5*exp(-0.0733*12*x*(1-0.1))',XUnit='Wavelength', xMin='1',XMax='8', BinWidth='1', NumBanks='1', BankPixelWidth='1')
wsPara1 = CloneWorkspace(wsPara)
wsAnti = CreateSampleWorkspace('Histogram', Function='User Defined', UserDefinedFunction='name=UserFunction,Formula=0.5*exp(-0.0733*12*x*(1+0.1))',XUnit='Wavelength', xMin='1',XMax='8', BinWidth='1', NumBanks='1', BankPixelWidth='1')
wsAnti1 = CloneWorkspace(wsAnti)

grp = GroupWorkspaces([wsPara,wsAnti,wsPara1,wsAnti1])
eCell = CreateSampleWorkspace('Histogram', Function='User Defined', UserDefinedFunction='name=UserFunction,Formula=(1 + tanh(0.0733 * 12 * x * 0.2))/2',XUnit='Wavelength', xMin='1',XMax='8', BinWidth='1', NumBanks='1', BankPixelWidth='1')

psm = PolarizerEfficiency(grp, eCell)
print("Polarizer efficiency at a wavelength of " + str(mtd['psm'].dataX(0)[3]) + " Å is " + str(mtd['psm'].dataY(0)[3]))

Output:

Polarizer efficiency at a wavelength of 4.0 Å is ...

References

Categories: AlgorithmIndex | SANS\PolarizationCorrections

Source

C++ header: PolarizerEfficiency.h

C++ source: PolarizerEfficiency.cpp