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

images.GaussConvFourier and images.GaussConvImage layers rotate in opposite directions #262

Open
iancze opened this issue Dec 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@iancze
Copy link
Collaborator

iancze commented Dec 4, 2024

Describe the bug
The two Gaussian convolution layers, images.GaussConvFourier and images.GaussConvImage, do not yield consistent results when considering elliptical beams with some non-zero rotation value Omega.

It appears the images.GaussConvFourier routine is consistent with our convention expectations (positive Omega is rotated from North towards East, 0 degrees has FWHM_maj aligned with N-S) whileimages.GaussConvImage follows the opposite convention.

See the output of the images.test_GaussConvFourier_rotate and images.test_GaussConvImage_rotate tests.

Screenshots
The routines appear to be consistent for Omega = 0.
convolved_0_deg
convolved_0_deg

But look noticeably different for Omega = 30. Compare the struts/veins in the lower half of the butterflies wings in the right vs. left wings. The GaussConvImage appears to give the expected result, where struts aligned with the beam major axis look sharpest.
convolved_30_deg
convolved_30_deg

Suggested fix

  • Investigate what is flipped inside the GaussConvFourier routine with regards to the beam.
  • Write a new test directly comparing the per-pixel output from images sent through both routines, for some non-zero and non-symmetric rotation.
  • Also, the Omega=0 results look less consistent than expected, so further tests to investigate these discrepancies.
@iancze iancze added the bug Something isn't working label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant