Skip to content

Commit

Permalink
Replace deprecated Filter interface with FilterLabel
Browse files Browse the repository at this point in the history
The existing uses are ambiguous on physical/band: DM-28093 is to deal
with sorting that out.
  • Loading branch information
parejkoj committed Jan 5, 2021
1 parent 763706f commit b30cf99
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
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.
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")
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 v23."))
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 @@ -2448,6 +2450,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

0 comments on commit b30cf99

Please sign in to comment.