moved comments out
This commit is contained in:
@ -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):
|
def calc_apply_threshold(results, data):
|
||||||
apply_threshold = results.get("apply_threshold", False)
|
apply_threshold = results.get("apply_threshold", False)
|
||||||
if not apply_threshold:
|
if not apply_threshold:
|
||||||
@ -37,7 +38,6 @@ def calc_apply_threshold(results, data):
|
|||||||
if k not in results:
|
if k not in results:
|
||||||
return
|
return
|
||||||
|
|
||||||
#TODO: this is duplicated in calc_apply_threshold and calc_radial_integration
|
|
||||||
threshold_min = float(results["threshold_min"])
|
threshold_min = float(results["threshold_min"])
|
||||||
threshold_max = float(results["threshold_max"])
|
threshold_max = float(results["threshold_max"])
|
||||||
data[data < threshold_min] = 0
|
data[data < threshold_min] = 0
|
||||||
|
@ -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):
|
def calc_apply_threshold(results, data):
|
||||||
apply_threshold = results.get("apply_threshold", False)
|
apply_threshold = results.get("apply_threshold", False)
|
||||||
if not apply_threshold:
|
if not apply_threshold:
|
||||||
@ -71,10 +72,10 @@ def calc_apply_threshold(results, data):
|
|||||||
if k not in results:
|
if k not in results:
|
||||||
return
|
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_min = float(results["threshold_min"])
|
||||||
threshold_max = float(results["threshold_max"])
|
threshold_max = float(results["threshold_max"])
|
||||||
data = data.copy() # do the following in-place changes on a copy
|
|
||||||
data[data < threshold_min] = np.nan
|
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
|
#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:
|
if threshold_max > threshold_min:
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
|
#TODO: this is duplicated in calc_radial_integration and calc_force_send
|
||||||
def calc_apply_threshold(results, data):
|
def calc_apply_threshold(results, data):
|
||||||
apply_threshold = results.get("apply_threshold", False)
|
apply_threshold = results.get("apply_threshold", False)
|
||||||
if not apply_threshold:
|
if not apply_threshold:
|
||||||
@ -13,7 +14,6 @@ def calc_apply_threshold(results, data):
|
|||||||
threshold_value_choice = results.get("threshold_value", "NaN")
|
threshold_value_choice = results.get("threshold_value", "NaN")
|
||||||
threshold_value = 0 if threshold_value_choice == "0" else np.nan #TODO
|
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_min = float(results["threshold_min"])
|
||||||
threshold_max = float(results["threshold_max"])
|
threshold_max = float(results["threshold_max"])
|
||||||
data[data < threshold_min] = threshold_value
|
data[data < threshold_min] = threshold_value
|
||||||
|
Reference in New Issue
Block a user