diff --git a/tangostationcontrol/tangostationcontrol/common/calibration.py b/tangostationcontrol/tangostationcontrol/common/calibration.py index 06041ba84c6e4368c1f4ea7a5e196de107ba74ea..ee38b74c59d84e171344a0047683ab5f7fe2e0f4 100644 --- a/tangostationcontrol/tangostationcontrol/common/calibration.py +++ b/tangostationcontrol/tangostationcontrol/common/calibration.py @@ -20,7 +20,6 @@ from tangostationcontrol.common.constants import ( ) from tangostationcontrol.common.sdp import complex_to_weights, are_subbands_decreasing from tangostationcontrol.common.type_checking import device_name_matches -from tangostationcontrol.common.antennas import device_member_to_antenna_type from tangostationcontrol.common.case_insensitive_string import CaseInsensitiveString logger = logging.getLogger() @@ -136,11 +135,11 @@ class CalibrationManager: ) antennafield_member = antenna_field.name().split("/")[2] - antenna_type = device_member_to_antenna_type(antennafield_member) + antenna_type = antenna_field.antenna_type_R rcu_bands = antenna_field.RCU_band_select_RW antenna_names = antenna_field.Antenna_Names_R - is_hba = CaseInsensitiveString(antenna_type) != CaseInsensitiveString("LBA") + is_hba = CaseInsensitiveString(antenna_type) == CaseInsensitiveString("HBA") def get_antenna_calibration(antenna_name: str, rcu_band: int): """Return the calibration values for the given antenna and RCU band.""" diff --git a/tangostationcontrol/tangostationcontrol/devices/base_device_classes/antennafield_device.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/antennafield_device.py index e71044b738b84503db1746fe6272ae012b8f8156..61ce7e99e20ced6609c7e2695a1d9f24a9e69308 100644 --- a/tangostationcontrol/tangostationcontrol/devices/base_device_classes/antennafield_device.py +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/antennafield_device.py @@ -584,6 +584,9 @@ class AF(LOFARDevice): max_dim_x=MAX_ANTENNA, ) + antenna_type_R = attribute( + doc="Type of Antennas in this field (f.e. LBA or HBA)", dtype=str + ) nr_antennas_R = attribute(doc="Number of Antennas in this field", dtype=numpy.int32) def __init__(self, cl, name): @@ -756,6 +759,9 @@ class AF(LOFARDevice): # Parsing a property here is quickest, so we chose that. return len(self.Control_to_RECV_mapping) // 2 + def read_antenna_type_R(self): + return self.ANTENNA_TYPE + def read_Antenna_Field_Reference_ITRF_R(self): # provide ITRF field coordinates if they were configured if self.Antenna_Field_Reference_ITRF: diff --git a/tangostationcontrol/test/common/test_calibration.py b/tangostationcontrol/test/common/test_calibration.py index 3c958bb0cae264e58fc9acb2aed43f38b82d02ba..db7bb9ee10412a8ee35f7541fe7b58d6e92dfc1f 100644 --- a/tangostationcontrol/test/common/test_calibration.py +++ b/tangostationcontrol/test/common/test_calibration.py @@ -85,6 +85,7 @@ class TestCalibrationManager(base.TestCase): ).reshape(-1, 2), Antenna_Names_R=[f"T{n + 1}" for n in range(2)], RCU_band_select_RW=numpy.array([[1, 1], [2, 2]]), + antenna_type_R="HBA", **{"name.return_value": "Stat/AFH/HBA0"}, ) subband_weights = numpy.array([[SDP_UNIT_WEIGHT] * S_pn * N_subbands] * N_pn)