From bbb741c62fb0121def549336dfb3a3d474e521f1 Mon Sep 17 00:00:00 2001 From: Nicolas Tessore Date: Thu, 21 Sep 2023 13:56:47 +0100 Subject: [PATCH] BUG(maps): fix accidental revert The changes from 1292566 were accidentally reverted by 2aef719. --- heracles/maps.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/heracles/maps.py b/heracles/maps.py index 81f7d7e..b3549b5 100644 --- a/heracles/maps.py +++ b/heracles/maps.py @@ -399,9 +399,10 @@ def mapper(page: "CatalogPage") -> None: _map_real(wht, val, ipix, w, v) - ngal += page.size - wmean += (w - wmean).sum() / ngal - var += ((w * v) ** 2 - var).sum() / ngal + if page.size: + ngal += page.size + wmean += (w - wmean).sum() / ngal + var += ((w * v) ** 2 - var).sum() / ngal # the mapper function is yield-ed to be applied over the catalogue yield mapper @@ -552,9 +553,10 @@ def mapper(page: "CatalogPage") -> None: _map_complex(wht, val, ipix, w, re, im) - ngal += page.size - wmean += (w - wmean).sum() / ngal - var += ((w * re) ** 2 + (w * im) ** 2 - var).sum() / ngal + if page.size: + ngal += page.size + wmean += (w - wmean).sum() / ngal + var += ((w * re) ** 2 + (w * im) ** 2 - var).sum() / ngal # the mapper function is yield-ed to be applied over the catalogue yield mapper