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

Pad or clip reference model if it cannot resize itself. #69

Merged
merged 1 commit into from Jul 14, 2017

Conversation

yalsayyad
Copy link
Contributor

Necessary for matching to WarpedPsfs, CoaddPsfs, PsfExPsfs,
and compositions thereof

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))

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)

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()

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)

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)

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
@yalsayyad yalsayyad merged commit d72c263 into master Jul 14, 2017
@ktlim ktlim deleted the tickets/DM-10953 branch August 25, 2018 06:44
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