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

HeliumAnalyserEfficiencyTime v1

Summary

Calculates the helium analyzer efficiency at the input workspace run time using the lifetime, initial polarization and mean gas length of the analyzer

See Also

HeliumAnalyserEfficiency, DepolarizedAnalyserTransmission

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

Workspace

Mandatory

Scattering Workspace from which to extract the experiment timestamp

ReferenceWorkspace

Input

Workspace

Reference workspace for which to extract the reference timestamp and wavelength range

ReferenceTimeStamp

Input

string

An ISO formatted date/time string specifying reference timestamp with respect to the scattering workspace start time, e.g 2010-09-14T04:20:12

PXD

Input

number

12

Gas pressure in bar multiplied by cell length in metres

PXDError

Input

number

0

Error in pxd

InitialPolarization

Input

number

0.9

Initial Polarization of He Gas in cell

InitialPolarizationError

Input

number

0

Error in initial polarization

Lifetime

Input

number

45

Lifetime of polarization decay of He gas in cell (in hours)

LifetimeError

Input

number

0

Error in lifetime (in hours)

OutputWorkspace

Output

MatrixWorkspace

Mandatory

Helium analyzer efficiency as a function of wavelength

UnpolarizedTransmission

Output

MatrixWorkspace

Unpolarized beam transmission as a function of wavelength

Description

Takes a polarised SANS scattering run and calculates the efficiency of the Helium analyzer at the time of the run as compared to a reference time provided either as a time stamp in the ReferenceTimeStamp property or extracted from a ReferenceWorkspace, which would typically be an analyzer calibration run.

The efficiency is calculated from the following expression [1]:

\[\epsilon_{cell} = \frac{ 1+ \tanh(\mu \, p_{He}(t_{run}, t_{ref}))}{2}\]

Where \(\mu\) is the neutron attenuation length :

\[\mu = 0.0733 \, p \, d \, \lambda\]

And the polarization of the helium gas at the time of measurement, \(p_{He}(t_{run}, t_{ref})\), is calculated as follows:

\[p_{He}(t_{run}, t_{ref}) = p_{He_{0}} e^{-(| t_{run}- t_{ref} |)/\Gamma}\]

Input parameters are the pressure of the analyzer cell multiplied by cell length \(pd\) (PXD), the initial polarization of Helium gas in the cell, \(p_{He_{0}}\) (InitialPolarization), as well as the lifetime of the polarized gas, \(\Gamma\) (Lifetime) . Errors are calculated using standard error propagation considering no correlation between input parameters.

Optionally, the unpolarized transmission can be calculated if the UnpolarizedTransmission parameter is set, following [1].

\[T_{{}^{3}He}^{unpol} = e^{-\mu} \cosh(\mu p_{He})\]

Where we have taken the approximation that \(T_E = 1\).

The wavelength range and bins are extracted from the ReferenceWorkspace or else the InputWorkspace if a reference is not provided. These will be used to populated the x axes of the OutputWorkspace.

Usage

Example - Use case with default parameters:

import matplotlib.pyplot as plt
from mantid.kernel import DateAndTime
import numpy as np

def createWorkspaceWithTime(x,y,name,refTimeStamp, delay):
     CreateWorkspace(DataX = x, DataY = y, OutputWorkspace = name, UnitX = 'Wavelength')
     run = mtd[name].getRun()
     start = np.datetime64(refTimeStamp)
     run.setStartAndEndTime(DateAndTime(str(start+int(3600*delay))), DateAndTime(str(start+int(3600*(delay+1)))))
     ConvertToHistogram(InputWorkspace = name, OutputWorkspace = name)

timeStamp = "2025-07-01T07:00:00"
createWorkspaceWithTime(np.linspace(1,10,20), np.ones(19), 'ws1',timeStamp, 10)
#We use default input parameters of the algorithm
out = HeliumAnalyserEfficiencyTime(InputWorkspace = 'ws1', ReferenceTimeStamp = timeStamp)
fig, ax = plt.subplots(subplot_kw={'projection': 'mantid'})
ax.plot(out, wkspIndex=0)
ax.set_ylabel('Efficiency')
fig.show()
# Use plt.show() if running the script outside of Workbench
#plt.show()

References

Categories: AlgorithmIndex | SANS\PolarizationCorrections

Source

C++ header: HeliumAnalyserEfficiencyTime.h

C++ source: HeliumAnalyserEfficiencyTime.cpp