Tool for calibrating a SAXS beamline using diffraction grating. Currently under construction.
| What | Where |
|---|---|
| Source | https://github.com/DiamondLightSource/i22-diffraction-grating-calibration |
| Docker | docker run ghcr.io/diamondlightsource/i22-diffraction-grating-calibration:latest |
| Releases | https://github.com/DiamondLightSource/i22-diffraction-grating-calibration/releases |
On the DLS module system, you can install this tool as:
module load uv
uv venv
uv pip install git+https://github.com/DiamondLightSource/i22-diffraction-grating-calibration.git
source .venv/bin/activate
$ i22-diffraction-grating-calibration --file /path/to/input.nxs --output /path/to/output/folder --save-plots
The calibration NeXuS file (SAXS_calibration.nxs) will be stored in the output_folder, along with plots made to show how the calibration has been performed.
The final figure generated, detector_calibration.png, shows how peaks have been found, fit, and indexed in the azimuthally integrated scattering pattern to calculate the detector distance from the sample. The initial peak identification is performed using scipy.signal.find_peaks, using a peak prominance of 0.1. This has performed well in testing, but may not be universally optimal. Should this need fine tuning, the following command could be used instead:
$ i22-diffraction-grating-calibration --file /path/to/input.nxs --output /path/to/output/folder --save-plots --peak-prominance X
where X is some float value . Set this lower (than 0.1 to find more peaks, higher to find fewer.
This calibration program works by:
- Identifying the beamstop & fitting and approximate center
- Shown in the
beamstop_fit.pngfigure
- Shown in the
- Optimising the beam centre through x/y detector profile matching
- See
beam_profiles_xy.pngandbeam_center_location.pngto see how well the profiles have been matched, and where the beam center has been located
- See
- Calibrate the detector distance based on grating fringe spacing
- The peaks found, and how they have been indexed, is shown in
detector_calibration.png.
- The peaks found, and how they have been indexed, is shown in
- Assumes a Pilatus 2M detector, pixel size 172e-6 m.
- Units are all SI, not more native/sensible SAXS based units (e.g. beam center position should really be in mm not m, wavelength in angstrom not m, etc.)