From 442a7dab2815179c01c442b54cf18bfc89cbbe9e Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Fri, 9 Aug 2024 15:57:17 +0200 Subject: [PATCH] moved comments out --- dap/algos/forcesend.py | 2 +- dap/algos/radprof.py | 5 +++-- dap/algos/thresh.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dap/algos/forcesend.py b/dap/algos/forcesend.py index 84dd6da..c9b1e08 100644 --- a/dap/algos/forcesend.py +++ b/dap/algos/forcesend.py @@ -28,6 +28,7 @@ def calc_force_send(results, data, pixel_mask_pf, image, data_summed, n_aggregat +#TODO: this is duplicated in calc_apply_threshold and calc_radial_integration def calc_apply_threshold(results, data): apply_threshold = results.get("apply_threshold", False) if not apply_threshold: @@ -37,7 +38,6 @@ 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 diff --git a/dap/algos/radprof.py b/dap/algos/radprof.py index e1d877d..00fc3c8 100644 --- a/dap/algos/radprof.py +++ b/dap/algos/radprof.py @@ -62,6 +62,7 @@ def radial_profile(data, rad, norm, keep_pixels): +#TODO: this is duplicated in calc_apply_threshold and calc_force_send def calc_apply_threshold(results, data): apply_threshold = results.get("apply_threshold", False) if not apply_threshold: @@ -71,10 +72,10 @@ def calc_apply_threshold(results, data): if k not in results: return - #TODO: this is duplicated in calc_apply_threshold and calc_force_send + data = data.copy() # do the following in-place changes on a copy + threshold_min = float(results["threshold_min"]) threshold_max = float(results["threshold_max"]) - data = data.copy() # do the following in-place changes on a copy data[data < threshold_min] = np.nan #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: diff --git a/dap/algos/thresh.py b/dap/algos/thresh.py index 6efb896..075e8e7 100644 --- a/dap/algos/thresh.py +++ b/dap/algos/thresh.py @@ -1,6 +1,7 @@ import numpy as np +#TODO: this is duplicated in calc_radial_integration and calc_force_send def calc_apply_threshold(results, data): apply_threshold = results.get("apply_threshold", False) if not apply_threshold: @@ -13,7 +14,6 @@ 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 and calc_force_send threshold_min = float(results["threshold_min"]) threshold_max = float(results["threshold_max"]) data[data < threshold_min] = threshold_value