\(\renewcommand\AA{\unicode{x212B}}\)
Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
Workspace | InOut | MatrixWorkspace | Mandatory | CORELLI workspace to calibrate |
CalibrationTable | Input | TableWorkspace | Mandatory | TableWorkspace containing calibration table |
Update the CORELLI instrument geometry with calibration data stored in a predefined calibration table workspace. The current inputs are:
The calibration table must have the following columns
Applying the calibration involves the following steps:
(Xposition, Yposition, Zposition)
RotationAngle
degrees around rotation axis (directionCosine, YdirectionCosine, ZdirectionCosine)
# import mantid algorithms, numpy and matplotlib
from mantid.simpleapi import *
import matplotlib.pyplot as plt
import numpy as np
# setting up a mocked calibration table
calitable = CreateEmptyTableWorkspace()
headers = [
"ComponentName",
"Xposition", "Yposition", "Zposition",
"XdirectionCosine", "YdirectionCosine", "ZdirectionCosine", "RotationAngle",
]
datatypes = ["str"] + ["double"]*7
for dt, hd in zip(datatypes, headers):
calitable.addColumn(dt, hd)
calitable.addRow(["bank42/sixteenpack", 0., 0, 0., 0,1,0,180]) # move to (0,0,0) and rotate to (0,1,0)@180degree
# laod emptry instrument
ws_original = LoadEmptyInstrument("CORELLI_Definition.xml")
ws_calibrated = ConvertToEventWorkspace(ws_original)
# apply the calibration to ws
CorelliCalibrationApply(ws_calibrated, calitable) # in-place operation
The original instrument view
and the calibrated instrument view (notice one panel is moved to the center and rotate to (0,1,0)@180 degree)
Categories: AlgorithmIndex | Diffraction\Calibration
C++ header: CorelliCalibrationApply.h (last modified: 2021-08-04)
C++ source: CorelliCalibrationApply.cpp (last modified: 2021-03-31)