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-12947: constructFlat.py fails on HSC #100

Merged
merged 2 commits into from Dec 8, 2017
Merged

Conversation

PaulPrice
Copy link
Contributor

No description provided.

The API in afw for transforms between different coordinate frames
(including detector pixels <--> focal plane) changed, so we need
to adapt.
Calculating the focal-plane offset of each pixel is very slow (it always
has been, but it seems slower with the new Transform API), but the new
Transform API allows us to vectorise the calculation.
xyFocalPlane = transform.applyForward(xyDetector)
origin = afwGeom.Point2D(self.config.vignette.xCenter, self.config.vignette.yCenter)
r2 = np.array([pp.distanceSquared(origin) for pp in xyFocalPlane])
isBad = (r2 > self.config.vignette.radius**2).reshape((h, w))
Copy link
Member

Choose a reason for hiding this comment

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

What kind of numbers are we looking at for numPixels here? If we're allocating multiple temporaries as big as a CCD, we might want to chunk things up.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, it looks like we were already allocating temporaries of the same size, so this is nothing new, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

numPixels is ~8M (2k x 4k). I don't think it's a big deal: we allocate larger temporaries in other places.

@PaulPrice PaulPrice merged commit 3d4fc28 into master Dec 8, 2017
@ktlim ktlim deleted the tickets/DM-12947 branch August 25, 2018 06:45
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