From a7429115d75ca5568d2e80a0f5af6e93a468565e Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Fri, 9 Aug 2024 12:56:15 +0200 Subject: [PATCH] the usual todo note --- dap/algos/forcesend.py | 2 ++ dap/algos/radprof.py | 2 +- dap/algos/thresh.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dap/algos/forcesend.py b/dap/algos/forcesend.py index 183c017..384cf2e 100644 --- a/dap/algos/forcesend.py +++ b/dap/algos/forcesend.py @@ -37,9 +37,11 @@ def calc_apply_threshold(results, data): if k not in results: return + #TODO: this is duplicated in calc_apply_threshold and calc_radial_integration threshold_min = float(results["threshold_min"]) threshold_max = float(results["threshold_max"]) data[data < threshold_min] = 0.0 + #TODO: skipping max is a guess, but not obvious/symmetric -- better to ensure the order min < max by switching them if needed if threshold_max > threshold_min: data[data > threshold_max] = 0.0 diff --git a/dap/algos/radprof.py b/dap/algos/radprof.py index 1b90973..b48456e 100644 --- a/dap/algos/radprof.py +++ b/dap/algos/radprof.py @@ -18,7 +18,7 @@ def calc_radial_integration(results, data, pixel_mask_pf): apply_threshold = results.get("apply_threshold", False) - #TODO: this is duplicated in calc_apply_threshold + #TODO: this is duplicated in calc_apply_threshold and calc_force_send 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"]) diff --git a/dap/algos/thresh.py b/dap/algos/thresh.py index 843be71..6efb896 100644 --- a/dap/algos/thresh.py +++ b/dap/algos/thresh.py @@ -13,7 +13,7 @@ def calc_apply_threshold(results, data): threshold_value_choice = results.get("threshold_value", "NaN") threshold_value = 0 if threshold_value_choice == "0" else np.nan #TODO - #TODO: this is duplicated in calc_radial_integration + #TODO: this is duplicated in calc_radial_integration and calc_force_send threshold_min = float(results["threshold_min"]) threshold_max = float(results["threshold_max"]) data[data < threshold_min] = threshold_value