Skip to content

Commit

Permalink
Make isrFunctions.checkFilter require a log.
Browse files Browse the repository at this point in the history
Switch filterName to filterLabel.
  • Loading branch information
czwa committed Mar 5, 2021
1 parent 08ea3d7 commit bb64ffe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions python/lsst/ip/isr/isrFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ def setBadRegions(exposure, badStatistic="MEDIAN"):
return badPixels.sum(), value


def checkFilter(exposure, filterList, log=None):
def checkFilter(exposure, filterList, log):
"""Check to see if an exposure is in a filter specified by a list.
The goal of this is to provide a unified filter checking interface
Expand All @@ -879,7 +879,7 @@ def checkFilter(exposure, filterList, log=None):
Exposure to examine.
filterList : `list` [`str`]
List of physical_filter names to check.
log : `lsst.log.Log`, optional
log : `lsst.log.Log`
Logger to handle messages.
Returns
Expand Down
20 changes: 10 additions & 10 deletions python/lsst/ip/isr/isrTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ def readIsrData(self, dataRef, rawExposure):
dateObs = None

ccd = rawExposure.getDetector()
filterName = rawExposure.getFilterLabel()
filterLabel = rawExposure.getFilterLabel()
rawExposure.mask.addMaskPlane("UNMASKEDNAN") # needed to match pre DM-15862 processing.
biasExposure = (self.getIsrExposure(dataRef, self.config.biasDataProductName)
if self.config.doBias else None)
Expand Down Expand Up @@ -1148,7 +1148,7 @@ def readIsrData(self, dataRef, rawExposure):
illumMaskedImage = (self.getIsrExposure(dataRef,
self.config.illuminationCorrectionDataProductName).getMaskedImage()
if (self.config.doIlluminationCorrection
and filterName in self.config.illumFilters)
and filterLabel in self.config.illumFilters)
else None)

# Struct should include only kwargs to run()
Expand Down Expand Up @@ -1314,7 +1314,7 @@ def run(self, ccdExposure, camera=None, bias=None, linearizer=None,
return self.runDataRef(ccdExposure)

ccd = ccdExposure.getDetector()
filterName = ccdExposure.getFilterLabel()
filterLabel = ccdExposure.getFilterLabel()

if not ccd:
assert not self.config.doAssembleCcd, "You need a Detector to run assembleCcd."
Expand All @@ -1333,14 +1333,14 @@ def run(self, ccdExposure, camera=None, bias=None, linearizer=None,
raise RuntimeError("Must supply a flat exposure if config.doFlat=True.")
if self.config.doDefect and defects is None:
raise RuntimeError("Must supply defects if config.doDefect=True.")
if (self.config.doFringe and filterName in self.fringe.config.filters
if (self.config.doFringe and filterLabel in self.fringe.config.filters
and fringes.fringes is None):
# The `fringes` object needs to be a pipeBase.Struct, as
# we use it as a `dict` for the parameters of
# `FringeTask.run()`. The `fringes.fringes` `list` may
# not be `None` if `doFringe=True`. Otherwise, raise.
raise RuntimeError("Must supply fringe exposure as a pipeBase.Struct.")
if (self.config.doIlluminationCorrection and filterName in self.config.illumFilters
if (self.config.doIlluminationCorrection and filterLabel in self.config.illumFilters
and illumMaskedImage is None):
raise RuntimeError("Must supply an illumcor if config.doIlluminationCorrection=True.")

Expand Down Expand Up @@ -1587,7 +1587,7 @@ def run(self, ccdExposure, camera=None, bias=None, linearizer=None,
if self.config.qa.doThumbnailFlattened:
flattenedThumb = isrQa.makeThumbnail(ccdExposure, isrQaConfig=self.config.qa)

if self.config.doIlluminationCorrection and filterName in self.config.illumFilters:
if self.config.doIlluminationCorrection and filterLabel in self.config.illumFilters:
self.log.info("Performing illumination correction.")
isrFunctions.illuminationCorrection(ccdExposure.getMaskedImage(),
illumMaskedImage, illumScale=self.config.illumScale,
Expand Down Expand Up @@ -2460,11 +2460,11 @@ def roughZeroPoint(self, exposure):
exposure : `lsst.afw.image.Exposure`
Exposure to process.
"""
filterName = exposure.getFilterLabel()
if filterName in self.config.fluxMag0T1:
fluxMag0 = self.config.fluxMag0T1[filterName]
filterLabel = exposure.getFilterLabel()
if filterLabel in self.config.fluxMag0T1:
fluxMag0 = self.config.fluxMag0T1[filterLabel]
else:
self.log.warn("No rough magnitude zero point set for filter %s.", filterName)
self.log.warn("No rough magnitude zero point set for filter %s.", filterLabel)
fluxMag0 = self.config.defaultFluxMag0T1

expTime = exposure.getInfo().getVisitInfo().getExposureTime()
Expand Down

0 comments on commit bb64ffe

Please sign in to comment.