Skip to content

Commit

Permalink
Merge pull request #866 from cta-observatory/dl1ab
Browse files Browse the repository at this point in the history
Write global_metadata as root attributes in DL1ab files
  • Loading branch information
rlopezcoto authored Jan 31, 2022
2 parents 0acaff5 + a833444 commit b22332d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lstchain/scripts/lstchain_dl1ab.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from lstchain.image.cleaning import apply_dynamic_cleaning
from lstchain.image.modifier import random_psf_smearer, set_numba_seed, add_noise_in_pixels
from lstchain.io import get_dataset_keys, copy_h5_nodes, HDF5_ZSTD_FILTERS, add_source_filenames

from lstchain.io.config import (
get_cleaning_parameters,
get_standard_config,
Expand All @@ -39,7 +40,8 @@
from lstchain.io.io import (
dl1_images_lstcam_key,
dl1_params_lstcam_key,
read_metadata,
global_metadata,
write_metadata,
)
from lstchain.io.lstcontainers import DL1ParametersContainer
from lstchain.reco.disp import disp
Expand Down Expand Up @@ -198,7 +200,7 @@ def main():
if args.no_image:
nodes_keys.remove(dl1_images_lstcam_key)

metadata = read_metadata(args.input_file)
metadata = global_metadata()

with tables.open_file(args.input_file, mode='r') as infile:
image_table = infile.root[dl1_images_lstcam_key]
Expand Down Expand Up @@ -334,6 +336,8 @@ def main():
if image_mask_save:
outfile.root[dl1_images_lstcam_key].modify_column(colname='image_mask', column=image_mask)

write_metadata(metadata, args.output_file)


if __name__ == '__main__':
main()

0 comments on commit b22332d

Please sign in to comment.