diff --git a/README.md b/README.md index 33801c770385394a6be1f0d01219bc00042281ad..05a8cbe2aab8cf789777d141e87fab07dd774113 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,7 @@ Next change the version in the following places: # Release Notes +* 0.20.3 Fix application of Field_Attenuation_R * 0.20.2 Support only one parent in hierarchies * 0.20.1 Create an abstract AntennaMapper class which implements behavior of both AntennaToSdpMapper and AntennaToRecvMapper diff --git a/tangostationcontrol/VERSION b/tangostationcontrol/VERSION index 727d97b9bb2cf88ce2d1b361bb071b4d13f10f4e..144996ed2ce21fec05796dcb821c56088f0ae67a 100644 --- a/tangostationcontrol/VERSION +++ b/tangostationcontrol/VERSION @@ -1 +1 @@ -0.20.2 +0.20.3 diff --git a/tangostationcontrol/integration_test/default/devices/test_device_calibration.py b/tangostationcontrol/integration_test/default/devices/test_device_calibration.py index cdd9650060ae1015a1b503282f88f04e9988fcb8..e664942be6a2ee6ef484289c3d0c4b81bed2d7b2 100644 --- a/tangostationcontrol/integration_test/default/devices/test_device_calibration.py +++ b/tangostationcontrol/integration_test/default/devices/test_device_calibration.py @@ -182,6 +182,9 @@ class TestCalibrationDevice(AbstractTestBases.TestDeviceBase): rcu_attenuator_db_pwr = self.antennafield_proxy.RCU_attenuator_dB_RW[:, 0] rcu_attenuator_db_ctrl = self.antennafield_proxy.RCU_attenuator_dB_RW[:, 1] + # gather settings + field_attenuation = self.antennafield_proxy.Field_Attenuation_R + for mapping_name, rcu_attenuator_db in [ ("power", rcu_attenuator_db_pwr), ("control", rcu_attenuator_db_ctrl), @@ -203,9 +206,9 @@ class TestCalibrationDevice(AbstractTestBases.TestDeviceBase): rcu_attenuator_db[1], msg=f"{mapping_name} - rcu_attenuator_db={rcu_attenuator_db}", ) - # longest cable should require no damping + # longest cable should require no damping, so only field attenuation applies self.assertEqual( - 0, + field_attenuation, rcu_attenuator_db[1], msg=f"{mapping_name} - rcu_attenuator_db={rcu_attenuator_db}", ) diff --git a/tangostationcontrol/tangostationcontrol/common/calibration.py b/tangostationcontrol/tangostationcontrol/common/calibration.py index 1978a06be2080e7099a985e26bde27efabb173a7..b6f759887ca3f165d928421d7604ab570527410f 100644 --- a/tangostationcontrol/tangostationcontrol/common/calibration.py +++ b/tangostationcontrol/tangostationcontrol/common/calibration.py @@ -254,12 +254,16 @@ def calibrate_RCU_attenuator_dB(antenna_field: DeviceProxy): # ----------------------------------------------------------- # Correct for signal loss in the cables - signal_delay_loss = ( - antenna_field.Antenna_Cables_Loss_R - antenna_field.Field_Attenuation_R - ) + signal_delay_loss = antenna_field.Antenna_Cables_Loss_R - # return coarse attenuation to apply + # return coarse attenuation to apply (weakest signal + # gets 0 attenuation). rcu_attenuator_db, _ = loss_compensation(signal_delay_loss) + + # add field-wide attenuation + rcu_attenuator_db += antenna_field.Field_Attenuation_R + + # apply on antenna field antenna_field.RCU_attenuator_dB_RW = ( numpy.tile( numpy.array(rcu_attenuator_db, dtype=numpy.int64).flatten(), diff --git a/tangostationcontrol/tangostationcontrol/devices/antennafield.py b/tangostationcontrol/tangostationcontrol/devices/antennafield.py index 54efffcade8b5760fdab200b5a1d6c1c52646790..fda4e626fb9f5fa3bdbf7add121dbf4cc10815ac 100644 --- a/tangostationcontrol/tangostationcontrol/devices/antennafield.py +++ b/tangostationcontrol/tangostationcontrol/devices/antennafield.py @@ -192,9 +192,9 @@ class AntennaField(LOFARDevice): Field_Attenuation = device_property( doc="Attenuation value to apply on all inputs.", - dtype="DevFloat", + dtype="DevShort", mandatory=False, - default_value=10.0, + default_value=10, ) # ----- Position information @@ -348,7 +348,7 @@ class AntennaField(LOFARDevice): @attribute( access=AttrWriteType.READ, - dtype="DevFloat", + dtype="DevShort", ) def Field_Attenuation_R(self): return self.Field_Attenuation