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
Conversation
0d111f8
to
2d107d5
Compare
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
2d107d5
to
167374e
Compare
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.
02bc4e2
to
5a4d3f0
Compare
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 theExposure
API (which temporarily also hasgetFilter()
andgetFilterLabel()
).The plan for the
Exposure
class is to migrate code to using theFilterLabel
class (throughgetFilterLabel()
) on DM-27170, removeFilter
andgetFilter()
and replace them with a newgetFilter()
that returns aFilterLabel
on DM-27177, then removegetFilterLabel()
on DM-27811. I propose that the components follow the same pattern to minimize user confusion.