PDCalibration v1

../_images/PDCalibration-v1_dlg.png

PDCalibration dialog.

Summary

Calibrate the detector pixels and create a calibration table

Properties

Name Direction Type Default Description
SignalWorkspace InOut MatrixWorkspace Mandatory Input signal workspace. If the workspace does not exist it will read it from the SignalFile into this workspace.
SignalFile Input string   Calibration measurement. Allowed extensions: [‘_event.nxs’, ‘.nxs.h5’, ‘.nxs’]
BackgroundFile Input string   Calibration background. Allowed extensions: [‘_event.nxs’, ‘.nxs.h5’, ‘.nxs’]
MaxChunkSize Input number Optional Get chunking strategy for chunks with this number of Gbytes. File will not be loaded if this option is set.
FilterBadPulses Input number 95 The percentage of the average to use as the lower bound
TofBinning Input dbl list Mandatory Min, Step, and Max of time-of-flight bins. Logarithmic binning is used if Step is negative.
PreviousCalibration Input string   Calibration measurement. Allowed extensions: [‘.h5’, ‘.cal’]
PeakPositions Input dbl list Mandatory Comma delimited d-space positions of reference peaks.
PeakWindow Input number 0.1 The maximum window (in d space) around peak to look for peak.
FWHM Input number 7 Estimated number of points covered by the fwhm of a peak (default 7)
Tolerance Input number 4 A measure of the strictness desired in meeting the condition on peak candidates, Mariscotti recommends 2 (default 4)
PeakFunction Input string Gaussian Allowed values: [‘BackToBackExponential’, ‘Gaussian’, ‘Lorentzian’]
BackgroundType Input string Linear Type of Background. Allowed values: [‘Flat’, ‘Linear’, ‘Quadratic’]
HighBackground Input boolean True Relatively weak peak in high background
MinGuessedPeakWidth Input number 4 Minimum guessed peak width for fit. It is in unit of number of pixels.
MaxGuessedPeakWidth Input number 4 Maximum guessed peak width for fit. It is in unit of number of pixels.
MinimumPeakHeight Input number 2 Minimum allowed peak height.
MaxChiSq Input number 100 Maximum chisq value for individual peak fit allowed. (Default: 100)
StartFromObservedPeakCentre Input boolean True Use observed value as the starting value of peak centre.
CalibrationParameters Input string DIFC Select calibration parameters to fit. Allowed values: [‘DIFC’, ‘DIFC+TZERO’, ‘DIFC+TZERO+DIFA’]
OutputCalibrationTable Output TableWorkspace Mandatory An output workspace containing the Calibration Table

Description

This algorithm calibrates the detector pixels and creates a diffraction calibration workspace. Unlike CalibrateRectangularDetectors v1 the peak fitting and calibration is done in TOF not d spacing. The peak d values are converted to TOF based on either the old calibration or the instrument geometry. The SignalFile or SignalWorkspace contains the data from a standard sample. The results are then fitted with up to difc, t_zero and difa, these values are details in AlignDetectors v1.

The peak fitting properties are explained in FindPeaks v1. This also uses the same criteria on peaks as GetDetOffsetsMultiPeaks v1.

A mask workspace is created, named “OutputCalibrationTable” + ‘_mask’, with uncalibrated pixels masked.

The resulting calibration table can be saved with SaveDiffCal v1, loaded with LoadDiffCal v1 and applied to a workspace with AlignDetectors v1.

Usage

Example - PDCalibration

# If you have a old calibration it can be used as the starting point
oldCal = 'NOM_calibrate_d72460_2016_05_23.h5'

# list of d values for diamond
dvalues = (0.3117,0.3257,0.3499,0.4205,0.4645,0.4768,0.4996,0.5150,0.5441,0.5642,0.5947,0.6307,.6866,.7283,.8185,.8920,1.0758,1.2615,2.0599)

PDCalibration(SignalWorkspace='uncalibrated',
              SignalFile='NOM_72460',
              TofBinning=[300,-.001,16666.7],
              PreviousCalibration=oldCal,
              PeakPositions=dvalues,
              OutputCalibrationTable='cal')

# Print the result
print("The calibrated difc at detid {detid} is {difc}".format(**mtd['cal'].row(40000)))

Output:

The calibrated difc at detid 40896 is 5522.64160156

Categories: Algorithms | Diffraction\Calibration

Source

C++ source: PDCalibration.cpp

C++ header: PDCalibration.h