From e9d187c7129c5e66275703312279d09eb37d5659 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Fri, 2 Aug 2024 12:15:19 +0200 Subject: [PATCH] renamed variable pfdata to data --- dap/algos/thresh.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dap/algos/thresh.py b/dap/algos/thresh.py index eb3e345..64c5d42 100644 --- a/dap/algos/thresh.py +++ b/dap/algos/thresh.py @@ -1,16 +1,18 @@ import numpy as np -def calc_apply_threshold(results, pfdata): +def calc_apply_threshold(results, data): apply_threshold = results.get("apply_threshold", False) threshold_value_choice = results.get("threshold_value", "NaN") threshold_value = 0 if threshold_value_choice == "0" else np.nan + if apply_threshold and all(k in results for k in ("threshold_min", "threshold_max")): threshold_min = float(results["threshold_min"]) threshold_max = float(results["threshold_max"]) - pfdata[pfdata < threshold_min] = threshold_value + data[data < threshold_min] = threshold_value if threshold_max > threshold_min: - pfdata[pfdata > threshold_max] = threshold_value + data[data > threshold_max] = threshold_value + return threshold_value_choice