moved pedestal_name_saved into JFData

This commit is contained in:
2024-08-06 15:56:28 +02:00
parent 2e80fc0e6e
commit 68c7bd7866
2 changed files with 15 additions and 5 deletions

View File

@ -9,10 +9,24 @@ class JFData:
def __init__(self):
self.ju_stream_adapter = ju.StreamAdapter()
self.pedestal_name_saved = None
self.id_pixel_mask_corrected = None
self.pixel_mask_pf = None
def ensure_current_pixel_mask(self, pedestal_name):
if pedestal_name is None:
return
new_pedestal_name = pedestal_name
old_pedestal_name = self.pedestal_name_saved
if new_pedestal_name == old_pedestal_name:
return
self.refresh_pixel_mask()
self.pedestal_name_saved = pedestal_name
def refresh_pixel_mask(self):
pixel_mask_current = self.ju_stream_adapter.handler.pixel_mask
self.ju_stream_adapter.handler.pixel_mask = pixel_mask_current

View File

@ -52,8 +52,6 @@ def work(backend_address, accumulator_host, accumulator_port, visualisation_host
zmq_socks = ZMQSockets(backend_address, accumulator_host, accumulator_port, visualisation_host, visualisation_port)
pedestal_name_saved = None
n_aggregated_images = 1
data_summed = None
@ -114,9 +112,7 @@ def work(backend_address, accumulator_host, accumulator_port, visualisation_host
pedestal_name = metadata.get("pedestal_name", None)
if pedestal_name is not None and pedestal_name != pedestal_name_saved:
jfdata.refresh_pixel_mask()
pedestal_name_saved = pedestal_name
jfdata.ensure_current_pixel_mask(pedestal_name)
data = jfdata.process(image, metadata, double_pixels)