Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | MatrixWorkspace | Mandatory | A 1D Workspace that contains values to select against |
Mode | Input | string | SelectIf | Mode to select or deselect detectors based on comparison with values. Allowed values: [‘SelectIf’, ‘DeselectIf’] |
Operator | Input | string | Equal | Unary operator to compare to given values. Allowed values: [‘Equal’, ‘NotEqual’, ‘Greater’, ‘GreaterEqual’, ‘Less’, ‘LessEqual’] |
Value | Input | number | 0 | |
InputCalFile | Input | string | The name of the CalFile with grouping data. Allowed extensions: [‘.cal’] | |
OutputCalFile | Input | string | The name of the CalFile with grouping data. Allowed extensions: [‘.cal’] | |
OutputWorkspace | Output | MatrixWorkspace | The masked workspace. |
Iterates over the input workspace evaluating the test for the first bin in each spectrum. There are two output modes:
Example - mask spectra whose integral is below some limit
ws = CreateSampleWorkspace()
# One spectrum has lower counts than the rest
badIndex = 3
Ys = ws.dataY(badIndex)
Ys *= 0.01
integral = Integration(ws)
MaskDetectorsIf(integral, Operator='Less', Value=10., OutputWorkspace=integral)
MaskDetectors(ws, MaskedWorkspace=integral)
# Inspect the result
isMasked = ws.spectrumInfo().isMasked(badIndex)
print('Spectrum at index {} is masked? {}'.format(badIndex, isMasked))
Output:
Spectrum at index 3 is masked? True
Categories: AlgorithmIndex | Diffraction\Masking | Transforms\Masking
C++ source: MaskDetectorsIf.cpp (last modified: 2019-06-05)
C++ header: MaskDetectorsIf.h (last modified: 2018-10-05)