Skip to content

Commit

Permalink
Modernize calls to deprecated APIs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdswinbank committed Jan 17, 2020
1 parent 74cfc74 commit e6b78dc
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions python/lsst/pipe/tasks/matchBackgrounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ def matchBackgrounds(self, refExposure, sciExposure):

bctrl = afwMath.BackgroundControl(nx, ny, self.sctrl, statsFlag)
bctrl.setUndersampleStyle(self.config.undersampleStyle)
bctrl.setInterpStyle(self.config.interpStyle)

bkgd = afwMath.makeBackground(diffMI, bctrl)

Expand Down Expand Up @@ -437,7 +436,7 @@ def matchBackgrounds(self, refExposure, sciExposure):
approx = bkgd.getApproximate(actrl, undersampleStyle)
bkgdImage = approx.getImage()
else:
bkgdImage = bkgd.getImageF()
bkgdImage = bkgd.getImageF(self.config.interpStyle, self.config.undersampleStyle)
except Exception as e:
raise RuntimeError("Background/Approximation failed to interp image %s: %s" % (
self.debugDataIdString, e))
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/pipe/tasks/registerImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def fitWcs(self, matches, inputWcs, inputBBox):
"""
copyMatches = type(matches)(matches)
refCoordKey = copyMatches[0].first.getTable().getCoordKey()
inCentroidKey = copyMatches[0].second.getTable().getCentroidKey()
inCentroidKey = copyMatches[0].second.getTable().getCentroidSlot().getMeasKey()
for i in range(self.config.sipIter):
sipFit = makeCreateWcsWithSip(copyMatches, inputWcs, self.config.sipOrder, inputBBox)
self.log.debug("Registration WCS RMS iteration %d: %f pixels",
Expand Down Expand Up @@ -171,7 +171,7 @@ def warpSources(self, inputSources, newWcs, templateWcs, templateBBox):
templateBBox = geom.Box2D(templateBBox)
table = alignedSources.getTable()
coordKey = table.getCoordKey()
centroidKey = table.getCentroidKey()
centroidKey = table.getCentroidSlot().getMeasKey()
deleteList = []
for i, s in enumerate(alignedSources):
oldCentroid = s.get(centroidKey)
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/pipe/tasks/scaleVariance.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def subtractedBackground(self, maskedImage):
Context manager that ensure the background is restored.
"""
bg = self.background.fitBackground(maskedImage)
bgImage = bg.getImageF()
bgImage = bg.getImageF(self.background.config.algorithm, self.background.config.undersampleStyle)
maskedImage -= bgImage
try:
yield
Expand Down
2 changes: 1 addition & 1 deletion tests/test_photoCal.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def setUp(self):
self.exposure.setPhotoCalib(smallExposure.getPhotoCalib())

coordKey = self.srcCat.getCoordKey()
centroidKey = self.srcCat.getCentroidKey()
centroidKey = self.srcCat.getCentroidSlot().getMeasKey()
wcs = self.exposure.getWcs()
for src in self.srcCat:
src.set(coordKey, wcs.pixelToSky(src.get(centroidKey)))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def testRejection(self):
badIndex = 111

coordKey = inData.inputSources[badIndex].getTable().getCoordKey()
centroidKey = inData.inputSources[badIndex].getTable().getCentroidKey()
centroidKey = inData.inputSources[badIndex].getTable().getCentroidSlot().getMeasKey()
x, y = float(inData.xInput[badIndex] + 0.01), float(inData.yInput[badIndex] - 0.01)
point = geom.Point2D(x, y)
inData.inputSources[badIndex].set(centroidKey, point)
Expand Down

0 comments on commit e6b78dc

Please sign in to comment.