diff --git a/Framework/DataHandling/src/LoadBBY.cpp b/Framework/DataHandling/src/LoadBBY.cpp index ce4cb54756e34e843c85534b97fdbf0212cc81a3..f33ca27c31f7d75a068d105e75bb3536b5897e8c 100644 --- a/Framework/DataHandling/src/LoadBBY.cpp +++ b/Framework/DataHandling/src/LoadBBY.cpp @@ -504,7 +504,7 @@ void LoadBBY::loadInstrumentParameters( if (!hdfTag.empty() && loadNXDataSet(entry, hdfTag, tmpFloat)) { auto factor = std::stod(details[1]); logParams[logTag] = factor * tmpFloat; - } else { + } else if (details.size() > 2) { logParams[logTag] = std::stod(details[2]); if (!hdfTag.empty()) g_log.warning() << "Cannot find hdf parameter " @@ -609,13 +609,15 @@ void LoadBBY::createInstrument(ANSTO::Tar::File &tarFile, loadInstrumentParameters(entry, logParams, allParams); - // adjust parameters - try { + // Ltof_det_value is not present for monochromatic data so check + // and replace with default + auto findLtof = logParams.find("Ltof_det_value"); + if (findLtof != logParams.end()) { logParams["L1_chopper_value"] = - logParams["Ltof_det_value"] - logParams["L2_det_value"]; - } catch (const std::invalid_argument &) { - logParams["L1_chopper_value"] = 18.47258984375; - g_log.warning() << "Cannot find parameter 'L1_chopper_value'" + logParams["Ltof_det_value"] - logParams["L2_det_value"]; + } else { + logParams["L1_chopper_value"] = 18.4726; + g_log.warning() << "Cannot recover parameter 'L1_chopper_value'" << ", using default.\n"; } } diff --git a/instrument/BILBY_Parameters.xml b/instrument/BILBY_Parameters.xml index 3c948bb6672de8fc4e2b7e7135a032dd7bd962b3..0e9a95d38da72c5a6ade5f3159986f26e124d835 100644 --- a/instrument/BILBY_Parameters.xml +++ b/instrument/BILBY_Parameters.xml @@ -13,7 +13,10 @@ <!-- following parameters are saved to the run log, parameters are entered as log_[log_name] and the - and the value is: "hdf_tag,scale,def_value" --> + and the value is: "hdf_tag,scale[,def_value]" + if the default value is not included and the + parameter is not in the hdf file no log value is + recorded--> <parameter name="log_sample_aperture" type="string"> <value val="sample/sample_aperture, 1.0, 0.0"/> </parameter> @@ -47,26 +50,27 @@ </parameter> <parameter name="log_L2_det_value" type="string"> - <value val="instrument/L2_det, 0.001, 33.15616015625"/> + <value val="instrument/L2_det, 0.001, 33.1562"/> </parameter> + <!-- no valid default value --> <parameter name="log_Ltof_det_value" type="string"> - <value val="instrument/Ltof_det, 0.001, 0.0"/> + <value val="instrument/Ltof_det, 0.001"/> </parameter> <parameter name="log_L1" type="string"> <value val="instrument/L1, 0.001, 16.671"/> </parameter> <parameter name="log_L2_curtainl_value" type="string"> - <value val="instrument/L2_curtainl, 0.001, 23.28446093750"/> + <value val="instrument/L2_curtainl, 0.001, 23.2845"/> </parameter> <parameter name="log_L2_curtainr_value" type="string"> - <value val="instrument/L2_curtainr, 0.001, 23.28201953125"/> + <value val="instrument/L2_curtainr, 0.001, 23.2820"/> </parameter> <parameter name="log_L2_curtainu_value" type="string"> - <value val="instrument/L2_curtainu, 0.001, 24.28616015625"/> + <value val="instrument/L2_curtainu, 0.001, 24.2862"/> </parameter> <parameter name="log_L2_curtaind_value" type="string"> - <value val="instrument/L2_curtaind, 0.001, 24.28235937500"/> + <value val="instrument/L2_curtaind, 0.001, 24.2824"/> </parameter> <parameter name="log_D_curtainl_value" type="string">