api: record the beam size at the sample, and write it where NXmx puts it
dataset_settings gains beam_size_x_um and beam_size_y_um, the horizontal and vertical size of the X-ray beam where it meets the sample. They follow the same route total_flux takes - OpenAPI, DatasetSettings, the CBOR start message, the HDF5 master, and back out of a stored file - and nothing consumes them; this is metadata a beamline can state and a downstream program can read. NXmx puts this in the application definition rather than the base class: not NXbeam's extent (rank 2, nP x 2, per scan point, always FWHM of a rectangular aperture) but NXmx's own incident_beam_size, a recommended rank-1 two-element array in the order x, y. Both are live and neither is deprecated, so the choice matters; the MX definition wins in an MX file. Written as one array with a units attribute of "m", like every other length in the master, so the settings hold micrometres and FillMessage converts once. The unit table of ReadLength_m becomes LengthUnitFactor so the array read can share it: a master written elsewhere may state this in millimetres. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFEJG6WBQv8th4UJFNe53N
This commit is contained in:
@@ -28,6 +28,8 @@ TEST_CASE("CBORSerialize_Start", "[CBOR]") {
|
||||
.countrate_correction_enabled = true,
|
||||
.incident_energy = 12400,
|
||||
.incident_wavelength = 0.988,
|
||||
.beam_size_x = 8e-5,
|
||||
.beam_size_y = 3e-5,
|
||||
.frame_time = 0.0001,
|
||||
.count_time = 0.000098,
|
||||
.saturation_value = 65534,
|
||||
@@ -145,6 +147,10 @@ TEST_CASE("CBORSerialize_Start", "[CBOR]") {
|
||||
CHECK(output_message.unit_cell->beta == message.unit_cell->beta);
|
||||
CHECK(output_message.unit_cell->gamma == message.unit_cell->gamma);
|
||||
|
||||
REQUIRE(output_message.beam_size_x);
|
||||
CHECK(output_message.beam_size_x.value() == message.beam_size_x.value());
|
||||
REQUIRE(output_message.beam_size_y);
|
||||
CHECK(output_message.beam_size_y.value() == message.beam_size_y.value());
|
||||
REQUIRE(output_message.total_flux);
|
||||
CHECK(output_message.total_flux.value() == message.total_flux.value());
|
||||
REQUIRE(output_message.attenuator_transmission);
|
||||
|
||||
Reference in New Issue
Block a user