From ca4d392b2f846403d39366a4c6c4f7440eebd9c8 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Mon, 9 Jun 2025 16:03:55 +0200 Subject: [PATCH] dbit offset and transceiver mask --- include/aare/Hdf5MasterFile.hpp | 8 +++---- src/Hdf5MasterFile.cpp | 38 +++++++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/include/aare/Hdf5MasterFile.hpp b/include/aare/Hdf5MasterFile.hpp index a74aee0..a1b3ca8 100644 --- a/include/aare/Hdf5MasterFile.hpp +++ b/include/aare/Hdf5MasterFile.hpp @@ -78,9 +78,9 @@ class Hdf5MasterFile { std::optional m_analog_samples; uint8_t m_digital_flag{}; std::optional m_digital_samples; - // dbitoffset + std::optional m_dbit_offset; // dbitlist - // transceiver mask + std::optional m_transceiver_mask; uint8_t m_transceiver_flag{}; std::optional m_transceiver_samples; // g1 roi @@ -136,9 +136,9 @@ class Hdf5MasterFile { std::optional analog_samples() const; std::optional digital_flag() const; std::optional digital_samples() const; - // dbitoffset + std::optional dbit_offset() const; // dbitlist - // transceiver mask + std::optional transceiver_mask() const; std::optional transceiver_flag() const; std::optional transceiver_samples() const; // g1 roi diff --git a/src/Hdf5MasterFile.cpp b/src/Hdf5MasterFile.cpp index a9e0472..f7b80a9 100644 --- a/src/Hdf5MasterFile.cpp +++ b/src/Hdf5MasterFile.cpp @@ -143,9 +143,13 @@ std::optional Hdf5MasterFile::digital_flag() const { return m_digital_f std::optional Hdf5MasterFile::digital_samples() const { return m_digital_samples; } -// dbitoffset +std::optional Hdf5MasterFile::dbit_offset() const { + return m_dbit_offset; +} // dbitlist -// transceiver mask +std::optional Hdf5MasterFile::transceiver_mask() const { + return m_transceiver_mask; +} std::optional Hdf5MasterFile::transceiver_flag() const { return m_transceiver_flag; } std::optional Hdf5MasterFile::transceiver_samples() const { return m_transceiver_samples; @@ -349,9 +353,9 @@ void Hdf5MasterFile::parse_acquisition_metadata( } catch (H5::FileIException &e) { // keep the optional empty } - LOG(logDEBUG) << "Ten Giga: " << ToString(m_ten_giga); + LOG(logDEBUG) << "Ten Giga: " << m_ten_giga; H5Eset_auto(H5E_DEFAULT, reinterpret_cast(H5Eprint2), stderr); - + // thresholdenergy // thresholdall energy @@ -466,9 +470,31 @@ void Hdf5MasterFile::parse_acquisition_metadata( H5Eset_auto(H5E_DEFAULT, reinterpret_cast(H5Eprint2), stderr); - // dbitoffset + // Dbit Offset + H5::Exception::dontPrint(); + try { + m_dbit_offset = h5_get_scalar_dataset( + file, std::string(metadata_group_name + "Dbit Offset")); + } catch (H5::FileIException &e) { + // keep the optional empty + } + LOG(logDEBUG) << "Dbit Offset: " << m_dbit_offset; + H5Eset_auto(H5E_DEFAULT, reinterpret_cast(H5Eprint2), + stderr); + // dbitlist - // transceiver mask + + // Transceiver Mask + H5::Exception::dontPrint(); + try { + m_transceiver_mask = h5_get_scalar_dataset( + file, std::string(metadata_group_name + "Transceiver Mask")); + } catch (H5::FileIException &e) { + // keep the optional empty + } + LOG(logDEBUG) << "Transceiver Mask: " << m_transceiver_mask; + H5Eset_auto(H5E_DEFAULT, reinterpret_cast(H5Eprint2), + stderr); // Transceiver Flag, Transceiver Samples H5::Exception::dontPrint();