MaskInstrument v1

../_images/MaskInstrument-v1_dlg.png

MaskInstrument dialog.

Summary

Mask detectors in the instrument WITHOUT clearing data in associated spectra.

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace Mandatory  
OutputWorkspace Output MatrixWorkspace Mandatory Name of the output workspace (can be same as InputWorkspace)
DetectorIDs Input int list   List of detector IDs to mask

Description

Mask specified detectors in an instrument. This is does not clear the data in associated spectra in the workspace. To clear the data manually ClearMaskedSpectra can be called.

Usage

Example - MaskInstrument

ws = CreateSampleWorkspace()
ws = MaskInstrument(InputWorkspace=ws, DetectorIDs='100,102-104')
# Detectors are masked but data is untouched
for i in range(6):
  print("Detector {} masked: {:5} data {}".format(i, str(ws.getDetector(i).isMasked()), ws.readY(i)[0]))

Output:

Detector 0 masked: True  data 0.3
Detector 1 masked: False data 0.3
Detector 2 masked: True  data 0.3
Detector 3 masked: True  data 0.3
Detector 4 masked: True  data 0.3
Detector 5 masked: False data 0.3

Categories: AlgorithmIndex | Transforms\Masking

Source

C++ source: MaskInstrument.cpp (last modified: 2019-06-05)

C++ header: MaskInstrument.h (last modified: 2018-10-05)