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-35105 Force (0, 0) for center of warped PSF images. #283

Merged
merged 1 commit into from Jun 6, 2022

Conversation

TallJimbo
Copy link
Member

Previous logic forced the image size to be odd, but picked the center of the kernel image bbox based on center of the transformed kernel image bbox. But the output kernel image center is an input: (0, 0).

This manifested as even-sizes images later in CoaddPsf; the union of two odd-sized boxes with the same dimensions but offset center is an even-sized box.

src/WarpedPsf.cc Outdated Show resolved Hide resolved
Previous logic forced the image size to be odd, but picked the center
of the kernel image bbox based on center of the transformed kernel
image bbox.  But the output kernel image center is an input: (0, 0).

This manifested as even-sizes images later in CoaddPsf; the union of
two odd-sized boxes with the same dimensions but offset center is
an even-sized box.
Copy link

@fred3m fred3m left a comment

Choose a reason for hiding this comment

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

This is fine, I just had a quick question on style that is out of curiosity but doesn't require any changes.

geom::Extent2I out_half_dims = geom::floor(0.5*out_box_fp.getDimensions());
geom::Box2I out_box;
geom::Point2I out_center(out_box_fp.getCenter());
geom::Point2I out_center(0, 0);
out_box.include(out_center);
Copy link

Choose a reason for hiding this comment

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

Any reason that you decided to define out_box this way instead of using out_box = Box2I(Point2I(0,0), Extent2I(1,1))?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really; it just fit my mental model of what I was doing better.

@TallJimbo TallJimbo merged commit e108db9 into main Jun 6, 2022
@TallJimbo TallJimbo deleted the tickets/DM-35105 branch June 6, 2022 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants