cleanup; logic also works correctly for number_of_spots == 0
This commit is contained in:
@ -8,6 +8,7 @@ from peakfinder8_extension import peakfinder_8
|
||||
def calc_peakfinder_analysis(results, data, pixel_mask_pf):
|
||||
x_beam = results["beam_center_x"] - 0.5 # to coordinates where position of first pixel/point is 0.5, 0.5
|
||||
y_beam = results["beam_center_y"] - 0.5 # to coordinates where position of first pixel/point is 0.5, 0.5
|
||||
|
||||
hitfinder_min_snr = results["hitfinder_min_snr"]
|
||||
hitfinder_min_pix_count = int(results["hitfinder_min_pix_count"])
|
||||
hitfinder_adc_thresh = results["hitfinder_adc_thresh"]
|
||||
@ -42,17 +43,12 @@ def calc_peakfinder_analysis(results, data, pixel_mask_pf):
|
||||
|
||||
number_of_spots = len(peak_list_x)
|
||||
results["number_of_spots"] = number_of_spots
|
||||
if number_of_spots != 0:
|
||||
results["spot_x"] = [-1.0] * number_of_spots
|
||||
results["spot_y"] = [-1.0] * number_of_spots
|
||||
results["spot_intensity"] = copy(peak_list_value)
|
||||
for i in range(number_of_spots):
|
||||
results["spot_x"][i] = peak_list_x[i] + 0.5
|
||||
results["spot_y"][i] = peak_list_y[i] + 0.5
|
||||
else:
|
||||
results["spot_x"] = []
|
||||
results["spot_y"] = []
|
||||
results["spot_intensity"] = []
|
||||
|
||||
npeaks_threshold_hit = results.get("npeaks_threshold_hit", 15)
|
||||
|
||||
|
Reference in New Issue
Block a user