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
Pad or clip reference model if it cannot resize itself. #69
Conversation
f2fc173
to
0a8c175
Compare
referencePsfModel = referencePsfModel.resized(psfSize, psfSize) | ||
try: | ||
referencePsfModel = referencePsfModel.resized(psfSize, psfSize) | ||
self.log.info("Adjusting dimensions of reference PSF model from %s to %s" % (dimenR, dimenS)) |
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.
Print first, or change to Adjusted
.
except Exception as e: | ||
self.log.warn("Padding or clipping the reference PSF model of type %s and dimensions %s " | ||
"to the science Psf dimensions %s because: %s", | ||
referencePsfModel.__class__.__name__, dimenR, dimenS, e) |
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.
Padding with what? Zeros?
def _makePsfMaskedImage(self, psfModel, posX, posY, dimensions=None): | ||
"""! Return a MaskedImage of the a PSF Model of specified dimensions | ||
""" | ||
rawKernel = psfModel.computeKernelImage(afwGeom.Point2D(posX, posY)).convertF() |
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.
Is it just me or is convertF
ugly?
kernelIm.assign(rawKernel, bboxToPlace) | ||
|
||
kernelMask = afwImage.MaskU(dimensions) | ||
kernelMask.set(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.
Isn't there a constructor to do this directly?
kernelMask = afwImage.MaskU(dimensions) | ||
kernelMask.set(0) | ||
kernelVar = afwImage.ImageF(dimensions) | ||
kernelVar.set(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.
Same here.
Necessary for matching to WarpedPsfs, CoaddPsfs, PsfExPsfs, and compositions thereof
0a8c175
to
d72c263
Compare
Necessary for matching to WarpedPsfs, CoaddPsfs, PsfExPsfs,
and compositions thereof