Updates after MAX IV experiment

This commit is contained in:
2024-06-03 10:56:43 +02:00
parent 5d7a4e1ff2
commit 953c3fa972
70 changed files with 1530 additions and 334 deletions

View File

@@ -16,6 +16,7 @@ void HDF5DataFilePluginMX::OpenFile(HDF5File &data_file, const DataMessage &msg)
strong_pixel_count.reserve(RESERVE_IMAGES);
indexed.reserve(RESERVE_IMAGES);
indexed_lattice.reserve(9 * RESERVE_IMAGES);
spot_count_rings.reserve(RESERVE_IMAGES);
}
void HDF5DataFilePluginMX::Write(const DataMessage &msg, uint64_t image_number) {
@@ -33,6 +34,9 @@ void HDF5DataFilePluginMX::Write(const DataMessage &msg, uint64_t image_number)
strong_pixel_count.resize(max_image_number + 1);
indexed.resize(max_image_number + 1);
indexed_lattice.resize((max_image_number + 1) * 9);
if (msg.spot_count_in_rings)
spot_count_rings.resize(max_image_number + 1);
}
uint32_t spot_cnt = std::min(msg.spots.size(), max_spots);
@@ -46,6 +50,9 @@ void HDF5DataFilePluginMX::Write(const DataMessage &msg, uint64_t image_number)
npeaks[image_number] = spot_cnt;
strong_pixel_count[image_number] = msg.strong_pixel_count;
indexed[image_number] = msg.indexing_result;
if (msg.spot_count_in_rings)
spot_count_rings[image_number] = msg.spot_count_in_rings.value();
if (msg.indexing_lattice.size() == 9) {
for (int i = 0; i < 9; i++)
indexed_lattice[image_number * 9 + i] = msg.indexing_lattice[i];
@@ -64,6 +71,9 @@ void HDF5DataFilePluginMX::WriteFinal(HDF5File &data_file) {
data_file.SaveVector("/entry/MX/strongPixels", strong_pixel_count);
}
if (!spot_count_rings.empty())
data_file.SaveVector("/entry/MX/nPeaksRingFiltered", spot_count_rings);
if (!indexed.empty())
data_file.SaveVector("/entry/MX/imageIndexed", indexed);
if (!indexed_lattice.empty())