Table of Contents
Create a calibration file (extension .cal) from a workspace by harvesting the detector ids from the instrument. All of the offsets will be zero, and the pixels will be all grouped into group one and the final column should be one. This will allow generating powder patterns from instruments that have not done a proper calibration.
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | MatrixWorkspace | Mandatory | The workspace containing the geometry to be calibrated. |
CalFilename | Input | string | Mandatory | The name of the output [[CalFile]]. Allowed extensions: [‘.cal’] |
Create a dummy calibration file for diffraction focusing with one group.
Offsets in the file are all sets to zero and all detectors are selected. Overwrites a calibration file that already exists at the location specified.
Detectors will be assigned to group one when using AlignDetector or DiffractionFocussing algorithms.
Example - CreateDummyCalFile for MUSR
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.
import os
result = Load("MUSR00015189")
group = result[0]
ws_1 = group[0]
ws_2 = group[1]
newFile = os.path.join(os.path.expanduser("~"), "dummy.cal")
# Run the Algorithm
CreateDummyCalFile(ws_1,newFile)
# Check the output file
print "File Exists:", os.path.exists(newFile)
f = open( newFile, 'r' )
file = f.read().split('\n')
f.close()
for line in file[0:6]:
# print the line truncating before system dependent line break can take effect
# also stripping off any trailing spaces
print line[0:89].rstrip()
Output:
File Exists: True
# Diffraction focusing calibration file created by Mantid
# Detectors have been grouped using assembly names:MUSR
# No template file, all offsets set to 0.0 and select to 1
# Number UDET offset select group
0 33 0.0000000 1 1
1 34 0.0000000 1 1
Categories: Algorithms | Diffraction