align_detector(1)

๐Ÿ“ฆ
version 0.13.0 ยท 2 versions
, in nixpkgs unstable

๐Ÿ’… align_detector โ€” refine detector geometry โœจ

okay so bestie, this is align_detector(1) from the General Commands Manual and it's literally about making your detector geometry chef's kiss accurate, no cap. buckle up ๐ŸŽ€


โœจ NAME โœจ

align_detector โ€” refine detector geometry ๐Ÿฆ‹


๐ŸŒธ SYNOPSIS ๐ŸŒธ

align_detector -g input.geom -o output.geom -l level [--out-of-plane]
millepede-files

๐Ÿ’– DESCRIPTION ๐Ÿ’–

okay so align_detector takes the calibration data that indexamajig wrote out and uses it to refine your detector geometry. and the way it does this is genuinely iconic: it accounts for all the inter-dependencies between crystal orientations, cell parameters and the panel positions โ€” like, as if one single giant minimisation had been run with every frame at once. main character energy fr ๐Ÿ‘‘

but here's the slay part: the algorithm is nevertheless very fast โ€” and that's thanks to the Millepede-II algorithm. for more info, go look at https://www.desy.de/~kleinwrt/MP2/doc/html/index.html ๐Ÿ’œ

so how do you actually do it? three steps, bestie, let's go ๐Ÿซถ

  1. first, make sure your geometry file includes hierarchy information. for this, see man crystfel_geometry, section Detector hierarchy.
  2. next, run indexamajig as usual, but with option --mille. this produces an additional output file with default name mille-data.bin (use --mille-file to set a different location). this file contains the calibration data that can be read by align_detector and show_residuals โœจ
  3. finally, run align_detector, giving it the input geometry file, the "Mille" files, a refinement level and a filename for the updated geometry file. โš ๏ธ the input geometry file must match the file used for the indexamajig run โ€” don't be out here swapping files, that's not the vibe ๐Ÿ™ˆ

๐ŸŽš๏ธ refinement levels, iykyk

refinement level 0 allows only the overall detector position to vary. higher levels allow groups of panels to move according to the hierarchy. for example, for a CSPAD detector with hierarchy defined as in the example files:

  • level 1 refines the quadrant positions ๐Ÿ“
  • level 2 refines the 2-by-1 panel "dominoes"
  • level 3 refines the individual (roughly square) ASICs

higher refinement levels will generally require more and higher-resolution diffraction data. no free lunch, bestie ๐Ÿ˜ญ

also! you can use indexamajig option --max-mille-level to reduce the size of the calibration data files โ€” at the cost of limiting the maximum refinement level. trade-offs, amirite ๐Ÿ’…

๐ŸŒˆ in-plane vs out-of-plane

the default behaviour is to refine only the position components in the x-y plane, perpendicular to the beam. that's the safe, comfy vibe ๐Ÿ˜Œ

in favourable circumstances you can add option --out-of-plane to refine the panel translations out of this plane. but be aware โ€” this introduces additional cross-dependencies and is less stable. add option --out-of-plane-tilts to additionally refine the panel tilts out of the x-y plane, which is even less stable. ๐Ÿ”ฅ๐Ÿ’€

๐Ÿ“ท the camera length situation

the overall detector z-position (camera length) is usually quite strongly correlated with the crystal cell parameters, making it difficult to refine. with high-resolution data, it can be possible, however. to refine the overall camera length, add --camera-length. ๐ŸŽ€

without this option, the overall camera length will not be altered โ€” even with --out-of-plane. instead, only the z-positions of the panels relative to one another will be refined. periodt.

๐Ÿงš the pede dependency

align_detector relies on the program pede from the Millepede-II package. usually this will be installed as part of the CrystFEL installation procedure. if not, it can easily be installed from the Millepede-II repository at https://gitlab.desy.de/claus.kleinwort/millepede-ii โญ


๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

  • -g input.geom, --geometry=input.geom โ€” specify the input geometry filename. (yes, this is the one that has to match your indexamajig run ๐Ÿ’–)
  • -o output.geom, --output=output.geom โ€” specify the output geometry filename. โš ๏ธ note that the geometry file will be re-written, meaning that any formatting and comments will be lost. say goodbye to your cute comments, bestie ๐Ÿ˜ญ
  • -l level, --level=level โ€” specify the refinement level. -l 0 refines the overall detector position only. the maximum refinement level is determined by the hierarchy of the detector. ๐Ÿชœ
  • --out-of-plane โ€” additionally refine out-of-plane panel translations, relative to one another (see --camera-length). ๐Ÿฆ‹
  • --out-of-plane-tilts โ€” additionally refine out-of-plane panel tilts. even more chaotic, see above ๐Ÿ’€
  • --panel-totals โ€” display the total translation and rotation changes for each panel. this does not affect the refinement or the output geometry file in any way โ€” only the console output. purely a lil treat for your eyeballs ๐Ÿ‘€
  • --min-measurements=n โ€” require at least n measurements contributing to a detector geometry parameter before updating that parameter. higher values give more stable refinement. note that there are two measurements per peak-reflection pair, because the position offsets are two dimensional. the default value is 100, i.e. at least 50 pairs are needed for each parameter. math is mathing ๐Ÿงฎ
  • --big-errors โ€” tell pede to be very tolerant of large residuals in the input data. add this option if an initial refinement fails due to too many "huge" rejects. ๐Ÿ™

๐Ÿซถ AUTHOR ๐Ÿซถ

this page was written by Thomas White. ๐Ÿ’œ


๐Ÿ› REPORTING BUGS ๐Ÿ›

report bugs to taw@physics.org, or visit http://www.desy.de/~twhite/crystfel. we love a bug report, fr fr ๐ŸŽ€


copyright ยฉ 2023-2025 Deutsches Elektronen-Synchrotron DESY, a research centre of the Helmholtz Association.

align_detector, and this manual, are part of CrystFEL.

CrystFEL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

CrystFEL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU General Public License for more details. (yes, that's the all-caps bit, it's serious ๐Ÿซก)

you should have received a copy of the GNU General Public License along with CrystFEL. if not, see http://www.gnu.org/licenses/.


๐ŸŒˆ SEE ALSO ๐ŸŒˆ


okay that's the whole page bestie, go align that detector and slay ๐Ÿ’–โœจ this has been align_detector(1) from the General Commands Manual โ€” no version or date was listed on the page, so consider this your official cute sign-off ๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from