broker: a /start without detect_ice_rings leaves rugnux live its own default
A rotation sweep run live had ice-ring detection off unless /start asked for it: the dataset settings held the flag as a plain bool (default false), the start message always carried it, and MakeRugnuxLiveSetup took it from there as the file's value - where a bare `rugnux` on the same images defaults it on for a rotation sweep. The flag is now optional through the dataset settings and the start message (which was already std::optional, as is the OpenAPI model, so neither the CBOR stream nor the API schema changes): left out of /start, the start message carries no detect_ice_rings, rugnux live decides as the CLI would (on for rotation, off for stills - unchanged there), and the master file carries no detect_ice_rings key, so an offline `rugnux` on the written file takes the same default. Given on /start, true or false, it is honoured everywhere as before. The broker's own spot finding (SpotUtils) keeps treating an unset flag as off. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK
This commit is contained in:
1 parent
a201f1791d
commit
c9704d1c5c
7 files changed
+18
-9
No files matched your search
@@ -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();
|
||||
|
||||
@@ -325,7 +325,7 @@ public:
|
||||
bool maxSpotCountIsSet() const;
|
||||
void unsetMax_spot_count();
|
||||
/// <summary>
|
||||
/// 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`.
|
||||
/// </summary>
|
||||
bool isDetectIceRings() const;
|
||||
void setDetectIceRings(bool const value);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<bool> DatasetSettings::GetDetectIceRings() const {
|
||||
return detect_ice_rings;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<bool> detect_ice_rings;
|
||||
XrayFluorescenceSpectrum fluorescence_spectrum;
|
||||
|
||||
std::optional<SmargonPosition> 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<bool> GetDetectIceRings() const;
|
||||
const XrayFluorescenceSpectrum &GetFluorescenceSpectrum() const;
|
||||
std::optional<SmargonPosition> GetSmargonPosition() const;
|
||||
};
|
||||
@@ -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"};
|
||||
|
||||
|
||||
+1
-1
@@ -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\] | |
|
||||
|
||||
Reference in new issue
Block a user