CosmoStat / ShapeDeconv

Repo for Machine Learning-based deconvolution
MIT License
7 stars 1 forks source link

Fix window estimation failures #12

Closed fadinammour closed 3 years ago

fadinammour commented 3 years ago

Bug : In the Unet evaluation notebook, we can observe the presence of anomalies in windows estimation.

Technical explanation : This due to an unsuccessful output in the function galsim.hsm.FindAdaptiveMom in get_moments. It is flagged with the boolean moments_status of the ShapeData Galsim object.

Physical explanation : galsim.hsm.FindAdaptiveMom fails to estimate the shape of small sources. Since we're using the pixel resolution of CFHT for HST galaxies, many of these of these galaxies will be very small thus the failure of their shape and window estimation.

Proposed solution : An easy solution is to remove the outliers (galaxies with failed window estimation).

fadinammour commented 3 years ago

The window failures are being investigated in the end of the UNet evaluation notebook.

Observations :

  1. The third of the window estimations failed.
  2. Window failures seem to occur only when the galaxies are very small (point-like source).
  3. The MSE plot remains the same when the galaxies with failed windows estimation are removed.
  4. The shape error plot is changed when the galaxies with failed windows are removed. The performance of Tikhonov and Tikhonet outputs become similar.

Improvement idea: Find a more robust way to carry shape estimation.

Note : Make sure that all the important tests and checks has been done for the window failures.

fadinammour commented 3 years ago

Additional test idea: plot galaxy size vs window estimation success/failure. To do so, the size information should be given in the galaxy batch.

Also if the galaxy size is smaller than the size of the CFHT PSF then most of its structure and details will be lost.

A priori, there is no correlation between the size of a galaxy and its shape or orientation.

fadinammour commented 3 years ago

Screenshot 2021-02-03 at 15 59 34 Screenshot 2021-02-03 at 16 27 37 All galaxies with flux radius below ~7 have failed window estimation. All galaxies (except 2) with flux radius above ~20 have successful window estimation. It would be difficult to separate the success/failure of window estimations according to the flux radius because there is an overlap between success and failure from 7 to 20.

fadinammour commented 3 years ago

After discussing with @EiffL , and comparing the galaxy flux radii to CFHT FWHM which are:

CFHT FWHM statistics (in arcsec)
Median :  0.6764631973950245
Mean :  0.6962390544214686
Standard deviation :  0.15492873233270496
Minimum :  0.35130587414095815
Maximum :  5.536473327816416

It seems that galaxies with flux radius beyond 20 will not have a failure in the window estimation process because they will be resolved. In fact, the pixel resolution of HST is 0.03, so if a galaxy has a flux radius of 20 this will correspond to a size of 0.03*20 = 0.6 which order is the same than the order of the resolution of CFHT.

In practice, we avoid measuring the shape of unresolved galaxies, i.e. which size is way smaller than the PSF. In conclusion, it is not aberrant to limit the shape measurement study to well resolved galaxies.