DifferentiableUniverseInitiative / GalFlow

A TensorFlow reimplementation of GalSim
MIT License
10 stars 4 forks source link

Adding basic light profiles #11

Closed EiffL closed 3 years ago

EiffL commented 3 years ago

We want to add some simple light profiles like Gaussian and Sersic. including ellipticity, magnitude/flux, size,, (sersic index). Probably in lightprofiles.py

We want to validate is against GalSim.

EiffL commented 3 years ago

Any success here :-) ?

b-remy commented 3 years ago

I started a little comparison here, now integrating them in GalFlow with unit tests: https://colab.research.google.com/drive/1VclQ048ZarPuoN-CGKDa-OIwVKI-htHQ?usp=sharing

The sersic profile reconstruction is not as close as the gaussian, still looking how to improve :-)

Gaussian: image

Sersic (r0=5, n=2): image

EiffL commented 3 years ago

I just dug through the code, I think this is how GalSim knows how much flux there is in a Sersic profile: https://github.com/GalSim-developers/GalSim/blob/6c1eb247df86ec03d1a2c9c8024fe57b1bd4a154/src/SBSersic.cpp#L332

which is used here: https://github.com/GalSim-developers/GalSim/blob/6c1eb247df86ec03d1a2c9c8024fe57b1bd4a154/galsim/sersic.py#L251