From 40c0a08d7c2d51d909bc045a1c364f7e2a6b8134 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Fri, 2 Aug 2024 12:18:56 +0200 Subject: [PATCH] added todo notes --- dap/algos/radprof.py | 1 + dap/algos/thresh.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/dap/algos/radprof.py b/dap/algos/radprof.py index 101be6b..d9e6617 100644 --- a/dap/algos/radprof.py +++ b/dap/algos/radprof.py @@ -21,6 +21,7 @@ def calc_radial_integration(results, data, keep_pixels, pixel_mask_pf, center_ra apply_threshold = results.get("apply_threshold", False) + #TODO: this is duplicated in calc_apply_threshold 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 64c5d42..c902348 100644 --- a/dap/algos/thresh.py +++ b/dap/algos/thresh.py @@ -6,10 +6,12 @@ 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: this is duplicated in calc_radial_integration 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"]) data[data < threshold_min] = threshold_value + #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] = threshold_value