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:
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:
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:
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))
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:
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:
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:
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?