From b436790da8a8c992552505c86bb4c0aeedd38dba Mon Sep 17 00:00:00 2001 From: Leo Singer Date: Fri, 9 Nov 2018 14:32:40 -0500 Subject: [PATCH] Fix error in volume element for ligo-skymap-stats --- CHANGES.rst | 3 +++ ligo/skymap/postprocess/find_injection.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 85189e6..6ddaa6f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -13,6 +13,9 @@ Changelog - The ``bayestar-localize-lvalert`` and ``ligo-skymap-from-samples`` tools will now natively output multi-resolution HEALPix files. +- Fix an error in the volume element that resulted in ``ligo-skymap-stats`` + underestimating credible volumes by a factor of 2. + 0.0.17 (2018-10-24) =================== diff --git a/ligo/skymap/postprocess/find_injection.py b/ligo/skymap/postprocess/find_injection.py index 4a5b407..abcbe83 100644 --- a/ligo/skymap/postprocess/find_injection.py +++ b/ligo/skymap/postprocess/find_injection.py @@ -228,7 +228,8 @@ def find_injection_moc(sky_map, true_ra=None, true_dec=None, true_dist=None, # Calculate volume of frustum-shaped voxels with distance centered on r # and extending from (r - d_r) to (r + d_r). - dV = (np.square(r) + np.square(d_r) / 12) * d_r * dA.reshape(-1, 1) + dV = (2 / 3 * (3 * np.square(r) + np.square(d_r)) + * d_r * dA.reshape(-1, 1)) # Calculate probability within each voxel. dP = probdensity.reshape(-1, 1) * dV * np.exp( -- GitLab