b-remy / gems

GEnerative Morphology for Shear
MIT License
0 stars 0 forks source link

Shear inference with Gaussians #5

Open b-remy opened 2 years ago

b-remy commented 2 years ago

I made a first try with Gaussian profiles and odd pixel size without success yet... https://colab.research.google.com/drive/1_O1Li9NunvmXjedZtTf2AmdBFvDd7DZm?usp=sharing

Capture d’écran 2022-02-02 à 19 30 20

In this notebook galaxy and psf profiles are fixed, only the shear is free so I expected that the problem was simpler than @EiffL previous experiement (https://colab.research.google.com/drive/1w2W_ISV_7sMYry7VzPFWTWk1b71AcBge?usp=sharing#scrollTo=xnZGlmijI7k-).

So I guess there is something wrong in what I did, maybe there are too much profiles or I should let the hlr free or there is not enough noise

b-remy commented 2 years ago

Only shear inference works well eventually, just had to clean the code:

Capture d’écran 2022-02-04 à 17 44 30 Capture d’écran 2022-02-04 à 17 45 32

next step:

b-remy commented 2 years ago

I am now letting free the shear and the galaxies intrinsic ellipticities (for 25 galaxies) and there is convergence:

Capture d’écran 2022-02-07 à 09 56 09 Capture d’écran 2022-02-07 à 09 56 27

In this example gamma2 is biased. I expect this bias to be reduced if I increase the number of galaxies for inference. This is my next experiment. Then I will let the galaxies hlr free as well to fit all the Gaussian profiles shape parameters.

EiffL commented 2 years ago

Nice :-) Hummmm.... I would expect you would have larger error bars but I don't see why you would get much of a bias on gamma 2.... That's unexpected...

b-remy commented 2 years ago

Yes I agree. Then I suspect that it is because I am trying to infer zero shear for gamma2. If I remember correctly, the gradients of the current interpolator are not well defined for zero shear, maybe it is inducing a bias... I'll try with non zero shear for both gamma1 and gamma2

b-remy commented 2 years ago

Two runs the for inference of shear and galaxies ellipticities, it seems to work well (19483e0)

Capture d’écran 2022-02-08 à 14 58 02 Capture d’écran 2022-02-08 à 14 56 32

Next step: fit also the radius and the flux

b-remy commented 2 years ago

Inference of 25 galaxy ellipticities, radius and constant shear (2e1205d):

Capture d’écran 2022-02-08 à 20 22 15 Capture d’écran 2022-02-08 à 20 24 18 Capture d’écran 2022-02-08 à 20 24 24

So this a good news and what we wanted to demonstrate with this issue!

I think now we can try to see how the shear inference responds when we don't have the same model in the simulations (more complex like sersic profiles) and in the forward model (e.g. gaussians).