From a9a5dfb0fe25de400217411c83b718492649a083 Mon Sep 17 00:00:00 2001 From: G-Sommani Date: Fri, 13 Sep 2024 11:59:39 +0200 Subject: [PATCH] constraints on values of grid_value --- skyreader/plot/plot.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/skyreader/plot/plot.py b/skyreader/plot/plot.py index 90e2da0..70faa15 100644 --- a/skyreader/plot/plot.py +++ b/skyreader/plot/plot.py @@ -552,6 +552,8 @@ def bounding_box(ra, dec, theta, phi): grid_value = healpy.get_interp_val( equatorial_map, np.pi/2 - grid_dec, grid_ra ) + grid_value[np.isnan(grid_value)]=0.0 + grid_value = grid_value.clip(0.0, None) sorted_values = np.sort(equatorial_map)[::-1] # Calculate the contours