diff --git a/sf_bernina/BerninaFormat.cpp b/sf_bernina/BerninaFormat.cpp index dd2e829..42b7a99 100644 --- a/sf_bernina/BerninaFormat.cpp +++ b/sf_bernina/BerninaFormat.cpp @@ -17,7 +17,7 @@ class BerninaFormat : public H5Format public: ~BerninaFormat(){}; - BerninaFormat(const string& dataset_name) + BerninaFormat(const string& dataset_name, int n_bad_modules) { // Input values definition type. // Which type should be the parameters you receive over the REST api. @@ -30,7 +30,11 @@ class BerninaFormat : public H5Format })); // Default values used in the file format. - default_values.reset(new std::unordered_map({})); + default_values.reset(new std::unordered_map( + { + {"general/n_bad_modules", n_bad_modules}, + {"general/detector_name", dataset_name} + })); // After format has been writen, where to move the raw datasets. dataset_move_mapping.reset(new std::unordered_map( @@ -58,6 +62,8 @@ class BerninaFormat : public H5Format s_ptr(new h5_dataset("user", "general/user", NX_CHAR)), s_ptr(new h5_dataset("process", "general/process", NX_CHAR)), s_ptr(new h5_dataset("instrument", "general/instrument", NX_CHAR)), + s_ptr(new h5_dataset("detector_name", "general/detector_name", NX_CHAR)), + s_ptr(new h5_dataset("n_bad_modules", "general/n_bad_modules", NX_INT)), })), s_ptr(new h5_group("data", { diff --git a/sf_bernina/bernina_h5_writer.cpp b/sf_bernina/bernina_h5_writer.cpp index 5a0d5c4..151d529 100644 --- a/sf_bernina/bernina_h5_writer.cpp +++ b/sf_bernina/bernina_h5_writer.cpp @@ -45,7 +45,7 @@ int main (int argc, char *argv[]) writer_utils::create_destination_folder(output_file); - BerninaFormat format(detector_name,n_bad_modules); + BerninaFormat format(detector_name, n_bad_modules); WriterManager manager(format.get_input_value_type(), output_file, n_frames); auto header_values = shared_ptr>(new unordered_map {