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

CreateDummyCalFile v1

Summary

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.

See Also

ReadGroupsFromFile, CreateCalFileByNames, AlignDetectors, DiffractionFocussing, LoadCalFile, SaveCalFile, MergeCalFiles

Properties

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

Description

Instrument Tree

Instrument Tree

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.

Usage

Example - CreateDummyCalFile for MUSR

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.

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: {}".format(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: AlgorithmIndex | Diffraction\DataHandling\CalFiles

Source

C++ header: CreateDummyCalFile.h

C++ source: CreateDummyCalFile.cpp