-
Notifications
You must be signed in to change notification settings - Fork 0
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
Demonstrating model bias for realistic galaxies #11
Comments
We consider here real galaxies from the COSMOS 23.5 catalog. In order to demonstrate model bias we fit a Sersic model on two set of observations:
We remove galaxies such that Real galaxies simulations
Parametric galaxies simulations
|
Wow, that is awesome!!! |
Something we were wondering is whether there was a pattern in the residuals for the realistic dataset due to something else that the profile discrepancy. A way to check this is to generate the same image with galsim only for both the real image and the sersic fit and look at the residuals (code to generate the residual image). We can observe the same residuals as for our model fitting measurement. |
hummm the code is a little bit confusing to me, a lot is going on, can you just draw the real galaxy and subtract the parametric one? No added noise so it should be like 5 lines of code |
Right right, I just wanted to see clearly the exact steps going into making both parametric and real galaxies. In like 5 lines, just drawing one galaxy is enough for instance. I think I saw a few things that may not be quite right but it was hard to tell as there were 3 different gal objects every time (and that I didn't sleep much ^^') |
Ok, here is the top left galaxy for instance ind = 2
galp = cat.makeGalaxy(ind, gal_type='parametric')
galr = cat.makeGalaxy(ind, gal_type='real')
psf = galr.original_psf
convr = galsim.Convolve(galr, psf) # real gal
convp = galsim.Convolve(galp, psf) # parametric gal
imr = convr.drawImage(nx=64, ny=64, scale=0.03).array
imp = convp.drawImage(nx=64, ny=64, scale=0.03).array
figure(figsize=(12,4))
subplot(131)
title('real gal')
imshow(imr)
colorbar()
subplot(132)
title('sersic fit')
imshow(imp)
colorbar()
subplot(133)
title('residuals')
imshow(imr-imp)
colorbar() |
Ok, so the first thing I saw is that you want to use the method 'no_pixel' to draw the galaxies, b cause the pixel response is already included in the PSF most likely |
And I remembered something similar from some work a long time ago, see this notebook |
1 similar comment
And I remembered something similar from some work a long time ago, see this notebook |
Drawing galaxy from cosmos
|
It does not seem to change much the result... ind = 2
galp = cat.makeGalaxy(ind, gal_type='parametric')
galr = cat.makeGalaxy(ind, gal_type='real', noise_pad_size=64*np.sqrt(2)*0.03)
psf = galr.original_psf
convr = galsim.Convolve(psf, galr) # real gal
convp = galsim.Convolve(psf, galp) # parametric gal
imr = convr.drawImage(nx=64, ny=64, scale=0.03, method='no_pixel', use_true_center=False).array
imp = convp.drawImage(nx=64, ny=64, scale=0.03, method='no_pixel', use_true_center=False).array
figure(figsize=(12,4))
subplot(131)
title('real gal')
imshow(imr)
colorbar()
subplot(132)
title('sersic fit')
imshow(imp)
colorbar()
subplot(133)
title('residuals')
imshow(imr-imp)
colorbar() |
So it looks like there is an offset in the galsim sersic fit centroid! I added a centroid shift variable to my model (810ebda) and just ran a MAP for the field above. It fixed the dipole pattern in the residuals :-)
=> So I guess, I will now try to sample the centroid offset in the same time as the other parameters to check the model bias. |
Aaaaah that looks much better! |
Here are the latest results (ab506ca), now fitting |
This issue is to report results of experiments aiming to demonstrate the model bias when trying to estimate shear with a forward model.
The text was updated successfully, but these errors were encountered: