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-27169: Use FilterLabel in Exposure/ExposureInfo #446

Merged
merged 2 commits into from Dec 9, 2020

Conversation

kfindeisen
Copy link
Member

@kfindeisen kfindeisen commented Nov 26, 2020

This PR adds support for FilterLabel as a persisted form for filter information in decomposed exposures. Must be merged with lsst/afw#551. Filter remains both for backward-compatibility, and for consistency with the Exposure API (which temporarily also has getFilter() and getFilterLabel()).

The plan for the Exposure class is to migrate code to using the FilterLabel class (through getFilterLabel()) on DM-27170, remove Filter and getFilter() and replace them with a new getFilter() that returns a FilterLabel on DM-27177, then remove getFilterLabel() on DM-27811. I propose that the components follow the same pattern to minimize user confusion.

Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

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

These changes are fine but I'd like to know the justification of writing FilterLabel as FITS.

@@ -13,6 +13,7 @@ CoaddInputs: lsst.obs.base.formatters.fitsGeneric.FitsGenericFormatter
VisitInfo: lsst.obs.base.formatters.fitsGeneric.FitsGenericFormatter
ApCorr: lsst.obs.base.formatters.fitsGeneric.FitsGenericFormatter
PhotoCalib: lsst.obs.base.formatters.fitsGeneric.FitsGenericFormatter
FilterLabel: lsst.obs.base.formatters.fitsGeneric.FitsGenericFormatter
Copy link
Member

Choose a reason for hiding this comment

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

It seems to me that serializing in FITS is overkill. A FilterLabel is a couple of key/value pairs isn't it? YAML or JSON seems fine for that. We could fairly trivially make the FilterFormatter work for FilterLabel and Filter since Formatters know the pytype they are formatting.

Copy link
Member Author

@kfindeisen kfindeisen Dec 3, 2020

Choose a reason for hiding this comment

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

Every component of ExposureInfo, now including FilterLabel, is held, managed, and persisted using the same framework; this makes the code much simpler and lets us avoid (or, at least, phase out) a lot of the special-case code of the old ExposureInfo. Given that FilterLabel/ExposureInfo already provides a FITS format in order to benefit from these advantages, why should we create a second format instead of reusing one that is supported out of the box? If the content of FilterLabel changes (which is quite possible, as the filter system evolves), should we need to remember to synchronize changes to two different representations?

In my view, the custom FilterFormatter was a necessary evil that standardization has made unnecessary.

The Exposure.filter component remains as Filter for API compatibility.
Filter information will be migrated to the FilterLabel class over
DM-27170 and DM-27177, then migrated back to the filter component
over DM-27177 and DM-27811.
Add a link to Formatter to make that part of the documentation
more prominent, and add a note about supporting the delegation.
@kfindeisen kfindeisen merged commit 2ce3736 into master Dec 9, 2020
@kfindeisen kfindeisen deleted the tickets/DM-27169 branch December 9, 2020 01:52
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