[PIPE2D-917] Bring over DM-31448 from Rubin (Allow gen2 butler lookups even when fields in the dataId are not in the registry) Created: 21/Oct/21  Updated: 20/Jul/22  Resolved: 11/Dec/21

Status: Done
Project: DRP 2-D Pipeline
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Story Priority: Normal
Reporter: rhl Assignee: price
Resolution: Done Votes: 0
Labels: NIR
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
blocks INSTRM-1469 Create a Detector model for the AG CCDs Done
Relates
relates to PIPE2D-882 Support reading PF?B files as rawb an... Open
Story Points: 1
Sprint: 2DDRP-2021 A12
Reviewers: rhl

 Description   

Please pull over https://jira.lsstcorp.org/browse/DM-31448. It's needed to read arbitrary HDUs for H4RG data



 Comments   
Comment by price [ 09/Dec/21 ]

rhl, could you please check that this works for you? You should only have to switch to the obs_pfs ticket branch.

Comment by rhl [ 11/Dec/21 ]

Sorry, I only just got to this. Rebasing my working branch of obs_pfs onto origin/tickets/PIPE2D-917 doesn't seem to work on tiger:

import lsst.daf.persistence as dafPersist
butler = dafPersist.Butler("/projects/HSC/PFS/JHU")
dataId = dict(visit=24848, arm='n', spectrograph=2)
raw = butler.get('raw', dataId, hdu=1)

generates an error ending with

/tigress/HSC/PFS/stack/current/stack/current/Linux64/daf_persistence/18.1.0/python/lsst/daf/persistence/registries.py in lookup(self, lookupProperties, reference, dataId, **kwargs)
    367             cmd += " WHERE " + " AND ".join(whereList)
    368         cursor = self.conn.cursor()
--> 369         cursor.execute(cmd, valueList)
    370         return [row for row in cursor.fetchall()]
    371 

OperationalError: no such column: hdu

Did I do something wrong? I confirmed that the monkey-patch code was being imported

Comment by price [ 11/Dec/21 ]

Sorry about that. I needed to bring the subclasses along for the ride. It works now:

$ python -c 'import lsst.daf.persistence as dafPersist; butler = dafPersist.Butler("/projects/HSC/PFS/JHU"); dataId = dict(visit=24848, arm="n", spectrograph=2); raw = butler.get("raw", dataId, hdu=1)'
CameraMapper INFO: Loading exposure registry from /projects/HSC/PFS/JHU/registry.sqlite3
CameraMapper INFO: darkTime is NaN/Inf; using exposureTime
$ 
Comment by rhl [ 11/Dec/21 ]

Looks OK. It's not the way I'd have done it, but Paul's Da Boss. We do need to make sure that this gets removed when we go to Gen3.

Comment by price [ 11/Dec/21 ]

Yeah, it's not ideal, but I'm hoping it's not going to last long.

Merged.

Generated at Sat Feb 10 15:59:43 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.