You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@ismael-mendoza Did your code render in real space without a pixel, or in Fourier space with a pixel? If it is in Fourier space, then we should document the k-space behavior, but there is nothing to actually do.
Ok. I finally found the issue. I put in an approximation for the half-light radius of the Spergel profile. This is used to compute the scale radius for the profile. Even though that approximation is good to about 1e-8 or so, the residual inaccuracies cause the features above and thus the rendering differences. Without this approximation the profile is too slow when initialized with a half-light radius. So that leaves us in a bit of a bind, since I cannot seem to find anything more accurate that is as fast.
Activity
beckermr commentedon Jun 17, 2026
The k-value differences are due to galsim using fast, approximate exponential, log, and power functions:
https://github.com/GalSim-developers/GalSim/blob/ee177aa50424dbbc5cec4a71cadd6297109c2aa1/src/SBSpergel.cpp#L31-L35
I do not think we want to replicate this in JAX-GalSim, as we should let the XLA backend determine how to compute these special functions.
beckermr commentedon Jun 17, 2026
@ismael-mendoza Did your code render in real space without a pixel, or in Fourier space with a pixel? If it is in Fourier space, then we should document the k-space behavior, but there is nothing to actually do.
I will look into the real space behavior next.
ismael-mendoza commentedon Jun 17, 2026
thanks Matt! The behavior I was observing was with FFT drawing with pixel. Here is the test in question in case it helps:
beckermr commentedon Jun 18, 2026
Ok. I finally found the issue. I put in an approximation for the half-light radius of the Spergel profile. This is used to compute the scale radius for the profile. Even though that approximation is good to about 1e-8 or so, the residual inaccuracies cause the features above and thus the rendering differences. Without this approximation the profile is too slow when initialized with a half-light radius. So that leaves us in a bit of a bind, since I cannot seem to find anything more accurate that is as fast.
beckermr commentedon Jul 10, 2026
These lines might be related:
https://github.com/GalSim-developers/GalSim/blob/ee177aa50424dbbc5cec4a71cadd6297109c2aa1/src/SBSpergel.cpp#L31-L35
beckermr commentedon Jul 15, 2026
It is the FFT size used for rendering. See the test I added to #258
beckermr commentedon Jul 15, 2026
It is also the scale radius comp as well to be clear. That is fixed in #258