From 4e0ab08e1f9efab5c47ef600e1bc9fd33ad73a43 Mon Sep 17 00:00:00 2001 From: Thomas Vuillaume Date: Thu, 5 Sep 2024 20:13:10 +0200 Subject: [PATCH] allow recursive search with glob pattern --- lstchain/scripts/lstchain_merge_hdf5_files.py | 4 ++-- lstchain/scripts/lstchain_merge_muon_files.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lstchain/scripts/lstchain_merge_hdf5_files.py b/lstchain/scripts/lstchain_merge_hdf5_files.py index 4546733536..8e74da443a 100644 --- a/lstchain/scripts/lstchain_merge_hdf5_files.py +++ b/lstchain/scripts/lstchain_merge_hdf5_files.py @@ -96,10 +96,10 @@ def main(): run = f'Run{args.run_number:05d}' file_list = sorted(filter( lambda f: run in f, - glob(os.path.join(args.input_dir, args.pattern)) + glob(os.path.join(args.input_dir, args.pattern), recursive=True) )) else: - file_list = sorted(glob(os.path.join(args.input_dir, args.pattern))) + file_list = sorted(glob(os.path.join(args.input_dir, args.pattern), recursive=True)) if args.no_image: keys = get_dataset_keys(file_list[0]) diff --git a/lstchain/scripts/lstchain_merge_muon_files.py b/lstchain/scripts/lstchain_merge_muon_files.py index ee9b169771..185068d728 100644 --- a/lstchain/scripts/lstchain_merge_muon_files.py +++ b/lstchain/scripts/lstchain_merge_muon_files.py @@ -53,10 +53,10 @@ def main(): run = f'Run{args.run_number:05d}' file_list = sorted(filter( lambda f: run in f, - glob(os.path.join(args.srcdir, args.pattern)) + glob(os.path.join(args.srcdir, args.pattern), recursive=True) )) else: - file_list = sorted(glob(os.path.join(args.srcdir, args.pattern))) + file_list = sorted(glob(os.path.join(args.srcdir, args.pattern), recursive=True)) if not file_list: raise IOError(f'No muon files in {args.srcdir} with the parameters requested')