From 0264b6d85fdc9c263dcd819266e3a9fe7144b11c Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Tue, 8 Apr 2025 17:53:27 +0200
Subject: [PATCH] fix

---
 .../devices/base_device_classes/antennafield_device.py    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tangostationcontrol/devices/base_device_classes/antennafield_device.py b/tangostationcontrol/devices/base_device_classes/antennafield_device.py
index 2a44b6e2f..2eff491b1 100644
--- a/tangostationcontrol/devices/base_device_classes/antennafield_device.py
+++ b/tangostationcontrol/devices/base_device_classes/antennafield_device.py
@@ -981,7 +981,9 @@ class AF(LOFARDevice):
 
         try:
             # make sure we update RCU_PWR_ANT_on_RW neatly with our mask
-            RCU_PWR_ANT_on_RW = self.read_attribute("RCU_PWR_ANT_on_RW") and ~mask
+            RCU_PWR_ANT_on_RW = numpy.logical_and(
+                self.read_attribute("RCU_PWR_ANT_on_RW"), numpy.logical_not(mask)
+            )
 
             # Turn off power to all antennas (in the requested mask)
             self.proxy.write_attribute("RCU_PWR_ANT_on_RW", RCU_PWR_ANT_on_RW)
@@ -1006,7 +1008,9 @@ class AF(LOFARDevice):
 
         # Power off what should be off, f.e. if they got turned off in the mask
         # but are still powered.
-        self.power_antennas_off(~self.read_attribute("Antenna_Usage_Mask_R"))
+        self.power_antennas_off(
+            numpy.logical_not(self.read_attribute("Antenna_Usage_Mask_R"))
+        )
 
         # Disable controlling the tiles that fall outside the mask
         self.proxy.write_attribute(
-- 
GitLab