Add n_bad_modules to Bernina format

This commit is contained in:
2018-07-16 16:56:52 +02:00
parent acf4228d51
commit c28a7467dd
2 changed files with 9 additions and 3 deletions
+8 -2
View File
@@ -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<string, boost::any>({}));
default_values.reset(new std::unordered_map<string, boost::any>(
{
{"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<string, string>(
@@ -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", {
+1 -1
View File
@@ -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<unordered_map<string, HeaderDataType>>(new unordered_map<string, HeaderDataType> {