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

psf_utils.rescale_kernel: fix for negative shifts #177

Merged
merged 1 commit into from
Feb 14, 2023

Conversation

oczoske
Copy link
Collaborator

@oczoske oczoske commented Feb 13, 2023

In psf_utils.rescale_kernel(), the shifts dx and dy typically have small absolute values. When a shift is negative, e.g. dy = -1, the previous code cuts the image to image[:2*abs(dy), :], i.e. image[:2, ]. This makes the image very narrow in the y direction... The intended functionality is to cut 2 rows from the top, this is achieved by the new code image[:2*dy, :], i.e. image[:-2, :]. The x direction was also wrong for negative dx, the current code is symmetric in both directions.

@astronomyk
Copy link
Collaborator

Spot on. Thanks! How did you come across this bug?

@astronomyk astronomyk merged commit 21122e2 into dev_master Feb 14, 2023
@oczoske oczoske deleted the oc/fix/rescale_kernel branch February 14, 2023 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

None yet

2 participants