Files
Jungfraujoch/image_analysis/scale_merge/SublatticeRelabel.h
T
leonarski_f afbe844b20
Build Packages / Create release (push) Successful in 17s
Build Packages / build:portable:macos-arm64:nocuda (push) Successful in 4m41s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 20m49s
Build Packages / build:portable:windows-x86_64:nocuda (push) Successful in 13m6s
Build Packages / build:portable:windows-x86_64:cuda (push) Successful in 23m44s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 7m28s
Build Packages / build:portable:linux-x86_64:nocuda (push) Successful in 11m50s
Build Packages / build:portable:linux-x86_64:cuda (push) Successful in 14m9s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 16m25s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 15m42s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 20m50s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 20m36s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 22m18s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 23m29s
Build Packages / Generate python client (push) Successful in 30s
Build Packages / Build documentation (push) Successful in 1m10s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 21m38s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 17m8s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 23m10s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 19m16s
Build Packages / Unit tests (push) Successful in 2h8m4s
Build Packages / Validation Battery (push) Successful in 40m53s
v1.0.0-rc.178 (#88)
* Rugnux: Processes serial crystallography data from XFELs - SACLA (MPCCD), PAL-XFEL and European XFEL (CXI), LCLS (XTC) and SwissFEL Alvra (JUNGFRAU with a CrystFEL module geometry) - with several files or Jungfraujoch master files merged in one run (`rugnux *_master.h5`).
* Rugnux: Stills processing takes a known unit cell and space group as a starting point, finds the beam centre (and, with a cell, the detector distance) from the images, detects the saturation level in other facilities' files and refines the placement of individual detector panels.
* Rugnux: The stills report gives R_split and CC1/2 from frame half-sets, comparable with CrystFEL.
* jfjoch_viewer: Opens the same XFEL file formats.
* Validation: A stills battery checks Rugnux against deposited structures from SACLA, PAL-XFEL, LCLS, European XFEL and SwissFEL.
* Rugnux: More reliable convergence of rotation scaling, and live molecular replacement starts as soon as the model is uploaded.
* jfjoch_broker: Initialize clears the previous dataset's bearer tokens, image buffer and live Rugnux status, and a slow CUDA JIT cache is reported at start.

Reviewed-on: #88
Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
2026-10-21 11:20:01 +02:00

48 lines
2.7 KiB
C++

// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <array>
#include <optional>
#include <vector>
#include "../../common/CrystalLattice.h"
#include "../../common/IndexingSettings.h"
#include "../../common/UnitCell.h"
#include "../IntegrationOutcome.h"
// A still indexed on few spots is often given a lattice that explains them just as well as the true
// one: an axis multiple (a supercell, whose reciprocal lattice holds every true node plus nodes in
// between) or the true lattice in another setting. Such a frame's cell is not close to the run's cell,
// so the merge leaves it out, although its reflections at the true nodes are as good as any.
//
// FindSublatticeBases looks for the run's reciprocal lattice inside the frame's: integer combinations
// of the frame's reciprocal axes whose metric (all three lengths and three angles) is the reference
// cell's, within the merge's own cell tolerances. Each is returned as the integer matrix M with
// (a*, b*, c*)_reference = M (a*, b*, c*)_frame, right-handed.
std::vector<std::array<std::array<int, 3>, 3>> FindSublatticeBases(const CrystalLattice &frame,
const UnitCell &reference,
const IndexingSettings &settings);
// A frame's cell described on the reference's axes, when its lattice contains the reference (the
// reference in another setting, or an axis multiple of it): the cell the frame has once it is put on the
// reference. Empty where the lattice does not contain it.
std::optional<UnitCell> CellOnReference(const UnitCell &cell, const UnitCell &reference,
const IndexingSettings &settings);
struct SublatticeRelabelResult {
size_t frames = 0; // frames put on the reference cell
size_t reflections_kept = 0; // reflections of those frames at nodes of the reference lattice
size_t reflections_dropped = 0;
};
// For every frame whose cell is not close to the reference but whose lattice contains it: re-derive its
// reflection indices on the reference axes - of several ways to place the reference in its lattice, the
// one with the strongest mean I/sigma at its nodes - drop the reflections that are not reference nodes
// or are finer than any frame on the reference cell reaches, and give the frame the reference basis in
// its own orientation.
SublatticeRelabelResult RelabelOnSublattice(std::vector<IntegrationOutcome> &outcomes,
const UnitCell &reference,
const IndexingSettings &settings);