// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #pragma once #include #include #include "DetectorLayout.h" #include "../common/DetectorModules.h" // A CrystFEL detector geometry file (.geom), read for the module geometry only: the panels with their // pixel ranges in the stored frame, fast/slow-scan directions, corners, pixel size and depth offset // (coffset), where the frames are (data, dimN), and - optionally - the camera length. Everything else a // geometry file may hold (photon energy, gain, saturation, masks, bad regions, value flags) is the data // file's or the command line's to state, or rugnux's to measure: such keywords are listed in `ignored` // for the log. Both the current syntax and the older one (global keys that take effect for the panels // after them) are read. A keyword that would move pixels in a way not supported (a tilted panel, a // frame laid out by a module dimension, panels in different datasets, a detector shift) is refused. namespace crystfel { // The layout the file describes; keywords read past are added to ignored, for the log. xfel::Layout Read(const std::string &filename, std::vector &ignored); // The panels of a geometry file as the modules of an image they are laid on: each panel's pixel range is // the image's columns (fs) and rows (ss) it covers, and its corner places it relative to the beam, which // the image has at (beam_x, beam_y). Fewer than two panels: none. DetectorModules ModulesOnImage(const xfel::Layout &geom, double beam_x, double beam_y); } // namespace crystfel