ExtractUnmaskedSpectra v1

../_images/ExtractUnmaskedSpectra-v1_dlg.png

ExtractUnmaskedSpectra dialog.

Summary

Extracts unmasked spectra from a workspace and places them in a new workspace.

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace Mandatory An input workspace.
MaskWorkspace Input MatrixWorkspace   An optional mask workspace.
OutputWorkspace Output MatrixWorkspace 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: Algorithms | Transforms\Splitting

Source

C++ source: ExtractUnmaskedSpectra.cpp (last modified: 2016-06-13)

C++ header: ExtractUnmaskedSpectra.h (last modified: 2016-06-13)