Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Nov 26, 2024
1 parent cfad181 commit 4fe2709
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/hdf5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,12 +503,6 @@ void writeReturnData(
int_buffer.data(), 1
);

if (!rdata.pscale.empty()) {
int_buffer.resize(rdata.pscale.size());
for (int i = 0; (unsigned)i < rdata.pscale.size(); i++)
int_buffer[i] = static_cast<int>(rdata.pscale[i]);
createAndWriteInt1DDataset(file, hdf5Location + "/pscale", int_buffer);
}

int_buffer[0] = static_cast<int>(rdata.o2mode);
H5LTset_attribute_int(
Expand All @@ -530,6 +524,13 @@ void writeReturnData(
file.getId(), hdf5Location.c_str(), "rdrm", int_buffer.data(), 1
);

if (!rdata.pscale.empty()) {
int_buffer.resize(rdata.pscale.size());
for (int i = 0; (unsigned)i < rdata.pscale.size(); i++)
int_buffer[i] = static_cast<int>(rdata.pscale[i]);
createAndWriteInt1DDataset(file, hdf5Location + "/pscale", int_buffer);
}

writeLogItemsToHDF5(file, rdata.messages, hdf5Location + "/messages");

writeReturnDataDiagnosis(rdata, file, hdf5Location + "/diagnosis");
Expand Down Expand Up @@ -837,6 +838,7 @@ void createAndWriteDouble2DDataset(
const H5::H5File& file, std::string const& datasetName,
gsl::span<double const> buffer, hsize_t m, hsize_t n
) {
Expects(buffer.size() == m * n);
hsize_t const adims[]{m, n};
H5::DataSpace dataspace(2, adims);
auto dataset = file.createDataSet(
Expand All @@ -849,6 +851,7 @@ void createAndWriteInt2DDataset(
H5::H5File const& file, std::string const& datasetName,
gsl::span<int const> buffer, hsize_t m, hsize_t n
) {
Expects(buffer.size() == m * n);
hsize_t const adims[]{m, n};
H5::DataSpace dataspace(2, adims);
auto dataset = file.createDataSet(
Expand All @@ -861,6 +864,7 @@ void createAndWriteDouble3DDataset(
H5::H5File const& file, std::string const& datasetName,
gsl::span<double const> buffer, hsize_t m, hsize_t n, hsize_t o
) {
Expects(buffer.size() == m * n * o);
hsize_t const adims[]{m, n, o};
H5::DataSpace dataspace(3, adims);
auto dataset = file.createDataSet(
Expand Down

0 comments on commit 4fe2709

Please sign in to comment.