Open b-remy opened 3 years ago
actually ^^' I need this for something..... so gonna go ahead and implement this
Ok, I think I definitely need to implement this now ^^
I would appreciate any pointer you may have about galsim drawKImage
!
So far I found these:
yeahhhhh, so probably we should take some time to talk about that.
So I made a tiny notebook to try out the Fourier convolution against GalSim, here: https://colab.research.google.com/drive/1I-Nt62ss6HsCLAvXiP62IR-YHuJLXe8n?usp=sharing
Looks like I was wrong, it works for even size stamp :-/
I'm trying to understand how galsim is performing forward Fourier transform.
Something weird I noticed is that is seems we don't have the same scale when computing the k-image in galsim or in tensorflow:
The galsim k-image seems to be slightly larger scale... It was computed with:
kim0 = obj0.drawKImage(bounds=bounds,
scale=2*_pi/(_stamp_size*padding_factor*_scale),
recenter=False).array
where _scale
is the gal profile scale, _stamp_size
is the size of the original image, padding_factor=1
. More info in colab.
Maybe when I compute the Fourier transform with TF or numpy, the Fourier scale is not 2*_pi/(_stamp_size*_scale)
... I'll continue to investigate.
Note that it's the "bounds" that define the image range, not necessarily the scale, in galsim
The aim of this issue is to document the implementation of the galsim Fourier transform in TF used in the beginning of the demo notebook.
We want to take as input a pixel image a return the Fourier image, as the
drawKImage(bounds, scale, recenter)
galsim function does.