Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | MaskWorkspace | Mandatory | MaskWorkspace to be inverted. |
OutputWorkspace | Output | MaskWorkspace | MaskWorkspace has inverted bits from input MaskWorkspace. |
A NOT operation will be conducted on the input masking workspace (SpecialWorkspace2D)
Example - invert a POWGEN mask:
# Load data
maskws = LoadMask(Instrument="POWGEN", InputFile="Mask-PG3-19884.xml")
# Check source mask workspace
nummasked = 0
for i in xrange(maskws.getNumberHistograms()):
if maskws.readY(i)[0] > 0.5:
nummasked += 1
# Invert mask
invmaskws = InvertMask(InputWorkspace=maskws)
# Check target mask workspace
nummasked2 = 0
for i in xrange(invmaskws.getNumberHistograms()):
if invmaskws.readY(i)[0] > 0.5:
nummasked2 += 1
# Print out
print "Number of histogram: ", maskws.getNumberHistograms()
print "Source Mask workspace # Detectors masked = ", nummasked
print "Source Mask workspace # Detectors masked = ", nummasked2
Output:
Number of histogram: 33418
Source Mask workspace # Detectors masked = 82
Source Mask workspace # Detectors masked = 33336
Categories: Algorithms | Transforms\Masking