// 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): 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), optionally the camera length - and which pixels to leave out: the mask arrays (mask, mask_file, // mask_good, mask_bad, or maskN_data, maskN_file, maskN_goodbits, maskN_badbits for up to eight, per // panel where a panel states its own), the bad regions (bad*, in the laboratory plane or as a pixel // range on a panel), mask_edge_pixels and no_index. Photon energy, gain, saturation and value flags are // 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