From 07e8f0b165ab98ca0a662ab568ed5849d6e7a281 Mon Sep 17 00:00:00 2001 From: vuillaut Date: Mon, 24 Oct 2022 18:37:48 +0200 Subject: [PATCH] checking if parameters exist before trying to update them --- lstchain/scripts/lstchain_dl1ab.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lstchain/scripts/lstchain_dl1ab.py b/lstchain/scripts/lstchain_dl1ab.py index 48ce3f23c5..6faac25969 100644 --- a/lstchain/scripts/lstchain_dl1ab.py +++ b/lstchain/scripts/lstchain_dl1ab.py @@ -226,8 +226,12 @@ def main(): copy_h5_nodes(infile, outfile, nodes=nodes_keys) add_source_filenames(outfile, [args.input_file]) + params_node = outfile.root[dl1_params_lstcam_key] + params = params_node.read() - params = outfile.root[dl1_params_lstcam_key].read() + log.warning(f"Parameters not in original DL1 file {args.input_file} that can't be recomputed:" + f"{set(parameters_to_update) - set(params_node.colnames)}") + parameters_to_update = list(set(parameters_to_update) & set(params_node.colnames)) if image_mask_save: image_mask = outfile.root[dl1_images_lstcam_key].col('image_mask')