HyspecScharpfCorrection v1¶
Summary¶
Apply polarization factor as part of getting the spin incoherent scattering
Properties¶
Name |
Direction |
Type |
Default |
Description |
---|---|---|---|---|
InputWorkspace |
Input |
Mandatory |
An input workspace in units of energy transfer. |
|
PolarizationAngle |
Input |
number |
Mandatory |
In plane angle between polatrization and incident beamMust be between -180 and +180 degrees |
Precision |
Input |
number |
0.1 |
If cosine of twice the Scharpf angle is closer to 0 than the precision, the intensities and errors will be set to 0 |
OutputWorkspace |
Output |
Mandatory |
An output workspace. |
Description¶
This algorithm is applying a polarization correction for single crystal
inelastic experiments. If one measures scattering intensity with polarization
along the momentum transfer
where the sf and nsf subscripts stand for spin flip and non-spin flip.
The x direction is parallel to
However, for instruments with multiple detectors and using time of flight
neutrons, one has a constantly varying angle between
This algorithm calculates the Scharpf angle for every event or energy transfer bin,
then divides the intensity by
For a detector at angle
The Scharpf angle is then:
Note
This algorithm assumes that all scattering is in the horizontal plane (good enough approximation for Hyspec instrument, in polarized mode).
For more information, see
Werner Schweika - XYZ-polarisation analysis of diffuse magnetic neutron scattering from single crystals, Journal of Physics: Conference Series, 211,012026, (2010) doi: 10.1088/1742-6596/211/1/012026
Usage¶
Example - HyspecScharpfCorrection
# Create a workspace (NXSPE equivalent)
w = CreateSampleWorkspace(Function='Flat background', NumBanks=1,
BankPixelWidth=1, XUnit='DeltaE',
XMin=-10.25, XMax=20, BinWidth=0.5)
MoveInstrumentComponent(Workspace=w, ComponentName='bank1', X=3, Z=3, RelativePosition=False)
AddSampleLog(Workspace=w,LogName='Ei', LogText='17.1', LogType='Number')
wsOut = HyspecScharpfCorrection(InputWorkspace=w,
PolarizationAngle=-10,
Precision=0.2)
# Get the data
intensity = wsOut.readY(0)
bin_boundaries = wsOut.readX(0)
energy_transfer = 0.5*(bin_boundaries[1:]+bin_boundaries[:-1])
# at DeltaE=5meV, Q makes an angle of 55.7 degrees with incident beam
# If polarization angle is -10 degrees, the intensity should be 0
# Below this energy, the Scharpf angle correction is negative, above
# is positive. If energy transfer is greater than Ei, intensity is
# set to 0
print('Intensity at DeltaE= 0meV: {0:.2f}'.format((intensity[energy_transfer==0])[0]))
print('Intensity at DeltaE= 5meV: {0:.2f}'.format((intensity[energy_transfer==5])[0]))
print('Intensity at DeltaE=10meV: {0:.2f}'.format((intensity[energy_transfer==10])[0]))
print('Intensity at DeltaE=19meV: {0:.2f}'.format((intensity[energy_transfer==19])[0]))
Output:
Intensity at DeltaE= 0meV: -2.37
Intensity at DeltaE= 5meV: 0.00
Intensity at DeltaE=10meV: 1.99
Intensity at DeltaE=19meV: 0.00
Categories: AlgorithmIndex | CorrectionFunctions\SpecialCorrections | Inelastic\Corrections
Source¶
C++ header: HyspecScharpfCorrection.h
C++ source: HyspecScharpfCorrection.cpp