Calculating marganlized distance moments can give incorrect result
Calculating the margnaticalized distance moments for MS230627t gives results that are inconsistent with values in the header and appear incorrect. File here:
https://gracedb-playground.ligo.org/api/superevents/MS230627t/files/bayestar.multiorder.fits,1
from ligo.skymap.io import read_sky_map
import ligo.skymap.distance
skymap_multi = read_sky_map('bayestar-MS230627t.multiorder.fits,1', moc=True)
dist_mean, dist_sigma = ligo.skymap.distance.parameters_to_marginal_moments(skymap_multi['PROBDENSITY'], skymap_multi['DISTMU'], skymap_multi['DISTSIGMA'])
print(dist_mean, dist_sigma)
7862770.23043921 nan
These disagrees with the distance moments in the header:
print(skymap_multi.meta['distmean'], skymap_multi.meta['diststd'])
162.5821854394626 43.94262766367867