CBOR: Add summation to start message
This commit is contained in:
@@ -1086,6 +1086,7 @@ void DiffractionExperiment::FillMessage(StartMessage &message) const {
|
||||
|
||||
message.instrument_name = GetInstrumentName();
|
||||
message.instrument_name_short = GetInstrumentNameShort();
|
||||
message.summation = GetSummation();
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::ApplyPixelMaskInFPGA(bool input) {
|
||||
|
||||
@@ -455,6 +455,8 @@ void JFJochFrameDeserializer::ProcessStartMessageUserDataElement(CborValue &valu
|
||||
start_message.min_value = GetCBORInt(map_value);
|
||||
else if (key == "rad_int_bin_number")
|
||||
start_message.rad_int_bin_number = GetCBORInt(map_value);
|
||||
else if (key == "summation")
|
||||
start_message.summation = GetCBORUInt(map_value);
|
||||
else if (key == "storage_cell_number")
|
||||
start_message.storage_cell_number = GetCBORUInt(map_value);
|
||||
else if (key == "compression_algorithm") {
|
||||
|
||||
@@ -245,7 +245,7 @@ inline void CBOR_ENC_USER_DATA(CborEncoder &encoder, const StartMessage& message
|
||||
CborEncoder mapEncoder;
|
||||
|
||||
cborErr(cbor_encode_text_stringz(&encoder, "user_data"));
|
||||
cborErr(cbor_encoder_create_map(&encoder, &mapEncoder, 17));
|
||||
cborErr(cbor_encoder_create_map(&encoder, &mapEncoder, 18));
|
||||
|
||||
CBOR_ENC(mapEncoder, "file_prefix", message.file_prefix);
|
||||
CBOR_ENC(mapEncoder, "sample_name", message.sample_name);
|
||||
@@ -277,6 +277,7 @@ inline void CBOR_ENC_USER_DATA(CborEncoder &encoder, const StartMessage& message
|
||||
CBOR_ENC(mapEncoder, "instrument_name", message.instrument_name);
|
||||
CBOR_ENC(mapEncoder, "instrument_name_short", message.instrument_name_short);
|
||||
CBOR_ENC(mapEncoder, "rad_int_bin_number", message.rad_int_bin_number);
|
||||
CBOR_ENC(mapEncoder, "summation", message.summation);
|
||||
cborErr(cbor_encoder_close_container(&encoder, &mapEncoder));
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ struct StartMessage {
|
||||
std::string instrument_name_short;
|
||||
|
||||
uint64_t rad_int_bin_number;
|
||||
uint64_t summation;
|
||||
};
|
||||
|
||||
#endif //JUNGFRAUJOCH_STARTMESSAGE_H
|
||||
|
||||
+3
-1
@@ -54,7 +54,8 @@ TEST_CASE("CBORSerialize_Start", "[CBOR]") {
|
||||
.source_name_short = "SLS",
|
||||
.instrument_name = "X06SA",
|
||||
.instrument_name_short = "PXIII",
|
||||
.rad_int_bin_number = 35
|
||||
.rad_int_bin_number = 35,
|
||||
.summation = 567
|
||||
};
|
||||
message.pixel_mask["sc0"] = std::vector<uint32_t>(456*457, 15);
|
||||
|
||||
@@ -108,6 +109,7 @@ TEST_CASE("CBORSerialize_Start", "[CBOR]") {
|
||||
CHECK(output_message.instrument_name == message.instrument_name);
|
||||
CHECK(output_message.instrument_name_short == message.instrument_name_short);
|
||||
CHECK(output_message.rad_int_bin_number == message.rad_int_bin_number);
|
||||
CHECK(output_message.summation == message.summation);
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
CHECK(output_message.detector_translation[i] == message.detector_translation[i]);
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ void HDF5Metadata::Detector(HDF5File *hdf5_file, const StartMessage &start, cons
|
||||
SaveScalar(group, "pixel_mask_applied", false);
|
||||
SaveScalar(group, "acquisition_type", "triggered");
|
||||
SaveScalar(group, "countrate_correction_applied", false);
|
||||
|
||||
SaveScalar(group, "number_of_cycles", start.summation);
|
||||
// HDF5Group(group, "geometry").NXClass("NXgeometry");
|
||||
|
||||
// DIALS likes to have this soft link
|
||||
|
||||
Reference in New Issue
Block a user