\(\renewcommand\AA{\unicode{x212B}}\)
ExtractUnmaskedSpectra v1¶
Summary¶
Extracts unmasked spectra from a workspace and places them in a new workspace.
See Also¶
Properties¶
Name |
Direction |
Type |
Default |
Description |
---|---|---|---|---|
InputWorkspace |
Input |
Mandatory |
An input workspace. |
|
MaskWorkspace |
Input |
An optional mask workspace. |
||
OutputWorkspace |
Output |
Mandatory |
An output workspace. |
Description¶
This algorithm is useful for removing unwanted spectra using masks. If MaskWorkspace is provided it is used to select the spectra to remove. Otherwise the internal mask in the InputWorkspace is used.
Usage¶
Example - ExtractUnmaskedSpectra
# Create histogram workspace
ws = CreateSampleWorkspace()
# Mask 10 spectra
MaskDetectors(ws, [1,2,3,4,5,6,7,8,9,10])
# Extract unmasked into a new workspace
ows = ExtractUnmaskedSpectra(ws)
# Compare workspace sizes
print('Number of spectra in original workspace {}'.format(ws.getNumberHistograms()))
print('Number of spectra in cropped workspace {}'.format(ows.getNumberHistograms()))
Output:
Number of spectra in original workspace 200
Number of spectra in cropped workspace 190
Categories: AlgorithmIndex | Transforms\Splitting
Source¶
C++ header: ExtractUnmaskedSpectra.h
C++ source: ExtractUnmaskedSpectra.cpp