From 16f54c00b792bb8d62166321a50b5c319727d138 Mon Sep 17 00:00:00 2001 From: Peter Urban Date: Fri, 3 Jan 2025 17:10:22 +0100 Subject: [PATCH] remvoed limitation that value must be > 0 --- meson.build | 2 +- .../gridding/functions/gridfunctions.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 4591041..0d5916f 100644 --- a/meson.build +++ b/meson.build @@ -9,7 +9,7 @@ project( 'cpp', license: 'MPL-2.0', - version: '0.2.0', + version: '0.2.1', default_options: ['warning_level=2', 'buildtype=release', 'cpp_std=c++20'], meson_version: '>=1.3.2' #first version with clang-cl openmp support ) diff --git a/python/themachinethatgoesping/gridding/functions/gridfunctions.py b/python/themachinethatgoesping/gridding/functions/gridfunctions.py index 3f4cc29..b2e7cc6 100644 --- a/python/themachinethatgoesping/gridding/functions/gridfunctions.py +++ b/python/themachinethatgoesping/gridding/functions/gridfunctions.py @@ -210,7 +210,8 @@ def grd_weighted_mean( continue # print(ix,iy,iz,v,w) - if v >= 0: + #if v >= 0: + if np.isfinite(v): image_values[ix][iy][iz] += v * w image_weights[ix][iy][iz] += w @@ -276,7 +277,8 @@ def grd_block_mean( if abs(iz) >= nz: continue - if v >= 0: + #if v >= 0: + if np.isfinite(v): image_values[ix][iy][iz] += v image_weights[ix][iy][iz] += 1