Skip to content

Commit

Permalink
restrict range when patching MJD
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Sep 4, 2024
1 parent 6cb211c commit 2277688
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions py/specprodDB/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,14 @@ def patch_exposures(src_exposures, dst_exposures, first_night=None):
assert (dst_exposures_patched['FAPRGRM'] == dst_exposures['FAPRGRM']).all()
assert (dst_exposures_patched['FAFLAVOR'] == dst_exposures['FAFLAVOR']).all()
#
# Patch missing MJD.
# Patch missing MJD. We're only going to patch exposures that satisfy
# EFFTIME_SPEC > 0 and NIGHT >= first_src_night *because*, empirically,
# we know that we *can* obtain MJD from the raw data headers.
# Outside of that range, that is not necessarily the case.
#
missing_mjd = (dst_exposures_patched['MJD'] < 50000)
missing_mjd = ((dst_exposures_patched['MJD'] < 50000) &
(dst_exposures_patched['EFFTIME_SPEC'] > 0) &
(dst_exposures_patched['NIGHT'] >= first_night))
for row in dst_exposures_patched[missing_mjd]:
raw_data_file = os.path.join(os.environ['DESI_SPECTRO_DATA'],
"{0:08d}".format(row['NIGHT']),
Expand Down

0 comments on commit 2277688

Please sign in to comment.