Two per-object scan_result API tweaks (C++ internal names unchanged): - Rename the per-image scan_result field ice_ring_score -> ice (it is serialized once per image, so keep it short). Only the OpenAPI property and its regenerated C++/TS clients change; the DataMessage/EndMessage/CBOR/HDF5 field stays ice_ring_score, and the ice_ring_score plot_type enum is untouched. - Add a global rotation_bravais string (crystal-system letter + centering, e.g. "tP", "cF", "hR") to scan_result, alongside rotation_unit_cell / rotation_crystal_lattice. It comes from the RotationIndexer result (LatticeSearchResult system+centering) via the receiver, formatted by a new BravaisSymbol() helper in ScanResult.h. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
75 lines
2.5 KiB
C++
75 lines
2.5 KiB
C++
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <vector>
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
#include "CrystalLattice.h"
|
|
#include "UnitCell.h"
|
|
|
|
struct ScanResultElem {
|
|
int64_t number = -1;
|
|
float collection_efficiency = 0.0;
|
|
|
|
std::optional<int64_t> x;
|
|
std::optional<int64_t> y;
|
|
std::optional<float> angle_deg;
|
|
|
|
std::optional<int64_t> pixel_sum;
|
|
std::optional<int64_t> indexed_lattice_count;
|
|
std::optional<int64_t> min_viable_pixel;
|
|
std::optional<int64_t> max_viable_pixel;
|
|
std::optional<int64_t> err_pixels;
|
|
std::optional<int64_t> sat_pixels;
|
|
std::optional<float> bkg;
|
|
std::optional<int64_t> spot_count;
|
|
std::optional<int64_t> spot_count_low_res;
|
|
std::optional<int64_t> spot_count_indexed;
|
|
std::optional<int64_t> spot_count_ice;
|
|
std::optional<int64_t> indexing_solution;
|
|
std::optional<float> profile_radius;
|
|
std::optional<float> b_factor;
|
|
std::optional<float> res;
|
|
std::optional<UnitCell> uc;
|
|
std::optional<uint64_t> xfel_pulse_id;
|
|
std::optional<float> mosaicity;
|
|
std::optional<int64_t> niggli_class;
|
|
std::optional<int64_t> integrated_reflections;
|
|
std::optional<float> image_scale_factor;
|
|
std::optional<float> image_scale_cc;
|
|
std::optional<float> ice_ring_score;
|
|
};
|
|
|
|
struct ScanResult {
|
|
std::string file_prefix;
|
|
std::vector<ScanResultElem> images;
|
|
|
|
std::optional<CrystalLattice> rotation_lattice;
|
|
// Bravais lattice type of the global rotation-indexing solution (from RotationIndexer).
|
|
std::optional<gemmi::CrystalSystem> rotation_crystal_system;
|
|
std::optional<char> rotation_centering;
|
|
};
|
|
|
|
// Two-letter Bravais lattice symbol: crystal-system letter + centering, e.g. "tP", "oC", "cF", "hR".
|
|
inline std::string BravaisSymbol(gemmi::CrystalSystem system, char centering) {
|
|
char family;
|
|
switch (system) {
|
|
case gemmi::CrystalSystem::Triclinic: family = 'a'; break;
|
|
case gemmi::CrystalSystem::Monoclinic: family = 'm'; break;
|
|
case gemmi::CrystalSystem::Orthorhombic: family = 'o'; break;
|
|
case gemmi::CrystalSystem::Tetragonal: family = 't'; break;
|
|
case gemmi::CrystalSystem::Trigonal: family = 'h'; break;
|
|
case gemmi::CrystalSystem::Hexagonal: family = 'h'; break;
|
|
case gemmi::CrystalSystem::Cubic: family = 'c'; break;
|
|
default: family = 'a'; break;
|
|
}
|
|
return std::string{family} + centering;
|
|
}
|
|
|
|
|