From de483b50ffa041f4fb88b82865275febe8337b50 Mon Sep 17 00:00:00 2001 From: appel_c Date: Wed, 3 Sep 2025 20:06:27 +0200 Subject: [PATCH] w --- debye_bec/devices/pilatus/pilatus.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/debye_bec/devices/pilatus/pilatus.py b/debye_bec/devices/pilatus/pilatus.py index 7f51e9b..6be32aa 100644 --- a/debye_bec/devices/pilatus/pilatus.py +++ b/debye_bec/devices/pilatus/pilatus.py @@ -182,13 +182,14 @@ class Pilatus(PSIDeviceBase, ADBase): # Geometry correction for the image data = np.reshape(value, (height, width)) last_image: DevicePreviewMessage = self.preview.get() - if np.array_equal(data, last_image.data): - # No update if image is the same, ~2.5ms on 2400x2400 image (6M) - logger.debug( - f"Pilatus preview image for {self.name} is the same as last one, not updating." - ) - return - self.preview.put(data) + if last_image is not None: + if np.array_equal(data, last_image.data): + # No update if image is the same, ~2.5ms on 2400x2400 image (6M) + logger.debug( + f"Pilatus preview image for {self.name} is the same as last one, not updating." + ) + return + self.preview.put(data) ######################################## # Beamline Specific Implementations #