From a234e4b671118969dcd6ced99482e19d23c60f93 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Wed, 19 Nov 2025 18:52:24 +0100 Subject: [PATCH] handle equals case correctly (i.e., like indices) --- dap/algos/thresh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dap/algos/thresh.py b/dap/algos/thresh.py index 66ac3b1..b1f6375 100644 --- a/dap/algos/thresh.py +++ b/dap/algos/thresh.py @@ -27,7 +27,7 @@ def calc_apply_threshold(results, data, value=None, copy=False): def threshold(data, vmin, vmax, replacement): """ - threshold data in place by replacing values < vmin and values > vmax with replacement + threshold data in place by replacing values < vmin and values >= vmax with replacement """ if vmin is not None and vmax is not None: # if vmin > vmax, data will be overwritten entirely -- better to ensure vmin < vmax by switching them if needed @@ -35,7 +35,7 @@ def threshold(data, vmin, vmax, replacement): if vmin is not None: data[data < vmin] = replacement if vmax is not None: - data[data > vmax] = replacement + data[data >= vmax] = replacement