Table of Contents
Read calibration information from focused workspace and GSAS parameter file, and save to MAUD-readable calibration format
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | WorkspaceGroup | Mandatory | WorkspaceGroup of focused banks |
GSASParamFile | Input | string | Mandatory | GSAS parameter file to read diffractometer constants and profile coefficients from |
TemplateFilename | Input | string | /home/builder/Jenkins/workspace/release_clean-rhel7/scripts/Diffraction/isis_powder/gem_routines/maud_param_template.maud | Template for the .maud file |
GroupingScheme | Input | int list | An array of bank IDs, where the value at element i is the ID of the bank in GSASParamFile to associate spectrum i with | |
OutputFilename | Input | string | Mandatory | Name of the file to save to |
Creates a .maud calibration file from a set of focused diffraction workspaces and a GSAS calibration file.
.maud is a text-based format used to convert the data in a GDA file (see SaveGDA) from TOF to D-spacing in MAUD. The algorithm uses a template to produce its output, which lives in scripts/Diffraction/isis_powder/gem_routines/maud_param_template.maud.
The parameters of interest in the .maud file are:
It should be noted that calibration parameters are not given for every bank, as generating such a file would be impractical, given the data we get from texture experiments on GEM.
Instead we assign each of the 160 banks the parameters from one of the 6 banks used when focusing GEM data normally. This algorithm’s ‘sister algorithm’, SaveGDA applies a D to TOF conversion using the same parameters per bank (essentially faking the time-of-flight). See D to TOF Conversion for more details on this.
References:
[RonSmith] | Smith, R. “Refinement of time of flight Profile Parameters in GSAS” |
[GSASManual] | Larson, A. C. & Von Dreele, R. B (2004). “General Structure Analysis System (GSAS)”, Los Alamos National Laboratory Report LAUR 86-748 |
import os
def collect_parameter(param_header, file_contents):
file_index = file_contents.index(param_header) + 1
param_values = []
while file_contents[file_index]:
param_values.append(float(file_contents[file_index]))
file_index += 1
return param_values
# Banks 1 to 4 of a previous texture focus in isis_powder
# We don't use the full 160 banks as the test becomes too slow
input_group = Load(Filename="GEM61785_D_texture_banks_1_to_4.nxs",
OutputWorkspace="SaveGEMMAUDParamFiletest_GEM61785")
output_file = os.path.join(config["defaultsave.directory"], "GEM61785.maud")
SaveGEMMAUDParamFile(InputWorkspace=input_group,
OutputFilename=output_file,
GSASParamFile="GEM_PF1_PROFILE.IPF",
# Assign spectra 1, 2 and 3 to bank 2 in calib file,
# and spectrum 4 to bank 3
GroupingScheme=[2, 2, 2, 3])
with open(output_file) as f:
file_contents = f.read().split("\n")
difcs = collect_parameter("_instrument_bank_difc", file_contents)
print("DIFC values: " + " ".join("{:.2f}".format(difc) for difc in difcs))
thetas = collect_parameter("_instrument_bank_tof_theta", file_contents)
print("Theta values: " + " ".join("{:.2f}".format(theta) for theta in thetas))
Output:
DIFC values: 1468.19 1468.19 1468.19 2788.34
Theta values: 9.12 8.16 8.04 9.06
Categories: AlgorithmIndex | DataHandling\Text | Diffraction\DataHandling