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-30426: New Psf bbox methods #593

Merged
merged 2 commits into from Jun 14, 2021
Merged

DM-30426: New Psf bbox methods #593

merged 2 commits into from Jun 14, 2021

Conversation

jmeyers314
Copy link
Contributor

@jmeyers314 jmeyers314 commented Jun 3, 2021

Adds computeImageBBox, which returns Psf->computeImage()->getBBox(), but allows Psf subclasses to implement this without requiring the intermediate call to computeImage().

Also adds computeKernelBBox for symmetry, though this is equal to computeBBox.

Copy link
Contributor

@PaulPrice PaulPrice left a comment

Choose a reason for hiding this comment

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

I have some concerns, but the general approach makes sense.

include/lsst/afw/detection/Psf.h Show resolved Hide resolved
@@ -165,6 +171,12 @@ std::shared_ptr<Psf::Image> Psf::doComputeImage(lsst::geom::Point2D const &posit
return recenterKernelImage(im, position);
}

lsst::geom::Box2I Psf::doComputeImageBBox(lsst::geom::Point2D const& position,
image::Color const& color) const {
std::shared_ptr<Psf::Image> im = computeImage(position, color, INTERNAL);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm concerned that this implementation is inefficient. At the very least you need to document this with a big red warning sign. It may be that we're not bitten terribly because of the caching, but I think you should also put some effort into implementing this method properly and efficiently in the subclasses in meas_algorithms.

These are synonyms for Psf::computeImage::getBBox and
Psf::computeKernelImage::getBBox, but may be overridden
for speed by Psf subclasses.
@jmeyers314 jmeyers314 merged commit d49707f into master Jun 14, 2021
@jmeyers314 jmeyers314 deleted the tickets/DM-30426 branch June 14, 2021 18:40
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