From d174d9a2ec5f7d529578887d390bc57b41893d28 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Wed, 11 Jun 2025 13:50:51 +0200 Subject: [PATCH] fix the master hdf5 file for m3. it used to fail because it could not set exptiem and gate delay arrays --- slsReceiverSoftware/src/MasterAttributes.cpp | 32 +++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/slsReceiverSoftware/src/MasterAttributes.cpp b/slsReceiverSoftware/src/MasterAttributes.cpp index 8420e31ad..47435ffca 100644 --- a/slsReceiverSoftware/src/MasterAttributes.cpp +++ b/slsReceiverSoftware/src/MasterAttributes.cpp @@ -466,28 +466,24 @@ void MasterAttributes::WriteHDF5CounterMask(H5::H5File *fd, H5::Group *group) { } void MasterAttributes::WriteHDF5ExptimeArray(H5::H5File *fd, H5::Group *group) { - for (int i = 0; i != 3; ++i) { - char c[1024]{}; - H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); - H5::StrType strdatatype(H5::PredType::C_S1, 256); - H5::DataSet dataset = - group->createDataSet("Exposure Time1", strdatatype, dataspace); - strcpy_safe(c, ToString(exptimeArray[i])); - dataset.write(c, strdatatype); - } + char c[1024]{}; + H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); + H5::StrType strdatatype(H5::PredType::C_S1, 256); + H5::DataSet dataset = + group->createDataSet("Exposure Times", strdatatype, dataspace); + strcpy_safe(c, ToString(exptimeArray)); + dataset.write(c, strdatatype); } void MasterAttributes::WriteHDF5GateDelayArray(H5::H5File *fd, H5::Group *group) { - for (int i = 0; i != 3; ++i) { - char c[1024]{}; - H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); - H5::StrType strdatatype(H5::PredType::C_S1, 256); - H5::DataSet dataset = - group->createDataSet("Gate Delay1", strdatatype, dataspace); - strcpy_safe(c, ToString(gateDelayArray[i])); - dataset.write(c, strdatatype); - } + char c[1024]{}; + H5::DataSpace dataspace = H5::DataSpace(H5S_SCALAR); + H5::StrType strdatatype(H5::PredType::C_S1, 256); + H5::DataSet dataset = + group->createDataSet("Gate Delays", strdatatype, dataspace); + strcpy_safe(c, ToString(gateDelayArray)); + dataset.write(c, strdatatype); } void MasterAttributes::WriteHDF5Gates(H5::H5File *fd, H5::Group *group) {