use ndarray.copy consistently

This commit is contained in:
2024-08-02 16:25:16 +02:00
parent f6c97e9749
commit 098146c97b

View File

@ -1,6 +1,5 @@
import argparse import argparse
import os import os
from copy import copy
from random import randint from random import randint
from time import sleep from time import sleep
@ -152,7 +151,7 @@ def work(backend_address, accumulator_host, accumulator_port, visualisation_host
pixel_mask_pf = None pixel_mask_pf = None
if pixel_mask_corrected is not None: if pixel_mask_corrected is not None:
data_s = copy(image) data_s = image.copy()
saturated_pixels_coordinates = ju_stream_adapter.handler.get_saturated_pixels(data_s, mask=True, geometry=True, gap_pixels=True, double_pixels=double_pixels) saturated_pixels_coordinates = ju_stream_adapter.handler.get_saturated_pixels(data_s, mask=True, geometry=True, gap_pixels=True, double_pixels=double_pixels)
results["saturated_pixels"] = len(saturated_pixels_coordinates[0]) results["saturated_pixels"] = len(saturated_pixels_coordinates[0])
results["saturated_pixels_x"] = saturated_pixels_coordinates[1].tolist() results["saturated_pixels_x"] = saturated_pixels_coordinates[1].tolist()
@ -166,7 +165,7 @@ def work(backend_address, accumulator_host, accumulator_port, visualisation_host
#copy image to work with peakfinder, just in case #copy image to work with peakfinder, just in case
pfdata = np.copy(data) pfdata = data.copy()
calc_mask_pixels(pfdata, pixel_mask_pf) # changes pfdata in place calc_mask_pixels(pfdata, pixel_mask_pf) # changes pfdata in place
calc_apply_threshold(results, pfdata) # changes pfdata in place calc_apply_threshold(results, pfdata) # changes pfdata in place