\(\renewcommand\AA{\unicode{x212B}}\)
GenerateGroupingSNSInelastic v1¶
Summary¶
Generate grouping files for ARCS, CNCS, HYSPEC, and SEQUOIA.
See Also¶
Properties¶
Name |
Direction |
Type |
Default |
Description |
---|---|---|---|---|
AlongTubes |
Input |
string |
1 |
Number of pixels across tubes to be grouped. Allowed values: [‘1’, ‘2’, ‘4’, ‘8’, ‘16’, ‘32’, ‘64’, ‘128’] |
AcrossTubes |
Input |
string |
1 |
Number of pixels across tubes to be grouped. Allowed values: [‘1’, ‘2’, ‘4’, ‘8’] |
Instrument |
Input |
string |
ARCS |
The instrument for wich to create grouping. Allowed values: [‘ARCS’, ‘CNCS’, ‘HYSPEC’, ‘SEQUOIA’, ‘InstrumentDefinitionFile’] |
InstrumentDefinitionFile |
Input |
string |
Select the instrument definition file from only one of ARCS, SEQUOIA, CNCS, HYSPEC. Allowed extensions: [‘.xml’] |
|
Filename |
Input |
string |
Mandatory |
Output filename. Allowed extensions: [‘.xml’] |
Description¶
Generate grouping files for ARCS, CNCS, HYSPEC, and SEQUOIA, by grouping py pixels along a tube and px tubes. py is 1, 2, 4, 8, 16, 32, 64, or 128. px is 1, 2, 4, or 8.
To select older instrument definition file, set instrument to “InstrumentDefinitionFile” and an input option will appear, allowing users to navigate to the correct directory.
Note
All parameters are strings. Using integers for AlongTubes or AcrossTubes will cause errors. Only instrument definition files from ARCS, SEQUOIA, CNCS, HYSPEC are supported. If both an instrument and InstrumentDefinitionFile are selected, InstrumentDefinitionFile will be ignored.
Usage¶
Note
To run these usage examples please first download the usage data, and add these to your path. In Mantid this is done using Manage User Directories.
# create some grouping file
import mantid
outputFilename=mantid.config.getString("defaultsave.directory")+"cncs.xml"
GenerateGroupingSNSInelastic(outputFilename,AlongTubes="16",AcrossTubes="4",Instrument="CNCS")
#check that it works
import os.path
if(os.path.isfile(outputFilename)):
print("Found file cncs.xml")
ws=Load("CNCS_7860")
wsg=GroupDetectors(ws,outputFilename)
print("The grouped workspace has {} histograms".format(wsg.getNumberHistograms()))
Output:
Found file cncs.xml
The grouped workspace has 800 histograms
If one would use LoadDetectorsGroupingFile on cncs.xml one would get a workspace that looks like
Categories: AlgorithmIndex | Inelastic\Utility | Transforms\Grouping
Source¶
Python: GenerateGroupingSNSInelastic.py