GenerateGroupingPowder v1

../_images/GenerateGroupingPowder-v1_dlg.png

GenerateGroupingPowder dialog.

Summary

Generate grouping by angles.

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace Mandatory An input workspace.
AngleStep Input number Mandatory The angle step for grouping
GroupingFilename Input string Mandatory A grouping file that will be created. The corresponding .par file will be created as well. Allowed extensions: [‘.xml’]

Description

For powder samples, with no texture, the scattering consists only of rings. This algorithm reads a workspace and an angle step, then generates a grouping file (.xml) and a par file (.par), by grouping detectors in intervals i*step to (i+1)*step. The par file is required for saving in the NXSPE format, since Mantid does not correctly calculate the angles for detector groups. It will contain average distances to the detector groups, and average scattering angles. The x and y extents in the par file are radians(step)*distance and 0.01, and are not supposed to be accurate.

Usage

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.

# create some grouping file
import mantid
outputFilename=mantid.config.getString("defaultsave.directory")+"powder.xml"

#load some file
ws=Load("CNCS_7860")

#generate the files
GenerateGroupingPowder(ws,10,outputFilename)

#check that it works
import os.path
if(os.path.isfile(outputFilename)):
    print "Found file powder.xml"
if(os.path.isfile(mantid.config.getString("defaultsave.directory")+"powder.par")):
    print "Found file powder.par"
wsg=GroupDetectors(ws,outputFilename)
print "The grouped workspace has ",wsg.getNumberHistograms(), " histograms"

Output:

Found file powder.xml
Found file powder.par
The grouped workspace has  14  histograms

If one would use LoadDetectorsGroupingFile on powder.xml one would get a workspace that looks like

GenerateGroupingPowder.png

Categories: Algorithms | DataHandling\Grouping | Transforms\Grouping | Diffraction\Utility