Skip to content

Commit

Permalink
Merge pull request #1286 from cta-observatory/glob_recursive
Browse files Browse the repository at this point in the history
allow recursive search with glob pattern
  • Loading branch information
vuillaut committed Sep 6, 2024
2 parents 4f7ed59 + 4e0ab08 commit e4a5b7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lstchain/scripts/lstchain_merge_hdf5_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
4 changes: 2 additions & 2 deletions lstchain/scripts/lstchain_merge_muon_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit e4a5b7a

Please sign in to comment.