\(\renewcommand\AA{\unicode{x212B}}\)

GenerateGroupingSNSInelastic v1

Summary

Generate grouping files for ARCS, CNCS, HYSPEC, and SEQUOIA.

See Also

GroupWorkspaces

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’]

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.

Note

All parameters are strings. Using integers for AlongTubes or AcrossTubes will cause errors

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

GenerateGroupingSNSInelastic.png

Categories: AlgorithmIndex | Inelastic\Utility | Transforms\Grouping

Source

Python: GenerateGroupingSNSInelastic.py