Files
Jungfraujoch/common/Plot.h
T
leonarski_fandClaude Opus 5 26a82ddc72 spindle: the per-image severity travels the whole data path, and absence travels with it
The score was computed and then thrown away - carried on the per-image message but transported
nowhere - so the automation it exists for could not read it. It now flows like bkg_estimate at
every layer: CBOR (per-image key, END-block run mean and per-image array), HDF5 (per-image
/entry/MX/spindleBlindFraction in the data files, the array and spindleBlindFractionMean in the
master), read-back into a re-opened dataset, the scan result, the receiver plots, the REST plot
and scan_result schemas, and the viewer and frontend plot menus.

Absence is load-bearing and every transport keeps it distinguishable from a measured zero: the
CBOR key is simply missing, the HDF5 array holds NaN, and read-back turns NaN back into an
absent optional rather than a value. A pipeline that read 0 where the truth is "no value" would
take exactly the wrong action - a measured 0 says one sweep loses nothing, absence says nobody
could look, and the second must engage the recovery protocol while the first must not. The
round-trip tests pin all three states through CBOR and through a written-and-reopened file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFEJG6WBQv8th4UJFNe53N
2026-09-04 10:59:05 +02:00

32 lines
1.2 KiB
C++

// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <vector>
#include <cstdint>
#include <string>
#include <optional>
enum class PlotType {
BkgEstimate, SpindleBlindFraction, AzInt, AzInt1D, SpotCount, SpotCountLowRes, SpotCountIndexed, SpotCountIceRing,
IndexingRate, IndexingUnitCellLength,
IndexingUnitCellAngle, ErrorPixels, SaturatedPixels, ImageCollectionEfficiency, ReceiverDelay, ReceiverFreeSendBuf,
ROISum, ROIMean, ROIMaxCount, ROIPixels, ROIWeightedX, ROIWeightedY, PacketsReceived, MaxValue,
ResolutionEstimate, ProfileRadius, Mosaicity, BFactor, PixelSum, StrongPixels,
RefinementBeamX, RefinementBeamY, ImageProcessingTime, IntegratedReflections,
ImageScaleFactor, ImageScaleCC, CompressionRatio, IndexingLatticeCount, IceRingScore
};
enum class PlotAzintUnit {
Q_recipA, TwoTheta_deg, d_A
};
struct PlotRequest {
PlotType type = PlotType::BkgEstimate;
uint64_t binning = 0;
bool experimental_coord = false;
PlotAzintUnit azint_unit = PlotAzintUnit::Q_recipA;
std::optional<float> fill_value;
};