Skip to content

Commit

Permalink
Update Defects to ip_isr version.
Browse files Browse the repository at this point in the history
  • Loading branch information
czwa committed Nov 6, 2020
1 parent 96d5af2 commit 32ea0ac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
9 changes: 5 additions & 4 deletions python/lsst/pipe/tasks/interpImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import lsst.geom
import lsst.afw.image as afwImage
import lsst.afw.math as afwMath
import lsst.ip.isr as ipIsr
import lsst.meas.algorithms as measAlg
import lsst.pipe.base as pipeBase

Expand Down Expand Up @@ -137,7 +138,7 @@ def run(self, image, planeName=None, fwhmPixels=None, defects=None):
@param[in] fwhmPixels FWHM of core star (pixels)
If None the default is used, where the default
is set to the exposure psf if available
@param[in] defects List of defects of type measAlg.Defects
@param[in] defects List of defects of type ipIsr.Defects
over which to interpolate.
"""
try:
Expand All @@ -150,8 +151,8 @@ def run(self, image, planeName=None, fwhmPixels=None, defects=None):
if defects is None:
raise ValueError("No defects or plane name provided")
else:
if not isinstance(defects, measAlg.Defects):
defectList = measAlg.Defects(defects)
if not isinstance(defects, ipIsr.Defects):
defectList = ipIsr.Defects(defects)
else:
defectList = defects
planeName = "defects"
Expand All @@ -160,7 +161,7 @@ def run(self, image, planeName=None, fwhmPixels=None, defects=None):
raise ValueError("Provide EITHER a planeName OR a list of defects, not both")
if planeName not in maskedImage.getMask().getMaskPlaneDict():
raise ValueError("maskedImage does not contain mask plane %s" % planeName)
defectList = measAlg.Defects.fromMask(maskedImage, planeName)
defectList = ipIsr.Defects.fromMask(maskedImage, planeName)

# set psf from exposure if provided OR using modelPsf with fwhmPixels provided
try:
Expand Down
4 changes: 1 addition & 3 deletions python/lsst/pipe/tasks/read_curated_calibs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from lsst.meas.algorithms import Defects
from lsst.meas.algorithms.simple_curve import Curve
from lsst.ip.isr import Linearizer
from lsst.ip.isr import CrosstalkCalib
from lsst.ip.isr import (Linearizer, CrosstalkCalib, Defects)

import os
import glob
Expand Down
4 changes: 2 additions & 2 deletions tests/test_interpImageTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import lsst.geom
import lsst.afw.image as afwImage
import lsst.pex.config as pexConfig
import lsst.meas.algorithms as measAlg
import lsst.ip.isr as ipIsr
from lsst.pipe.tasks.interpImage import InterpImageTask

try:
Expand Down Expand Up @@ -80,7 +80,7 @@ def testEdge(self):
# more bad of columns next to bad right edge
mi[-nBadCol - 4:-nBadCol - 1, 0:10, afwImage.LOCAL] = (100, badBit, 0)

defectList = measAlg.Defects.fromMask(mi, pixelPlane)
defectList = ipIsr.Defects.fromMask(mi, pixelPlane)

if display:
afwDisplay.Display(frame=0).mtv(mi, title=self._testMethodName + ": image")
Expand Down

0 comments on commit 32ea0ac

Please sign in to comment.