CosmoStat / autometacal

Metacalibration and shape measurement by automatic differentiation
MIT License
4 stars 1 forks source link

Refactoring of metacal function + test against NGMIX #19

Closed EiffL closed 3 years ago

EiffL commented 3 years ago

This small PR is proposing the refactoring we talked about, to have a nicer API, and still being able to reproduce NGMIX sheared images under the condition of odd size images (and with the caveats that we are still using simplistic kspace operations).

The API to get a metacal version of an image becomes:

import autometacal as autocal

mcal_image = autocal.generate_mcal_image(im, psf, rpsf, g)

where all entries here are batched, so we can compute the metacal response for a batch of images at once.

Also added simple test against ngmix, with visualisation notebook here. image image image

This PR will close #17 as it concludes this comparison against ngmix at the image level (at least for now).

andrevitorelli commented 3 years ago

I don't understand what the remaining residuals are.

EiffL commented 3 years ago

Ah good question, well this is what I explored a little bit here https://github.com/CosmoStat/autometacal/issues/17#issuecomment-866377670 where I showed how the residuals look if we have access to cubic interpolation in Fourier space. Once we finish the interpolant issue in GalFlow most of these residuals go away.

Beyond just the interpolant galsim would also use zero padding and possibly also subsampling, which we will be able to do correctly once we finish the FFT issue in GalFlow.