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

ReflectometryBeamStatistics v1

../_images/ReflectometryBeamStatistics-v1_dlg.png

ReflectometryBeamStatistics dialog.

Summary

Calculates statistical quantities of a reflectometry workspace.

Properties

Name Direction Type Default Description
ReflectedBeamWorkspace InOut MatrixWorkspace Mandatory A reflected beam workspace.
ReflectedForeground Input int list Mandatory A list of three workspace indices [start, beam centre, end] defining the reflected foreground.
DirectLineWorkspace InOut MatrixWorkspace Mandatory A direct beam workspace.
DirectForeground Input int list Mandatory A list of three workspace indices [start, beam centre, end] defining the direct foreground.
PixelSize Input number Mandatory Detector pixel size, in meters.
DetectorResolution Input number Mandatory Detector pixel resolution, in meters.
FirstSlitName Input string Mandatory Name of the first slit component.
FirstSlitSizeSampleLog Input string Mandatory The sample log entry for the first slit opening.
SecondSlitName Input string Mandatory Name of the second slit component.
SecondSlitSizeSampleLog Input string Mandatory The sample log entry for the second slit opening.

Description

This algorithm computes quantities needed by ReflectometryMomentumTransfer and ReflectometrySumInQ, and adds the results to the sample logs of ReflectedBeamWorkspace. The following sample logs get added:

beam_stats.beam_rms_variation
\(=2 \sqrt{2 \ln 2} s \sqrt{\sigma}\), where \(s\) is PixelSize and \(\sigma\) is the variance of the intensity (integrated over all wavelengths) distribution of the detectors in the foreground region.
beam_stats.bent_sample
1 if the sample can be regarded as non-flat and the beam is collimated, 0 in the case of divergent beam.
bean_stats.first_slit_angular_spread
\(=0.68 x_{slit1} / d_{slits}\), where \(x_{slit1}\) is the size of the first slit and \(d_{slits}\) is the distance between the first and second slit.
beam_stats.incident_angular_spread
\(=0.68 \sqrt{x_{slit1}^2 + x_{slit2}^2} / d_{slits}\), where \(x_{slit1}\) is the size of the first and \(x_{slit2}\) the size of the second slit while \(d_{slits}\) is the distance between the slits.
beam_stats.sample_waviness
The heuristically calculated root mean squared sample waviness.
beam_stats.second_slit_angular_spread
\(=0.68 x_{slit2} / (d_{slit2} + l_2)\), where \(x_{slit2}\) is the size of the second slit, \(d_{slit2}\) is the second slit-to-sample distance and \(l_2\) is the sample-to-reflected foreground centre distance.

Additionally, beam_stats.beam_rms_variation is cached to the sample logs of DirectLineWorkspace removing the need to recalculate the quantity every time the same direct beam passed to this algorithm.

Usage

Example - ReflectometryBeamStatistics

dir = Load('ILL/D17/317369.nxs')
ref = Load('ILL/D17/317370.nxs')

ReflectometryBeamStatistics(
    ReflectedBeamWorkspace=ref,
    ReflectedForeground=[199, 202, 205],
    DirectLineWorkspace=dir,
    DirectForeground=[200, 202, 205],
    PixelSize=0.001195,
    DetectorResolution=0.00022,
    FirstSlitName='slit2',
    FirstSlitSizeSampleLog='VirtualSlitAxis.s2w_actual_width',
    SecondSlitName='slit3',
    SecondSlitSizeSampleLog='VirtualSlitAxis.s3w_actual_width')
run = ref.run()
bent = run.getProperty('beam_stats.bent_sample').value
print('Bent sample? {}'.format('yes' if bent == 1 else 'no'))
rms = run.getProperty('beam_stats.beam_rms_variation').value
print('Beam RMS variation: {:.3}'.format(rms))
run = dir.run()
rms = run.getProperty('beam_stats.beam_rms_variation').value
print('RMS variation cached in dir: {:.3}'.format(rms))

Output:

Bent sample? no
Beam RMS variation: 0.00236
RMS variation cached in dir: 0.00208

Categories: AlgorithmIndex | ILL\Reflectometry | Reflectometry

Source

C++ header: ReflectometryBeamStatistics.h (last modified: 2021-03-31)

C++ source: ReflectometryBeamStatistics.cpp (last modified: 2021-03-31)