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-27170: Deprecate and phase out afw::image::Filter #166

Merged
merged 1 commit into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/lsst/ip/isr/assembleCcdTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def postprocessExposure(self, outExposure, inExposure):
outExposure.setMetadata(exposureMetadata)

# note: don't copy PhotoCalib, because it is assumed to be unknown in raw data
outExposure.setFilter(inExposure.getFilter())
outExposure.setFilterLabel(inExposure.getFilterLabel())
outExposure.getInfo().setVisitInfo(inExposure.getInfo().getVisitInfo())

frame = getDebugFrame(self._display, "assembledExposure")
Expand Down
2 changes: 2 additions & 0 deletions python/lsst/ip/isr/calibType.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ def updateMetadata(self, camera=None, detector=None, filterName=None,
(self._raftName, self._slotName) = self._detectorName.split("_")

if filterName:
# TOD0 DM-28093: I think this whole comment can go away, if we
# always use physicalLabel everywhere in ip_isr.
# If set via:
# exposure.getInfo().getFilter().getName()
# then this will hold the abstract filter.
parejkoj marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
7 changes: 6 additions & 1 deletion python/lsst/ip/isr/fringe.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ class FringeStatisticsConfig(Config):

class FringeConfig(Config):
"""Fringe subtraction options"""
# TODO DM-28093: change the doc to specify that these are physical labels
filters = ListField(dtype=str, default=[], doc="Only fringe-subtract these filters")
parejkoj marked this conversation as resolved.
Show resolved Hide resolved
useFilterAliases = Field(dtype=bool, default=False, doc="Search filter aliases during check.")
# TODO: remove in DM-27177
useFilterAliases = Field(dtype=bool, default=False, doc="Search filter aliases during check.",
deprecated=("Removed with no replacement (FilterLabel has no aliases)."
"Will be removed after v22."))
num = Field(dtype=int, default=30000, doc="Number of fringe measurements")
small = Field(dtype=int, default=3, doc="Half-size of small (fringe) measurements (pixels)")
large = Field(dtype=int, default=30, doc="Half-size of large (background) measurements (pixels)")
Expand Down Expand Up @@ -250,6 +254,7 @@ def checkFilter(self, exposure):
configuration, and should have the fringe applied.
"""
filterObj = afwImage.Filter(exposure.getFilter().getId())
# TODO: remove this check along with the config option in DM-27177
if self.config.useFilterAliases:
filterNameSet = set(filterObj.getAliases() + [filterObj.getName()])
else:
Expand Down
3 changes: 3 additions & 0 deletions python/lsst/ip/isr/isrTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,7 @@ def readIsrData(self, dataRef, rawExposure):
dateObs = None

ccd = rawExposure.getDetector()
# TODO DM-28093: change this to: rawExposure.getFilterLabel().physicalLabel
filterName = afwImage.Filter(rawExposure.getFilter().getId()).getName() # Canonical name for filter
rawExposure.mask.addMaskPlane("UNMASKEDNAN") # needed to match pre DM-15862 processing.
biasExposure = (self.getIsrExposure(dataRef, self.config.biasDataProductName)
Expand Down Expand Up @@ -1314,6 +1315,7 @@ def run(self, ccdExposure, camera=None, bias=None, linearizer=None,
return self.runDataRef(ccdExposure)

ccd = ccdExposure.getDetector()
# TODO DM-28093: change this to: ccdExposure.getFilterLabel().physicalLabel
filterName = afwImage.Filter(ccdExposure.getFilter().getId()).getName() # Canonical name for filter

if not ccd:
Expand Down Expand Up @@ -2460,6 +2462,7 @@ def roughZeroPoint(self, exposure):
exposure : `lsst.afw.image.Exposure`
Exposure to process.
"""
# TODO DM-28093: change this to: exposure.getFilterLabel().physicalLabel
filterName = afwImage.Filter(exposure.getFilter().getId()).getName() # Canonical name for filter
if filterName in self.config.fluxMag0T1:
fluxMag0 = self.config.fluxMag0T1[filterName]
Expand Down
1 change: 1 addition & 0 deletions python/lsst/ip/isr/straylight.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class StrayLightConfig(Config):
doc="",
default=False,
)
# TODO DM-28093: change the doc to specify that these are physical labels
filters = ListField(
dtype=str,
doc="Filters that need straylight correction.",
Expand Down