Build Packages / Unit tests (push) Successful in 1h22m15s
Build Packages / build:windows:nocuda (push) Successful in 18m0s
Build Packages / build:windows:cuda (push) Successful in 20m30s
Build Packages / build:viewer-tgz:cpu (push) Successful in 10m32s
Build Packages / build:viewer-tgz:cuda (push) Successful in 11m39s
Build Packages / build:rugnux-tgz (x86_64) (push) Successful in 8m55s
Build Packages / build:rugnux:windows (push) Successful in 11m25s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 20m6s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 16m27s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 20m19s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 15m34s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 20m25s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 19m36s
Build Packages / build:rpm (rocky8) (push) Successful in 17m43s
Build Packages / build:rpm (rocky9) (push) Successful in 13m34s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 21m28s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 18m19s
Build Packages / DIALS test (push) Successful in 12m36s
Build Packages / XDS test (durin plugin) (push) Successful in 6m56s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 6m48s
Build Packages / XDS test (neggia plugin) (push) Successful in 6m7s
Build Packages / Generate python client (push) Successful in 11s
Build Packages / Build documentation (push) Successful in 36s
Build Packages / Create release (push) Skipped
Build Packages / build:rugnux:aarch64 (cross) (push) Successful in 5m11s
* `rugnux --mode calibration` writes `<prefix>.json` beside the `.poni`, whose `dataset_settings` member is a `jfjoch_broker` `dataset_settings` body as it stands. * `rugnux` and `jfjoch_viewer` read PILATUS miniCBF sweeps natively, without conversion. * Masters written by other facilities open, including Eiger 1.x and third-party NXmx variants. * `rugnux` measures the beam centre on every run, and indexes with it when the file's value indexes nothing. * A detector swung out on a 2theta arm is placed where the file says it stands, and the calibration can hold the tilt fixed. * `rugnux` writes the unmerged MTZ by default, and a P1 merge beside it, so a wrong space group can be re-merged without reprocessing. * Significant improvements to symmetry handling in `rugnux`: the lattice, the point group, the setting and the systematic absences. * The `rugnux` report gives the resolution the CC1/2 fit reached, beside the range the reflections were written to. * The `rugnux` report gives the twinning statistics measured before the space group was decided, beside the ones measured after. * The `rugnux` report gives the strong-direction diffraction limit, and warns when CC1/2 is not monotone with resolution. * `rugnux` ranks screw axes on the evidence their absences carry, rather than on how many control reflections a candidate happens to have. * Twinning is no longer reported when the L-test contradicts it. * The `rugnux` report gives the detector tilt, the measured tilt and the direct beam beside the beam centre, and a post-refined beam centre is judged against the run's own measurement rather than the file's. * `--no-refine-tilt` holds the detector tilt at the value in the file, instead of zeroing it, when the calibration starts from the spots. * The `jfjoch_viewer` grid scan view draws the cells in the proportion of the scan steps, so the map has the shape of the scanned area. Reviewed-on: #76 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
186 lines
7.5 KiB
C++
186 lines
7.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 <string>
|
|
#include <optional>
|
|
|
|
#include "UnitCell.h"
|
|
#include "Coord.h"
|
|
#include "../compression/CompressionAlgorithmEnum.h"
|
|
#include "JFJochMessages.h"
|
|
#include "XrayFluorescenceSpectrum.h"
|
|
|
|
#include "gemmi/symmetry.hpp"
|
|
|
|
class DatasetSettings {
|
|
int64_t images_per_trigger;
|
|
int64_t ntrigger;
|
|
|
|
float beam_x_pxl;
|
|
float beam_y_pxl;
|
|
float detector_distance_mm;
|
|
float photon_energy_keV;
|
|
|
|
std::string file_prefix;
|
|
std::optional<int64_t> images_per_file;
|
|
|
|
CompressionAlgorithm compression;
|
|
|
|
std::string sample_name;
|
|
std::optional<UnitCell> unit_cell;
|
|
// The whole group, not its number: a number can only name the reference setting, so
|
|
// "P 1 1 2" and "R 3:R" are lost the moment a number is all that is kept.
|
|
std::optional<gemmi::SpaceGroup> space_group;
|
|
|
|
std::optional<float> total_flux;
|
|
std::optional<float> attenuator_transmission;
|
|
// Size of the beam where it meets the sample, x then y (NXmx incident_beam_size)
|
|
std::optional<float> beam_size_x_um;
|
|
std::optional<float> beam_size_y_um;
|
|
std::optional<float> ring_current_mA;
|
|
std::optional<GoniometerAxis> goniometer;
|
|
std::optional<GridScanSettings> grid_scan;
|
|
std::optional<float> sample_temperature_K;
|
|
|
|
nlohmann::json image_appendix;
|
|
nlohmann::json header_appendix;
|
|
|
|
float data_reduction_factor_serialmx;
|
|
|
|
std::optional<std::chrono::nanoseconds> image_time;
|
|
std::optional<uint64_t> run_number;
|
|
std::optional<std::string> run_name;
|
|
std::string group;
|
|
std::optional<int64_t> compression_poisson_factor;
|
|
std::optional<int64_t> pixel_value_low_threshold;
|
|
std::optional<int64_t> pixel_value_high_threshold;
|
|
std::optional<bool> save_calibration;
|
|
|
|
bool write_nxmx_hdf5_master;
|
|
|
|
std::optional<float> polarization_factor;
|
|
std::optional<float> bandwidth_fwhm; // relative X-ray bandwidth, FWHM of dlambda/lambda (e.g. 0.01 for 1%)
|
|
float poni_rot_1_rad;
|
|
float poni_rot_2_rad;
|
|
float poni_rot_3_rad;
|
|
|
|
bool spot_finding_enable;
|
|
int64_t max_spot_count;
|
|
|
|
bool detect_ice_rings; // Enable special handling of ice rings
|
|
XrayFluorescenceSpectrum fluorescence_spectrum;
|
|
|
|
std::optional<SmargonPosition> smargon_position;
|
|
public:
|
|
|
|
DatasetSettings();
|
|
|
|
DatasetSettings& ImagesPerTrigger(int64_t input);
|
|
DatasetSettings& NumTriggers(int64_t triggers);
|
|
DatasetSettings& PhotonEnergy_keV(float input);
|
|
DatasetSettings& BeamX_pxl(float input);
|
|
DatasetSettings& BeamY_pxl(float input);
|
|
DatasetSettings& DetectorDistance_mm(float input);
|
|
DatasetSettings& FilePrefix(std::string input);
|
|
DatasetSettings& FilePrefixTrusted(std::string input); // offline/local: no CheckPath guard (absolute allowed)
|
|
DatasetSettings& Compression(CompressionAlgorithm input);
|
|
DatasetSettings& SetUnitCell(const std::optional<UnitCell> &cell);
|
|
DatasetSettings& SpaceGroupNumber(std::optional<int64_t> input);
|
|
DatasetSettings& SetSpaceGroup(const std::optional<gemmi::SpaceGroup> &input);
|
|
DatasetSettings& SampleName(std::string input);
|
|
DatasetSettings& AttenuatorTransmission(const std::optional<float> &input);
|
|
DatasetSettings& TotalFlux(const std::optional<float> &input);
|
|
DatasetSettings& BeamSizeX_um(const std::optional<float> &input);
|
|
DatasetSettings& BeamSizeY_um(const std::optional<float> &input);
|
|
DatasetSettings& Goniometer(const std::optional<GoniometerAxis>& input);
|
|
DatasetSettings& GridScan(const std::optional<GridScanSettings>& input);
|
|
DatasetSettings& HeaderAppendix(const nlohmann::json& input);
|
|
DatasetSettings& ImageAppendix(const nlohmann::json& input);
|
|
DatasetSettings& ImagesPerFile(const std::optional<int64_t> &input);
|
|
DatasetSettings& RunNumber(const std::optional<uint64_t> &run_number);
|
|
DatasetSettings& RunName(const std::optional<std::string> &input);
|
|
DatasetSettings& ExperimentGroup(const std::string &group);
|
|
DatasetSettings& ImageTime(const std::optional<std::chrono::nanoseconds> &input);
|
|
|
|
DatasetSettings& LossyCompressionSerialMX(float input);
|
|
DatasetSettings& LossyCompressionPoisson(std::optional<int64_t> input);
|
|
DatasetSettings& WriteNXmxHDF5Master(bool input);
|
|
DatasetSettings& SaveCalibration(std::optional<bool> input);
|
|
DatasetSettings& PixelValueLowThreshold(const std::optional<int64_t> &input);
|
|
DatasetSettings& PixelValueHighThreshold(const std::optional<int64_t> &input);
|
|
DatasetSettings& PolarizationFactor(const std::optional<float> &input);
|
|
DatasetSettings& BandwidthFWHM(const std::optional<float> &input);
|
|
DatasetSettings& PoniRot1_rad(float input);
|
|
DatasetSettings& PoniRot2_rad(float input);
|
|
DatasetSettings& PoniRot3_rad(float input);
|
|
DatasetSettings& RingCurrent_mA(const std::optional<float> &input);
|
|
DatasetSettings& SampleTemperature_K(const std::optional<float> &input);
|
|
DatasetSettings& SpotFindingEnable(bool input);
|
|
DatasetSettings& MaxSpotCount(int64_t input);
|
|
DatasetSettings& DetectIceRings(bool input);
|
|
DatasetSettings& FluorescenceSpectrum(const XrayFluorescenceSpectrum& input);
|
|
DatasetSettings& Smargon(const std::optional<SmargonPosition>& input);
|
|
|
|
std::optional<float> GetAttenuatorTransmission() const;
|
|
std::optional<float> GetTotalFlux() const;
|
|
std::optional<float> GetBeamSizeX_um() const;
|
|
std::optional<float> GetBeamSizeY_um() const;
|
|
|
|
std::optional<GoniometerAxis> &Goniometer();
|
|
std::optional<GridScanSettings> &GridScan();
|
|
const std::optional<GoniometerAxis> &GetGoniometer() const;
|
|
const std::optional<GridScanSettings> &GetGridScan() const;
|
|
|
|
const nlohmann::json& GetHeaderAppendix() const;
|
|
const nlohmann::json& GetImageAppendix() const;
|
|
std::optional<UnitCell> GetUnitCell() const;
|
|
std::optional<int64_t> GetSpaceGroupNumber() const;
|
|
const std::optional<gemmi::SpaceGroup> &GetSpaceGroup() const;
|
|
std::string GetSampleName() const;
|
|
float GetPhotonEnergy_keV() const;
|
|
float GetBeamX_pxl() const;
|
|
float GetBeamY_pxl() const;
|
|
float GetDetectorDistance_mm() const;
|
|
|
|
Coord GetScatteringVector() const;
|
|
|
|
std::string GetFilePrefix() const;
|
|
|
|
CompressionAlgorithm GetCompressionAlgorithm() const;
|
|
int64_t GetNumTriggers() const;
|
|
int64_t GetImageNumPerTrigger() const;
|
|
std::optional<int64_t> GetImagesPerFile() const;
|
|
|
|
std::optional<uint64_t> GetRunNumber() const;
|
|
std::optional<std::string> GetRunName() const;
|
|
std::string GetExperimentGroup() const;
|
|
std::optional<std::chrono::nanoseconds> GetImageTime() const;
|
|
|
|
float GetLossyCompressionSerialMX() const;
|
|
std::optional<int64_t> GetLossyCompressionPoisson() const;
|
|
|
|
std::optional<int64_t> GetPixelValueLowThreshold() const;
|
|
std::optional<int64_t> GetPixelValueHighThreshold() const;
|
|
bool IsWriteNXmxHDF5Master() const;
|
|
std::optional<bool> IsSaveCalibration() const;
|
|
|
|
std::optional<float> GetPolarizationFactor() const;
|
|
std::optional<float> GetBandwidthFWHM() const;
|
|
float GetPoniRot1_rad() const;
|
|
float GetPoniRot2_rad() const;
|
|
float GetPoniRot3_rad() const;
|
|
|
|
std::optional<float> GetRingCurrent_mA() const;
|
|
std::optional<float> GetSampleTemperature_K() const;
|
|
|
|
bool IsSpotFindingEnabled() const;
|
|
int64_t GetMaxSpotCount() const;
|
|
|
|
bool IsDetectIceRings() const;
|
|
const XrayFluorescenceSpectrum &GetFluorescenceSpectrum() const;
|
|
std::optional<SmargonPosition> GetSmargonPosition() const;
|
|
};
|