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-20585: Remove references to deprecated afw.geom Point2x #10

Merged
merged 1 commit into from
Jul 26, 2019
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
3 changes: 2 additions & 1 deletion python/lsst/meas/extensions/scarlet/deblend.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lsst.log
import lsst.pex.config as pexConfig
import lsst.pipe.base as pipeBase
from lsst.geom import Point2D
import lsst.afw.math as afwMath
import lsst.afw.geom as afwGeom
import lsst.afw.geom.ellipses as afwEll
Expand Down Expand Up @@ -555,6 +556,6 @@ def _addChild(self, parentId, sources, heavy, scarlet_source, blend_converged, x
src.set(self.blendConvergenceFailedKey, not blend_converged)
cy, cx = scarlet_source.pixel_center
xmin, ymin = xy0
src.set(self.modelCenter, afwGeom.Point2D(cx+xmin, cy+ymin))
src.set(self.modelCenter, Point2D(cx+xmin, cy+ymin))
src.set(self.modelCenterFlux, scarlet_source.morph[cy, cx])
return src
9 changes: 5 additions & 4 deletions python/lsst/meas/extensions/scarlet/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from scarlet.component import BlendFlag

import lsst.afw.image as afwImage
import lsst.afw.geom as afwGeom
from lsst.afw.geom import SpanSet
from lsst.geom import Point2I
import lsst.afw.detection as afwDet


Expand Down Expand Up @@ -60,11 +61,11 @@ def display_model(self, observation=None, ax=None, filters=None, Q=10, stretch=1
if show:
plt.show()

def morphToHeavy(self, peakSchema, xy0=afwGeom.Point2I()):
def morphToHeavy(self, peakSchema, xy0=Point2I()):
"""Convert the morphology to a `HeavyFootprint`
"""
mask = afwImage.MaskX(np.array(self.morph > 0, dtype=np.int32), xy0=xy0)
ss = afwGeom.SpanSet.fromMask(mask)
ss = SpanSet.fromMask(mask)

if len(ss) == 0:
return None
Expand All @@ -79,7 +80,7 @@ def morphToHeavy(self, peakSchema, xy0=afwGeom.Point2I()):
heavy = afwDet.makeHeavyFootprint(tfoot, afwImage.MaskedImageF(timg))
return heavy

def modelToHeavy(self, filters, xy0=afwGeom.Point2I(), observation=None, dtype=np.float32):
def modelToHeavy(self, filters, xy0=Point2I(), observation=None, dtype=np.float32):
"""Convert the model to a `MultibandFootprint`
"""
model = self.get_model(observation=observation).astype(dtype)
Expand Down