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

Update source to new Footprint API #113

Merged
merged 1 commit into from Apr 26, 2017
Merged

Update source to new Footprint API #113

merged 1 commit into from Apr 26, 2017

Conversation

natelust
Copy link
Contributor

No description provided.

Copy link
Contributor

@fred3m fred3m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm liking the new API. Just one small change in multiband.py and a request to overload the SpanSet.overlaps method to accept a Mask.

@@ -868,7 +868,7 @@ def countMaskFromFootprint(mask, footprint, bitmask, ignoreMask):
bbox.clip(mask.getBBox(afwImage.PARENT))
fp = afwImage.MaskU(bbox)
subMask = mask.Factory(mask, bbox, afwImage.PARENT)
afwDet.setMaskFromFootprint(fp, footprint, bitmask)
footprint.spans.setMask(fp, bitmask)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huge 👍 on the improved (and more pythonic) API here! I especially like that you can just call footprint.spans as opposed to footprint.getSpans().

foot.setPeakSchema(self.merged.getPeakSchema())

if not foot.overlapsMask(mask):
if not foot.spans.overlaps(afwGeom.SpanSet.fromMask(mask)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know that I like this change. I think that SpanSet.overlaps should be overloaded to accept a mask, much like SpanSet.intersect, to prevent the user from having to unnecessarily cast a Mask to a SpanSet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With that said, in this particular instance it would probably be better to create an object maskSpanSet=afwGeom.SpanSet.fromMask(mask) before line 827, to avoid recasting it to the exact same object in each iteration of the loop.

@natelust natelust force-pushed the tickets/DM-8108 branch 2 times, most recently from 05489e3 to 340ba80 Compare April 25, 2017 14:31
@natelust natelust merged commit b41b948 into master Apr 26, 2017
@ktlim ktlim deleted the tickets/DM-8108 branch August 25, 2018 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants