-
Notifications
You must be signed in to change notification settings - Fork 3
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-36768: Add psf image to alert cutouts #221
Conversation
@@ -389,11 +389,12 @@ def createCcdDataCutout(self, image, skyCenter, extent, photoCalib, srcId): | |||
CCDData object storing the calibrate information from the input | |||
difference or template image. | |||
""" | |||
point = image.getWcs().skyToPixel(skyCenter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to pass in the pixel centroid to this method from the diaSource record? No need to do WCS math at all, since we know where the source centroid is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we trust that the (x,y) of the DIASource are the same on the calexp and matched template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, those are made to be 1-1 pixel aligned (with the template having a buffer, but the xy0 set such that they are aligned).
tests/test_packageAlerts.py
Outdated
@@ -265,6 +265,9 @@ def testCreateCcdDataCutout(self): | |||
self.cutoutWcs.wcs.cd) | |||
self.assertFloatsAlmostEqual(ccdData.data, | |||
calibExposure.getImage().array) | |||
self.assertFloatsAlmostEqual(ccdData.psf, | |||
self.exposure.psf.computeKernelImage(self.center).array) | |||
self.assertFloatsAlmostEqual(np.sum(ccdData.psf), 1.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this last one is necessary: you don't need to check that computeKernelImage
is normalized here, since it's already well tested within afw.
@@ -410,6 +411,8 @@ def createCcdDataCutout(self, image, skyCenter, extent, photoCalib, srcId): | |||
% srcId) | |||
return None | |||
|
|||
cutoutPsf = image.psf.computeKernelImage(point).array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a comment here as to why this is computeKernelImage
instead of computeImage
? I'm still not convinced as to which is correct for this use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm convinced by previous discussion that we want the PSF centered in the array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As to the question about the wcs calls further down in createCcdDataCutout
, please file a ticket and we can look at it: it may or may not be necessary there.
No description provided.