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

ENH add InterpolatedImage #60

Merged
merged 84 commits into from
Nov 10, 2023
Merged

ENH add InterpolatedImage #60

merged 84 commits into from
Nov 10, 2023

Conversation

beckermr
Copy link
Collaborator

@beckermr beckermr commented Sep 17, 2023

This PR adds interpolated images.

Closes #54

@beckermr
Copy link
Collaborator Author

This PR is blocked on figuring out the differences in this galsim issue: GalSim-developers/GalSim#1248

Copy link
Collaborator Author

@beckermr beckermr left a comment

Choose a reason for hiding this comment

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

Remove this test.

tests/jax/test_metacal.py Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@beckermr beckermr left a comment

Choose a reason for hiding this comment

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

Blacken

tests/jax/test_metacal.py Show resolved Hide resolved
@beckermr
Copy link
Collaborator Author

beckermr commented Nov 1, 2023

OK. I figured out the issue here. You need the k-space wrapping and you need to set maxk and stepk to be the same values. Those values for interpolated images in jax-galsim differ a little from galsim and cause rendering differences under convolutions. Once you do this, metacal agrees to better than 1e-7 in absolute tolerance.

@beckermr
Copy link
Collaborator Author

beckermr commented Nov 1, 2023

Alright @ismael-mendoza. This PR is a monster, but is ready for review. If you have suggestions on how to break it into smaller chunks, I'd be happy to do that.

@ismael-mendoza
Copy link
Collaborator

Thanks! will start taking a look later today and let you know if I have suggestions on how to split it

Copy link
Collaborator

@ismael-mendoza ismael-mendoza left a comment

Choose a reason for hiding this comment

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

OK @beckermr here is my initial review, still need to review a couple of parts of interpolatedimage.py namely the functions that you had to borrow from C++ code in Galsim

tests/conftest.py Show resolved Hide resolved
jax_galsim/core/utils.py Outdated Show resolved Hide resolved
jax_galsim/core/utils.py Outdated Show resolved Hide resolved
jax_galsim/core/wrap_image.py Outdated Show resolved Hide resolved
jax_galsim/gsobject.py Show resolved Hide resolved
jax_galsim/interpolatedimage.py Show resolved Hide resolved
jax_galsim/interpolatedimage.py Outdated Show resolved Hide resolved
jax_galsim/interpolatedimage.py Show resolved Hide resolved
tests/jax/test_interpolatedimage_utils.py Show resolved Hide resolved
tests/jax/test_interpolatedimage_utils.py Show resolved Hide resolved
@beckermr
Copy link
Collaborator Author

beckermr commented Nov 9, 2023

OK @ismael-mendoza. Back to you!

Copy link
Collaborator

@ismael-mendoza ismael-mendoza left a comment

Choose a reason for hiding this comment

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

OK almost done, I just don't understand two functions below

CHANGELOG.md Outdated Show resolved Hide resolved
jax_galsim/interpolatedimage.py Outdated Show resolved Hide resolved
jax_galsim/interpolatedimage.py Show resolved Hide resolved
jax_galsim/interpolatedimage.py Show resolved Hide resolved
jax_galsim/interpolatedimage.py Show resolved Hide resolved
@beckermr
Copy link
Collaborator Author

beckermr commented Nov 9, 2023

OK @ismael-mendoza ready for one last look!

Copy link
Collaborator

@ismael-mendoza ismael-mendoza left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the comments @beckermr ! Now it makes sense, just one small comment below and I think it's ready to merge

jax_galsim/interpolatedimage.py Show resolved Hide resolved
@beckermr beckermr merged commit 7e8cbc1 into GalSim-developers:main Nov 10, 2023
3 checks passed
@beckermr beckermr deleted the iimage branch November 10, 2023 17:33
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.

2d Galsim interpolants in JAX
3 participants