Skip to content

Commit

Permalink
Generalize file search
Browse files Browse the repository at this point in the history
  • Loading branch information
plazas committed Mar 31, 2020
1 parent f941fb8 commit f6f6690
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/lsst/pipe/tasks/read_curated_calibs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ def read_one_chip(root, chip_name, chip_id):
The key is the validity start time as a `datetime` object.
"""
factory_map = {'qe_curves': Curve, 'defects': Defects, 'linearizer': Linearizer}
files = glob.glob(os.path.join(root, chip_name, '*.ecsv')) + glob.glob(os.path.join(root,
chip_name, '*.yaml'))
files = []
extensions = (".ecsv", ".yaml")
for ext in extensions:
files.extend(glob.glob(os.path.join(root, chip_name, f"*.{ext}")))

parts = os.path.split(root)
instrument = os.path.split(parts[0])[1] # convention is that these reside at <instrument>/<data_name>
data_name = parts[1]
Expand Down

0 comments on commit f6f6690

Please sign in to comment.