Build Packages / Create release (push) Successful in 26s
Build Packages / Build documentation (push) Successful in 1m43s
Build Packages / build:portable:macos-arm64:nocuda (push) Successful in 5m7s
Build Packages / build:portable:linux-x86_64:nocuda (push) Successful in 11m48s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 7m22s
Build Packages / build:portable:linux-x86_64:cuda (push) Successful in 12m24s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 25m30s
Build Packages / build:portable:windows-x86_64:nocuda (push) Successful in 25m29s
Build Packages / build:portable:windows-x86_64:cuda (push) Successful in 29m41s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 21m44s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 24m41s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 26m9s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 26m3s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 28m28s
Build Packages / Generate python client (push) Successful in 27s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 31m16s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 20m44s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 26m27s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 22m52s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 27m44s
Build Packages / Unit tests (push) Successful in 1h46m55s
Build Packages / Validation Battery (push) Successful in 52m50s
* Rugnux: Several rotation sweeps of one crystal are merged as one dataset (`rugnux a_master.h5 b_master.h5`), on a common indexing and cell, with a non-isomorphous sweep left out and reported; `--sweeps separate` processes each sweep on its own. Bruker `.sfrm` frames and imgCIF files with a full goniometer axis chain are read. * Rugnux: More robust rotation processing - a retry with a more sensitive spot finder when no lattice is found, a self-consistent detector distance, long axes and doubled cells tested as hypotheses, a `-C` supercell multiple stepped down, and each ice ring merged, down-weighted or rejected on its own. * Rugnux: Serial stills are merged with a partiality-aware error model, reported as `ERROR_MODEL_A/B/C` with no ISa or R_merge/R_meas/R_pim; runs without `-S` have an overall intensity scale about 0.86-0.88 times that of earlier versions, with unchanged statistics. A second crystal form is left out of the merge and reported, the indexing ambiguity is resolved more reliably, and `--model` no longer influences processing. * Rugnux: The reported CC1/2 is the standard unweighted one, which can be lower than before on sweeps with weak frames; ISa comes with a 95% interval (`ISA_LOW`/`ISA_HIGH`). * Rugnux: Model refinement adds anisotropic/TLS, local NCS and twin refinement where R-free supports them; building waters and relabelling ions is now off by default (`--refine-solvent` turns it on). * NXmx: A detector of several modules is written as `module_0` ... `module_N` only, so DIALS reads each module as its own panel. * Other: JPEG previews use a bundled encoder (libjpeg-turbo no longer needed), Rugnux prints how to cite it, and the release archives contain the HTML documentation. Reviewed-on: #92 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
122 lines
5.5 KiB
C++
122 lines
5.5 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include <array>
|
|
#include <optional>
|
|
#include <vector>
|
|
#include <map>
|
|
#include <memory>
|
|
|
|
#include "../common/DiffractionGeometry.h"
|
|
#include "../common/DiffractionExperiment.h"
|
|
#include "../common/StillsRunWidth.h"
|
|
#include "../common/PixelMask.h"
|
|
#include "../common/AzimuthalIntegrationMapping.h"
|
|
|
|
struct JFJochReaderDataset {
|
|
std::string arm_date;
|
|
|
|
DiffractionExperiment experiment;
|
|
// Shared, not copied, across dataset snapshots: the mask is constant for a run, so a per-frame
|
|
// dataset refresh / mutable copy must not clone the full-detector (~tens of MB) mask. Held as
|
|
// shared_ptr<const>; the rare edit (user mask) builds a fresh mask (copy-on-write). Never null.
|
|
std::shared_ptr<const PixelMask> pixel_mask = std::make_shared<const PixelMask>();
|
|
|
|
std::optional<int64_t> error_value;
|
|
|
|
// The master file's detect_ice_rings key, kept as written rather than collapsed to a bool, so a
|
|
// consumer can tell "the file asked for this" from "the file said nothing". Offline processing
|
|
// defaults ice handling by geometry when the file is silent (see rugnux_cli).
|
|
std::optional<bool> file_detect_ice_rings;
|
|
|
|
std::string jfjoch_release;
|
|
|
|
// Change of basis (3x3 integers, row major) from the setting the per-image reflections and
|
|
// lattices in this file were written in to the setting of experiment's unit cell and space group:
|
|
// hkl_cell = M . hkl_written. The per-image data are written as each image is processed, but the
|
|
// space group - and the conventional setting that comes with it - is only settled after the merge,
|
|
// so the two are not always the same setting. Empty means they are. Read straight from
|
|
// /entry/MX/reindexMatrix; the reader applies it, so everything this class hands out is already in
|
|
// the cell's setting.
|
|
std::optional<std::array<int32_t, 9>> reindex_matrix;
|
|
// The e.s.d.s of the experiment's unit cell, a b c alpha beta gamma (/entry/sample/unit_cell_esd); empty
|
|
// where the file has none.
|
|
std::optional<UnitCell> unit_cell_esd;
|
|
// Stills: the rocking curve the run's frames were predicted through (/entry/MX/stillsRockingWidth*).
|
|
std::optional<StillsRunWidth> stills_run_width;
|
|
// Stills: the cell the run was given, whose population of frames it merged (/entry/MX/stillsGivenUnitCell).
|
|
std::optional<UnitCell> stills_given_cell;
|
|
|
|
std::vector<float> az_int_bin_to_q;
|
|
std::vector<float> az_int_bin_to_phi;
|
|
size_t azimuthal_bins = 0;
|
|
size_t q_bins = 0;
|
|
|
|
std::vector<float> spot_count;
|
|
std::vector<float> spot_count_indexed;
|
|
std::vector<float> spot_count_low_res;
|
|
std::vector<float> spot_count_ice_rings;
|
|
std::vector<float> spot_count_ice_control;
|
|
|
|
std::vector<float> indexing_result;
|
|
std::vector<float> indexing_lattice_count;
|
|
std::vector<float> bkg_estimate;
|
|
// NaN entries are frames with no value (CANNOT SAY), not zeros.
|
|
std::vector<float> spindle_blind_fraction;
|
|
std::vector<float> ice_ring_score;
|
|
std::vector<float> resolution_estimate;
|
|
std::vector<float> efficiency;
|
|
std::vector<float> profile_radius;
|
|
std::vector<float> mosaicity_deg;
|
|
std::vector<float> b_factor;
|
|
std::vector<float> integrated_reflections;
|
|
std::vector<float> image_scale_factor;
|
|
std::vector<float> image_scale_cc;
|
|
std::vector<int64_t> max_value;
|
|
|
|
// Per-image sweep-quality code from /entry/MX/sweepQuality: 0 = the image is in no flagged range,
|
|
// otherwise a 1-based index into sweep_quality_reasons (the vocabulary stored beside it, so the
|
|
// codes read back without this source). Both empty when the file carries no sweep quality, which
|
|
// means the run never looked - not that every image was clean.
|
|
std::vector<uint8_t> sweep_quality;
|
|
std::vector<std::string> sweep_quality_reasons;
|
|
|
|
// Per-image disposition from /entry/MX/frameDisposition: a 0-based index into
|
|
// frame_disposition_codes (merged, downgraded, rejected). What was DONE with the image, where
|
|
// sweep_quality above says what was SEEN.
|
|
std::vector<uint8_t> frame_disposition;
|
|
std::vector<std::string> frame_disposition_codes;
|
|
|
|
// Maps this dataset's image index -> the original/collected image number it came from.
|
|
// Empty means identity (image i == original image i). Lets a dataset be a subset (or strided
|
|
// selection) of the truly collected images: reprocessing snapshots over a sub-range, and (in
|
|
// future) a main dataset that was filtered on-the-fly during collection.
|
|
std::vector<int> source_image_number;
|
|
|
|
std::vector<std::string> roi;
|
|
std::vector<std::vector<int64_t>> roi_sum;
|
|
std::vector<std::vector<int64_t>> roi_sum_sq;
|
|
std::vector<std::vector<int64_t>> roi_max;
|
|
std::vector<std::vector<int64_t>> roi_npixel;
|
|
std::vector<std::vector<float>> roi_x;
|
|
std::vector<std::vector<float>> roi_y;
|
|
|
|
// ROI definitions stored in the master file. The logical definitions populate
|
|
// experiment.ROI() (they re-derive with the current geometry); roi_map is the
|
|
// per-pixel bitmask as written (constant footprint), with roi_bit_index mapping
|
|
// each ROI name to its bit.
|
|
std::vector<uint16_t> roi_map;
|
|
std::map<std::string, uint16_t> roi_bit_index;
|
|
|
|
std::vector<std::string> calibration_data;
|
|
|
|
JFJochReaderDataset() = default;
|
|
JFJochReaderDataset(const JFJochReaderDataset &other) = default;
|
|
};
|
|
|
|
|
|
|