handle equals case correctly (i.e., like indices)

This commit is contained in:
2025-11-19 18:52:24 +01:00
parent 3bbc317f6f
commit a234e4b671

View File

@@ -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