\(\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 |
Mandatory |
Analyser efficiency as a function of wavelength |
|
OutputWorkspace |
Output |
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]
Since the efficiency, \(\epsilon_{SM}\), is given by \(\frac{1 + P_{SM}}{2}\), we have that
The error in the calculation can then be determined thus:
where:
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