Skip to content

Commit

Permalink
Merge pull request #1033 from cta-observatory/dl1ab_fix_params_update
Browse files Browse the repository at this point in the history
checking if parameters exist before trying to update them
  • Loading branch information
moralejo authored Oct 25, 2022
2 parents e5929be + 07e8f0b commit 4f7e9ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lstchain/scripts/lstchain_dl1ab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down

0 comments on commit 4f7e9ec

Please sign in to comment.