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, ϵcell, is given by AnalyserEfficiency.

The polarization of the polarizer, PSM, is given by [1]

PSM=T00T012Pcell(T00+T01)

Since the efficiency, ϵSM, is given by 1+PSM2, we have that

ϵSM=12+T00T012(2ϵcell1)(T00+T01)

The error in the calculation can then be determined thus:

σϵSM=|ϵSMT00|2σT002+|ϵSMT01|2σT012+|ϵSMϵcell|2σϵcell2

where:

ϵSMT00=T01(2ϵcell1)(T00+T01)2
ϵSMT01=T00(2ϵcell1)(T00+T01)2
ϵSMϵcell=T01T00(2ϵcell1)2(T00+T01)

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