Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-25470: Define better Gen2 path template for raw images in obs_lsst #229

Merged
merged 19 commits into from Jul 14, 2020

Conversation

rgruendl
Copy link
Contributor

@rgruendl rgruendl commented Jul 1, 2020

Update to configuration to better distribute files within the raw repos.
Only alteration is in policy/lsstCamMapper.yaml

Update to configuration to better distribute files within the raw repos.
@rgruendl rgruendl requested a review from ktlim July 1, 2020 22:04
Copy link
Contributor

@ktlim ktlim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine. dayObs should be known (provided or looked up from expId).

@laurenam
Copy link
Contributor

laurenam commented Jul 10, 2020

I couldn't help but notice you are having a "shooting in the dark" struggle on this one. I haven't followed the ticket closely, but I ran into a similar issue on DM-24585, so wanted to let you know how I got to the bottom of things in case it's of any help to you here (see comments on PR: #217).

I just set up your branch and then ran the following:

In [1]: import lsst.daf.persistence as dafPersist                                                             
In [2]: butlerDir = "/home/lauren/LSST/obs_lsst/data/input/comCam"                                            
In [3]: butler = dafPersist.Butler(butlerDir)                                                                 
LsstCamMapper WARN: Unable to find valid calib root directory
CameraMapper INFO: Loading exposure registry from /home/lauren/LSST/obs_lsst/data/input/comCam/registry.sqlite3

In [4]: levels = ['sensor', 'skyTile', 'filter', 'expId']                                                     
In [5]: for level in levels:  
   ...:     subsets = butler.subset("raw", level=level) 
   ...:     for subset in subsets: 
   ...:         print("Subset dataIds for level {}".format(level), subset.dataId) 
   ...:                                                                                                       
Subset dataIds for level sensor {'dayObs': '2019-05-30', 'expId': 3019053000001, 'raftName': 'R22', 'detectorName': 'S00', 'detector': 0}
Subset dataIds for level skyTile {'dayObs': '2019-05-30', 'expId': 3019053000001}
Subset dataIds for level filter {'expId': 3019053000001}
Subset dataIds for level expId {'dayObs': '2019-05-30', 'expId': 3019053000001}

which shows you what entries are actually expected (e.g. expId should include dayObs in addition to expId, which I don't think yours currently does). Hope this helps at least a bit...and feel free to ping me if you think I could be of further (any!) help.

@laurenam
Copy link
Contributor

laurenam commented Jul 10, 2020

I think you also need:

diff --git a/policy/lsstCamMapper.yaml b/policy/lsstCamMapper.yaml
index 2e582c2..9675927 100644
--- a/policy/lsstCamMapper.yaml
+++ b/policy/lsstCamMapper.yaml
@@ -40,7 +40,7 @@ exposures:
     python: lsst.daf.base.PropertyList
     storage: FitsStorage
     tables: raw
-    template: raw/%(dayObs)s/%(expId)d/%(expId)013d-%(raftName)s-%(detectorName)s-det%(detector)03d.fits[0]
+    template: raw/%(dayObs)s/%(expId)013d/%(expId)013d-%(raftName)s-%(detectorName)s-det%(detector)03d.fits[0]
   raw:
     assembler: lsst.obs.lsst.lsstCamMapper.assemble_raw
     python: lsst.afw.image.DecoratedImageF
@@ -58,7 +58,7 @@ exposures:
     python: lsst.afw.image.DecoratedImageF
     storage: FitsStorage
     tables: raw
-    template: raw/%(dayObs)s/%(expId)d/%(expId)013d-%(raftName)s-%(detectorName)s-det%(detector)03d.fits[%(ch
+    template: raw/%(dayObs)s/%(expId)013d/%(expId)013d-%(raftName)s-%(detectorName)s-det%(detector)03d.fits[%
   postISRCCD:
     template: postISRCCD/%(expId)013d-%(filter)s/%(raftName)s/postISRCCD_%(expId)013d-%(filter)s-%(raftName)s
   postISRCCD_uninterpolated:
@@ -448,7 +448,7 @@ datasets:
     python: lsst.daf.base.PropertyList
     storage: FitsStorage
     tables: raw
-    template: raw/%(run)s/%(raftName)s/%(expId)013d-%(raftName)s-%(detectorName)s-det%(detector)03d.fits[0]
+    template: raw/%(dayObs)s/%(expId)013d/%(expId)013d-%(raftName)s-%(detectorName)s-det%(detector)03d.fits[0
   refcat:
     persistable: SimpleCatalog

(I'm procrastinating doing my taxes...)

@rgruendl rgruendl requested a review from ktlim July 12, 2020 20:10
@rgruendl rgruendl self-assigned this Jul 12, 2020
Copy link
Contributor

@ktlim ktlim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great.

@rgruendl rgruendl merged commit 4a1f183 into master Jul 14, 2020
@rgruendl rgruendl deleted the tickets/DM-25470 branch July 14, 2020 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants