From 1f96f3c24201a9dcb9b9a385c17fc0d6eeb35407 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Fri, 22 Mar 2024 21:05:48 +0100 Subject: [PATCH] CONST --- dap/worker.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/dap/worker.py b/dap/worker.py index 2c87411..2260e92 100644 --- a/dap/worker.py +++ b/dap/worker.py @@ -11,7 +11,7 @@ import zmq from peakfinder8_extension import peakfinder_8 -flags = 0 +FLAGS = 0 def radial_profile(data, r, nr, keep_pixels=None): @@ -130,8 +130,8 @@ def main(): events = dict(poller.poll(2000)) # check every 2 seconds in each worker if backend_socket in events: - metadata = backend_socket.recv_json(flags) - image = backend_socket.recv(flags, copy=False, track=False) + metadata = backend_socket.recv_json(FLAGS) + image = backend_socket.recv(FLAGS, copy=False, track=False) image = np.frombuffer(image, dtype=metadata['type']).reshape(metadata['shape']) results = copy(metadata) @@ -463,28 +463,28 @@ def main(): frame_number = metadata['frame'] # - accumulator_socket.send_json(results, flags) + accumulator_socket.send_json(results, FLAGS) if (apply_aggregation != 0 ) and 'aggregation_max' in results: if forceSendVisualisation: - visualisation_socket.send_json(results, flags | zmq.SNDMORE) - visualisation_socket.send(data, flags, copy=True, track=True) + visualisation_socket.send_json(results, FLAGS | zmq.SNDMORE) + visualisation_socket.send(data, FLAGS, copy=True, track=True) else: data = np.empty((2,2), dtype=np.uint16) results['type'] = str(data.dtype) results['shape'] = data.shape - visualisation_socket.send_json(results, flags | zmq.SNDMORE) - visualisation_socket.send(data, flags, copy=True, track=True) + visualisation_socket.send_json(results, FLAGS | zmq.SNDMORE) + visualisation_socket.send(data, FLAGS, copy=True, track=True) else: if results['is_good_frame'] and (results['is_hit_frame'] or randint(1, skip_frames_rate) == 1): - visualisation_socket.send_json(results, flags | zmq.SNDMORE) - visualisation_socket.send(data, flags, copy=True, track=True) + visualisation_socket.send_json(results, FLAGS | zmq.SNDMORE) + visualisation_socket.send(data, FLAGS, copy=True, track=True) else: data = np.empty((2,2), dtype=np.uint16) results['type'] = str(data.dtype) results['shape'] = data.shape - visualisation_socket.send_json(results, flags | zmq.SNDMORE) - visualisation_socket.send(data, flags, copy=True, track=True) + visualisation_socket.send_json(results, FLAGS | zmq.SNDMORE) + visualisation_socket.send(data, FLAGS, copy=True, track=True)