skyportal / gwemopt

Gravitational-wave Electromagnetic Optimization
GNU General Public License v3.0
20 stars 34 forks source link

healpy.ud_grade() breaking the distance information #18

Closed jgducoin closed 5 years ago

jgducoin commented 5 years ago

Having a look on the outputed galaxies for GW170817 I figured out that the galaxies selected where wrong due to a bad distance selection, see:

gal

Tests showed that this come from the healpy.ud_grade() function which break the distance information when the nside is not the default one (the one given in the fits file header), see for example dist_mu for GW170817:

screenshot from 2019-03-01 16-58-56

In ToO_manager.py we put by hand a value to params["nside"] and in utils.py the function read_skymap() use healpy.ud_grade() with this given nside. If I put by hand the default value for the nside I have a good list of galaxies, see:

gal_2

I think that the best thing to do is just to fit with the nside given by the skymap and don't use healpy.ud_grade() (which is for me a black box), but that mean that we need to fetch the nside info from the skymap and work with it. If so we need something like: nside = hp.npix2nside(len(skymap))

agree?

mcoughlin commented 5 years ago

@jgducoin can we close this now?

jgducoin commented 5 years ago

yes!