Move back to DECTRIS flavor of NXmx

This commit is contained in:
2024-04-11 16:10:21 +02:00
parent c28c71a3f1
commit 809441d0f0
15 changed files with 241 additions and 232 deletions

View File

@@ -12,12 +12,14 @@
HDF5DataFile::HDF5DataFile(const std::string &in_filename,
const std::vector<float>& in_rad_int_bin_to_q,
int32_t in_image_low,
size_t in_max_spots) {
xpixel = 0;
ypixel = 0;
max_image_number = 0;
nimages = 0;
filename = in_filename;
image_low = in_image_low;
plugins.emplace_back(std::make_unique<HDF5DataFilePluginJUNGFRAU>());
plugins.emplace_back(std::make_unique<HDF5DataFilePluginAzInt>(in_rad_int_bin_to_q));
@@ -37,6 +39,12 @@ HDF5DataFile::~HDF5DataFile() {
for (auto &p: plugins)
p->WriteFinal(*data_file);
if (data_set) {
data_set
->Attr("image_nr_low", (int32_t) (image_low + 1))
.Attr("image_nr_high", (int32_t) (image_low + 1 + max_image_number));
data_set.reset();
}
data_file.reset();
std::string old_filename = filename + ".tmp";
std::rename(old_filename.c_str(), filename.c_str());
@@ -67,7 +75,6 @@ void HDF5DataFile::CreateFile(const DataMessage& msg) {
HDF5DataSpace data_space({1, ypixel, xpixel}, {H5S_UNLIMITED, ypixel, xpixel});
data_set = std::make_unique<HDF5DataSet>(*data_file, "/entry/data/data", data_type, data_space, dcpl);
for (auto &p: plugins)
p->OpenFile(*data_file, msg);
}