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

Implement forward Fourier transform #8

Open
b-remy opened this issue May 4, 2021 · 7 comments
Open

Implement forward Fourier transform #8

b-remy opened this issue May 4, 2021 · 7 comments
Labels
enhancement New feature or request

Comments

@b-remy
Copy link
Collaborator

b-remy commented May 4, 2021

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.

@EiffL
Copy link
Member

EiffL commented Jul 4, 2021

actually ^^' I need this for something..... so gonna go ahead and implement this

@EiffL EiffL self-assigned this Jul 4, 2021
@EiffL EiffL added the enhancement New feature or request label Jul 4, 2021
@b-remy
Copy link
Collaborator Author

b-remy commented Nov 21, 2021

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:

@EiffL
Copy link
Member

EiffL commented Nov 22, 2021

yeahhhhh, so probably we should take some time to talk about that.

@EiffL EiffL removed their assignment Nov 24, 2021
@EiffL
Copy link
Member

EiffL commented Nov 24, 2021

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

@EiffL
Copy link
Member

EiffL commented Nov 24, 2021

Looks like I was wrong, it works for even size stamp :-/

@b-remy
Copy link
Collaborator Author

b-remy commented Dec 10, 2021

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:
image
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.

@EiffL
Copy link
Member

EiffL commented Dec 10, 2021

Note that it's the "bounds" that define the image range, not necessarily the scale, in galsim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants