Skip to content

Commit

Permalink
Support day_obs in query as formal dimension in modern universe
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Feb 29, 2024
1 parent 1db2842 commit 3b1bd75
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/lsst/obs/lsst/_ingestPhotodiode.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ def run(self, locations, run=None, file_filter=r"Photodiode_Readings.*txt$|_phot
registry = self.butler.registry
registry.registerDatasetType(self.datasetType)

if "day_obs" in self.butler.dimensions["exposure"].implied:
day_obs_key = "day_obs"
else:
day_obs_key = "exposure.day_obs"

# Find and register run that we will ingest to.
if run is None:
run = self.instrument.makeCollectionName("calib", "photodiode")
Expand Down Expand Up @@ -173,7 +178,7 @@ def run(self, locations, run=None, file_filter=r"Photodiode_Readings.*txt$|_phot
seqNum = calib.getMetadata()['seq_num']

# Find the associated exposure information.
whereClause = "exposure.day_obs=dayObs and exposure.seq_num=seqNum"
whereClause = f"{day_obs_key}=dayObs and exposure.seq_num=seqNum"
instrumentName = self.instrument.getName()
binding = {"dayObs": dayObs, "seqNum": seqNum}
logId = (dayObs, seqNum)
Expand Down

0 comments on commit 3b1bd75

Please sign in to comment.