diff --git a/broker/OpenAPIConvert.cpp b/broker/OpenAPIConvert.cpp index a9f7800c8..6527d4b84 100644 --- a/broker/OpenAPIConvert.cpp +++ b/broker/OpenAPIConvert.cpp @@ -730,7 +730,8 @@ DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings ret.SpotFindingEnable(input.isSpotFinding()); ret.MaxSpotCount(input.getMaxSpotCount()); - ret.DetectIceRings(input.isDetectIceRings()); + if (input.detectIceRingsIsSet()) + ret.DetectIceRings(input.isDetectIceRings()); if (input.xrayFluorescenceSpectrumIsSet()) { auto fl = input.getXrayFluorescenceSpectrum(); diff --git a/broker/gen/model/Dataset_settings.h b/broker/gen/model/Dataset_settings.h index 601df8418..6a91d8d51 100644 --- a/broker/gen/model/Dataset_settings.h +++ b/broker/gen/model/Dataset_settings.h @@ -325,7 +325,7 @@ public: bool maxSpotCountIsSet() const; void unsetMax_spot_count(); /// - /// Flag spots as ice rings and reduce their effect on indexing + /// Flag spots as ice rings and reduce their effect on indexing. Left out, the broker's own spot finding treats no spot as an ice ring, rugnux live decides as a bare `rugnux` would (on for a rotation sweep, off for stills), and the master file carries no `detect_ice_rings`. /// bool isDetectIceRings() const; void setDetectIceRings(bool const value); diff --git a/broker/jfjoch_api.yaml b/broker/jfjoch_api.yaml index 5201be5e1..788c23fd3 100644 --- a/broker/jfjoch_api.yaml +++ b/broker/jfjoch_api.yaml @@ -671,7 +671,10 @@ components: description: Maximum number of spots that are saved/used for indexing; spots with highest intensity are selected detect_ice_rings: type: boolean - description: Flag spots as ice rings and reduce their effect on indexing + description: | + Flag spots as ice rings and reduce their effect on indexing. Left out, the broker's own + spot finding treats no spot as an ice ring, rugnux live decides as a bare `rugnux` would (on + for a rotation sweep, off for stills), and the master file carries no `detect_ice_rings`. async_start: type: boolean default: false diff --git a/common/DatasetSettings.cpp b/common/DatasetSettings.cpp index aa82553a6..601b5114b 100644 --- a/common/DatasetSettings.cpp +++ b/common/DatasetSettings.cpp @@ -30,8 +30,6 @@ DatasetSettings::DatasetSettings() { poni_rot_3_rad = 0.0f; max_spot_count = std::min(MAX_SPOT_COUNT, 250); - - detect_ice_rings = false; } DatasetSettings &DatasetSettings::ImagesPerTrigger(int64_t input) { @@ -542,6 +540,10 @@ DatasetSettings & DatasetSettings::DetectIceRings(bool input) { } bool DatasetSettings::IsDetectIceRings() const { + return detect_ice_rings.value_or(false); +} + +std::optional DatasetSettings::GetDetectIceRings() const { return detect_ice_rings; } diff --git a/common/DatasetSettings.h b/common/DatasetSettings.h index 1d3cd785a..208c521ca 100644 --- a/common/DatasetSettings.h +++ b/common/DatasetSettings.h @@ -75,7 +75,9 @@ class DatasetSettings { bool spot_finding_enable; int64_t max_spot_count; - bool detect_ice_rings; // Enable special handling of ice rings + // Special handling of ice rings; unset where the user did not ask either way, so that the analysis takes its own + // default (rugnux: on for a rotation sweep, off for stills) and the master file carries no detect_ice_rings + std::optional detect_ice_rings; XrayFluorescenceSpectrum fluorescence_spectrum; std::optional smargon_position; @@ -186,7 +188,8 @@ public: bool IsSpotFindingEnabled() const; int64_t GetMaxSpotCount() const; - bool IsDetectIceRings() const; + bool IsDetectIceRings() const; // false where unset + std::optional GetDetectIceRings() const; const XrayFluorescenceSpectrum &GetFluorescenceSpectrum() const; std::optional GetSmargonPosition() const; }; diff --git a/common/DiffractionExperiment.cpp b/common/DiffractionExperiment.cpp index e97974bdc..d31d4926e 100644 --- a/common/DiffractionExperiment.cpp +++ b/common/DiffractionExperiment.cpp @@ -773,7 +773,7 @@ void DiffractionExperiment::FillMessage(StartMessage &message) const { message.poni_rot2 = dataset.GetPoniRot2_rad(); message.poni_rot3 = dataset.GetPoniRot3_rad(); - message.detect_ice_rings = dataset.IsDetectIceRings(); + message.detect_ice_rings = dataset.GetDetectIceRings(); message.channels = {"default"}; diff --git a/docs/CBOR.md b/docs/CBOR.md index 9b9d3167b..ccee96418 100644 --- a/docs/CBOR.md +++ b/docs/CBOR.md @@ -120,7 +120,7 @@ There are minor differences at the moment: | - xfel_pulse_id | uint64 | Pulse IDs are recorded for images | | | - ring_current_mA | float | Ring current at the start of the measurement | | | - sample_temperature_K | float | Sample temperature \[K\] | | -| - detect_ice_rings | bool | Ice ring detection feature is enabled | | +| - detect_ice_rings | bool | Ice ring detection feature is enabled; absent where the dataset settings left it unset (rugnux then decides) | | | - indexing_algorithm | string | Indexing algorithm used on-the-fly; allowed values: ffbidx, fft, fftw, none | | | - geom_refinement_algorithm | string | Post-indexing detector geometry refinement algorithm; allowed values: none, beam_center | | | - poni_rot1 | float | Tilt of the detector rot1 according to PyFAI PONI convention \[rad\] | |