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-23778: Add gen2 to 3 repo conversion #189

Merged
merged 14 commits into from Mar 23, 2020
Merged

DM-23778: Add gen2 to 3 repo conversion #189

merged 14 commits into from Mar 23, 2020

Conversation

timj
Copy link
Member

@timj timj commented Mar 20, 2020

No description provided.

@@ -58,7 +58,7 @@ exposures:
deepCoadd_psfMatchedWarp:
template: deepCoadd/%(filter)s/%(tract)d/%(patch)s/psfMatchedWarp-%(filter)s-%(tract)d-%(patch)s-%(expId)d.fits
dcrCoadd_directWarp:
template: dcrCoadd/%(filter)s%(subfilter)s/%(tract)d/%(patch)s/warp-%(filter)s%(subfilter)s-%(tract)d-%(patch)s-%(expId)d.fits
template: dcrCoadd/%(filter)s%(subfilter)d/%(tract)d/%(patch)s/warp-%(filter)s%(subfilter)d-%(tract)d-%(patch)s-%(expId)d.fits
Copy link
Member

Choose a reason for hiding this comment

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

I didn't realize subfilters were always numbers. @isullivan , can you confirm?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm. Okay -- I was getting inconsistency errors from the conversion tool because other templates in obs_base (I think) define it as a number and not a string. Now that I look in daf_butler subfilter has to be a string so does that mean I need to fix obs_base?

Copy link
Member Author

Choose a reason for hiding this comment

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

To be explicit here. obs_base uses:

%(filter)s%(subfilter)dof%(numSubfilters)d/

obs_decam uses:

%(filter)s%(subfilter)d

obs_lsst uses %(filter)s%(subfilter)s and daf_butler defines subfilter to be a string. Since the conversion tool reads the templates from obs_base you get this error:

ValueError: Multiple types for key 'subfilter': <class 'str'> (from dcrCoadd/%(filter)s%(subfilter)s/%(tract)d/%(patch)s/warp-%(filter)s%(subfilter)s-%(tract)d-%(patch)s-%(expId)d.fits) vs. <class 'int'>.

So I'm not entirely sure how to proceed. What I did do was make all the obs packages consistent but that is not consistent with gen3. Do I merge what I've got and we resolve this on a new ticket?

Copy link
Member

Choose a reason for hiding this comment

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

I don't know what the right fix is, so I guess I'd vote for changing as little as possible to get things working until we know more, but your guess is as good as mine on how best to accomplish that.

Copy link
Member

@TallJimbo TallJimbo left a comment

Choose a reason for hiding this comment

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

Looks good, but I'm not sure I'm completely on board with moving too much of writeCuratedCalibrations to obs_base, as the last commit states as a goal. There may well be some logic that should be common (it seems like it), but I'm wary of making things more fragile by assuming that different things can be more similar than they really ought to be, especially before we have more examples of those things.

@@ -0,0 +1,12 @@
# Config overrides for converting gen2 to gen3 repos.

from lsst.obs.base.gen2to3 import Translator, AbstractToPhysicalFilterKeyHandler
Copy link
Member

Choose a reason for hiding this comment

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

This import is for side-effects?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it's a copy and paste from obs_decam which added some explicit translators in the config itself.

tests/test_convert2to3.py Outdated Show resolved Hide resolved
tests/test_convert2to3.py Outdated Show resolved Hide resolved
definition["storageClass"],
universe=butler.registry.dimensions)
butler.registry.registerDatasetType(datasetType)
self._write_obs_lsst_data(butler, datasetType)
Copy link
Member

Choose a reason for hiding this comment

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

I'm not really convinced that making this code generic over dataset types is the right call; smells a little like incidental duplication. But I guess we'll see when the third dataset type is added here: if that requires a change to the generic version, we should just split it into separate blocks for each dataset type to let them do their own thing.

Copy link
Member Author

@timj timj Mar 21, 2020

Choose a reason for hiding this comment

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

Remember that obs_*_data packages are by definition being set up in the same way such that the read_all function will return them in standard form for a given dataset type. If someone is using obs_*_data calibrations then this code will be the same in every obs package -- it's already the same between obs_subaru and obs_lsst and will be the same for obs_decam. Ideally obs_base would have a mode that scans the obs_*_data package for curated calibrations from a standardized set and the obs packages don't have to worry about _data at all. The reason ingestCuratedCalibrations works for gen2 is because of this standardization. The interesting bit is going to come when we have a curated calibration that has different gen3 dimensions.

@timj timj merged commit 54db6d3 into master Mar 23, 2020
@timj timj deleted the tickets/DM-23778 branch March 23, 2020 16:04
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

2 participants