Closed jecampagne closed 1 year ago
Humm, one way to explain the difference is the convolution by a Pixel in Galsim
prof = Convolve(prof, Pixel(scale=1.0, gsparams=self.gsparams),
real_space=real_space, gsparams=self.gsparams)
Then, using a method that avoid this convolution leads that the two arrays agrees perfectly.
Hi @jecampagne ,
GSObject.drawImage
does implicitly convolve by a pixel for most drawing methods (the exceptions are no_pixel
and sb
). In fact, GalSim will raise a warning if it sees you've already convolved by a Pixel and the call to drawImage
would convolve the profile again: https://github.com/GalSim-developers/GalSim/blob/releases/2.4/galsim/gsobject.py#L1660-L1670
It sounds like this is probably what you're seeing here. Take a look at https://github.com/GalSim-developers/GalSim/blob/releases/2.4/galsim/gsobject.py#L1332-L1387 for more details.
In fact, currently JaxGalSim does not yet convolve with a Pixel, so when I choose in GalSim the "no-pixel" method there is a perfect match between the two codes. The next step would be to introduce a Convolution mechanism in JaxGalSim. Thanks.
Hi, I have performed in Galsim (using demo1.py)
and then
write
the image on fits file and load asgal_galsim
2D array.Now using JaxGalsim I try to do the same
and now using
im.array
.The two arrays look very similar
but when I plot the relative differences
I get
which I think is too much differences for this kind a very basic outputs. Any idea?