Skip to content

Commit 619e00d

Browse files
author
Arthur Glowacki
committed
added copy of metadata to raw group
1 parent 808efd1 commit 619e00d

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/io/file/hdf5_io.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ bool HDF5_IO::end_save_seq(bool loginfo)
512512

513513
//-----------------------------------------------------------------------------
514514

515-
bool HDF5_IO::polar_copy_raw(const std::string filename)
515+
bool HDF5_IO::copy_to_raw_grp(const std::string filename, const std::string src_path)
516516
{
517517
hid_t src_file_id = -1;
518518
hid_t src_grp_id = -1;
@@ -547,7 +547,7 @@ bool HDF5_IO::polar_copy_raw(const std::string filename)
547547
return false;
548548
}
549549
//copy /entry to /MAPS/raw
550-
herr_t status = H5Ocopy(src_grp_id, "entry", maps_grp_id, "Raw", ocpypl_id, H5P_DEFAULT);
550+
herr_t status = H5Ocopy(src_grp_id, src_path.c_str(), maps_grp_id, "Raw", ocpypl_id, H5P_DEFAULT);
551551
if (status > 0)
552552
{
553553
logW << "Failed to copy from /entry to /MAPS/Raw\n";

src/io/file/hdf5_io.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5867,7 +5867,7 @@ class DLL_EXPORT HDF5_IO
58675867

58685868
const std::string& get_filename() { return _cur_filename; }
58695869

5870-
bool polar_copy_raw(const std::string filename);
5870+
bool copy_to_raw_grp(const std::string filename, const std::string src_path);
58715871

58725872
//-----------------------------------------------------------------------------
58735873

src/io/file/hl_file_io.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ DLL_EXPORT bool load_spectra_volume(std::string dataset_directory,
924924
data_struct::Params_Override<double>* null_po = nullptr;
925925
io::file::HDF5_IO::inst()->save_scan_scalers(&scan_info, null_po);
926926
// copy /entry to /MAPS/raw
927-
io::file::HDF5_IO::inst()->polar_copy_raw(dataset_directory+dataset_file);
927+
io::file::HDF5_IO::inst()->copy_to_raw_grp(dataset_directory+dataset_file, "entry");
928928
return true;
929929
}
930930
else
@@ -1173,6 +1173,7 @@ DLL_EXPORT bool load_spectra_volume(std::string dataset_directory,
11731173
scan_type = scan_info_edf.meta_info.scan_type;
11741174
io::file::HDF5_IO::inst()->start_save_seq(true);
11751175
io::file::HDF5_IO::inst()->save_scan_scalers(&scan_info_edf, params_override);
1176+
io::file::HDF5_IO::inst()->copy_to_raw_grp(dataset_directory+dataset_file, "metadata");
11761177
return true;
11771178
}
11781179
}

0 commit comments

Comments
 (0)