Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
Workspace | Input | Workspace | Mandatory | Input workspace |
MinAngle | Input | number | 0 | Angles above StartAngle are going to be masked |
MaxAngle | Input | number | 0 | Angles above StartAngle are going to be masked |
MaskedDetectors | Output | int list | List of detector masked, with scatterin angles between MinAngle and MaxAngle |
Algorithm to mask detectors with scattering angles in a given interval (in degrees) By default MinAngle=0, MaxAngle=180, so if no keywords are set, all detectors are going to be masked Returns a list of detectors that were masked
Note
To run these usage examples please first download the usage data, and add these to your path. In MantidPlot this is done using Manage User Directories.
#Load a workspace
ws=Load("CNCS_7860")
#Do the masking for direct beam
mask=MaskAngle(ws,MinAngle=0,MaxAngle=10)
print "The algorithm has masked ",mask.size," detectors"
#to test check a couple of detectors
inst=ws.getInstrument()
print "Is the minimum element in the mask list (detector ",mask.min(),") masked? ",inst.getDetector(int(mask.min())).isMasked()
print "Is the maximum element in the mask list (detector ",mask.max(),") masked? ",inst.getDetector(int(mask.max())).isMasked()
print "Is a detector outside the list masked (for example detector 100)? ", inst.getDetector(100).isMasked()
Output:
The algorithm has masked 1516 detectors
Is the minimum element in the mask list (detector 35126 ) masked? True
Is the maximum element in the mask list (detector 38601 ) masked? True
Is a detector outside the list masked (for example detector 100)? False
The instrument view would look like:
Categories: Algorithms | PythonAlgorithms | Transforms | Masking
Python: MaskAngle.py