Powder Diffraction Calibration

Calculating Calibration

Data Required

You will need to run a sample which will create good clean peaks at known reference dSpacing positions. To get a good calibration you will want good statistics on this calibration data.

Steps for rectangular detector based instruments

If you are trying to calibrate an instrument that uses rectangular detectors the SNS have created a single algorithm to do all of this for you, CalibrateRectangularDetectors. At the time of writing this only supports SNS instruments, but look at the algorithm link for an up to date list.

Steps for other instruments

  1. Load the calibration data using Load
  2. Convert the X-Units to d-spacing using ConvertUnits
  3. Run Rebin to set a common d-spacing bin structure across all of the spectra, you will need fine enough bins to allow fitting of your peak. Perhaps 0.001 as a rebin step, whatever you choose, make a note of it you may need it later.
  4. Take a look at the data using the SpectrumVeiwer or a color map plot, find the workspace index of a spectrum that has the peak close to the known reference position. This will be the reference spectra and will be used in the next step.
  5. Here the steps can split depending on whether you are calibrating on a single peak, or a range of peaks
    • Single Peak calibration (this requires the same peak in all detectors)
      1. Cross correlate the spectrum with CrossCorrelate, enter the workspace index as the ReferenceSpectra you found in the last step.
      2. Run GetDetectorOffsets, the InputWorkspace if the output from CrossCorrelate. Use the rebinning step you made a note of in step 3 as the step parameter, and DReference as the expected value of the reference peak that you are fitting to. XMax and XMin define the window around the reference peak to search for the peak in each spectra, if you find that some spectra do not find the peak try increasing those values.
      3. The output is an OffsetsWorspace, that can be used directly in DiffractionFocussing, or saved using SaveCalFile. You can also save it as a CalFile from GetDetectorOffsets, by defining the GroupingFileName parameter.
    • Multi Peak Calibration (This is less well tested) If you do not have a single peak in all detectors, but a range of known peaks across detectors you can try this approach. Another possible approach is to perform the single peak calibration across sections of the instrument with different reference peaks and combine the output calibration.
      1. Run GetDetOffsetsMultiPeaks, the Input workspace is the one from step 3 earlier. For DReference you can enter a comma seperated list of the d-spacing values of the known peaks.
      2. The output is an OffsetsWorspace, and a workspace with the number of peaks found in each spectra, The output offsets workspace that can be used directly in DiffractionFocussing, or saved using SaveCalFile. You can also save it as a CalFile from GetDetOffsetsMultiPeaks, by defining the GroupingFileName parameter.
../../_images/PG3_Calibrate.png

Testing your Calibration

../../_images/SNAP_Calibrate.png

You will need to test that the calibration managed to find a reasonable offset for each of the spectra in your data. The easiest way to do this is to apply the calibration to your calibration data and check that the bragg peaks align as expected.

  1. Load the calibration data using Load
  2. Run AlignDetectors, this will convert the data to d-spacing and apply the calibration. You can provide the calibration either by defining the OffsetsWrokspace, or by providing the path to the saved CalFile.
  3. Plot the workspace as a Color Fill plot, or a few spectra as a line plot.

Applying your calibration

During Focussing

The calibration can be applied as part of the reduction and processing workflow using the two algorithms

  1. Load the experimental data using Load
  2. Run AlignDetectors, this will convert the data to d-spacing and apply the calibration. You can provide the calibration either by defining the OffsetsWrokspace, or by providing the path to the saved CalFile.
  3. Run DiffractionFocussing with the output from AlignDetectors as the input. This will group the detectors according to the GroupingWorkspace or CalFile.

Adjusting the Instrument Definition

This approach attempts to correct the instrument component positions based on the calibration data. It can be more involved than applying the correction during focussing.

  1. Perform a calibration using CalibrateRectangularDetectors or GetDetOffsetsMultiPeaks. Only these algorithms can export the DiffractionCalibrationWorkspace <algm-DiffractionCalibrationWorkspace> required.
  2. Run AlignComponents this will move aspects of the instrument to optimize the offsets. It can move any named aspect of the instrument including the sample and source positions. You will likely need to run this several times, perhaps focussing on a single bank at a time, and then the source and sample positions in order to get a good alignment.
  3. Then either: * ExportGeometry will export the resulting geometry into a format that can be used to create a new XML instrument definition. The Mantid team at ORNL have tools to automate this for common instruments at the SNS. * At ISIS enter the resulting workspace as the calibration workspace into the DAE software when recording new runs. The calibrated workspace will be copied into the resulting NeXuS file of the run.

Category: Calibration