diff --git a/tangostationcontrol/tangostationcontrol/common/constants.py b/tangostationcontrol/tangostationcontrol/common/constants.py index 4e1891c507bc9fd5cb183089d82ac803cea34672..cc0a3a0f14595bb0dc946fb531ab347de6bd04c6 100644 --- a/tangostationcontrol/tangostationcontrol/common/constants.py +++ b/tangostationcontrol/tangostationcontrol/common/constants.py @@ -70,9 +70,6 @@ class constants: # default subband we use because of its low RFI DEFAULT_SUBBAND = 102 - # Maximum number of antenna inputs we support (used to determine array sizes) - MAX_INPUTS = 192 - # UNB2 constants # number of uniboards in a subrack N_unb = 2 diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/digitalbeam.py b/tangostationcontrol/tangostationcontrol/devices/sdp/digitalbeam.py index ac8401d400d25ada81a2a0e161aee6a8e24eaef7..a5a5c9d96e04b02c90a2c7e940f15e1a8f8101b4 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/digitalbeam.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/digitalbeam.py @@ -77,10 +77,10 @@ class DigitalBeam(beam_device): dtype=numpy.float64, fget=lambda self: self._delays.statistics["last"] or 0) input_select_RW = attribute(doc='Selection of inputs to use for forming each beamlet. Allows selecting broken antennas.', - dtype=((bool,),), max_dim_x=constants.N_beamlets_ctrl, max_dim_y=constants.MAX_INPUTS, access=AttrWriteType.READ_WRITE, fisallowed="is_attribute_access_allowed") + dtype=((bool,),), max_dim_x=constants.N_beamlets_ctrl, max_dim_y=constants.S_ant, access=AttrWriteType.READ_WRITE, fisallowed="is_attribute_access_allowed") antenna_select_RW = attribute(doc='Selection of antennas desired to use for forming each beamlet (= a subset of input_select of the configured antennas). Unselects broken antennas.', - dtype=((bool,),), max_dim_x=constants.N_beamlets_ctrl, max_dim_y=constants.MAX_INPUTS, access=AttrWriteType.READ_WRITE, fisallowed="is_attribute_access_allowed") + dtype=((bool,),), max_dim_x=constants.N_beamlets_ctrl, max_dim_y=constants.S_ant, access=AttrWriteType.READ_WRITE, fisallowed="is_attribute_access_allowed") nr_inputs_R = attribute(doc='Number of configured inputs from the associated antenna field.', dtype=numpy.uint32, fget="nr_inputs") @@ -148,7 +148,7 @@ class DigitalBeam(beam_device): # Generate positions for all FPGA inputs. # Use reference position for any missing antennas so they always get a delay of 0 - input_itrf = numpy.array([reference_itrf] * constants.MAX_INPUTS) + input_itrf = numpy.array([reference_itrf] * constants.S_ant) for input_nr, antenna_nr in enumerate(self.Input_to_Antenna_Mapping): if antenna_nr >= 0: input_itrf[input_nr] = antenna_itrf[antenna_nr] @@ -160,7 +160,7 @@ class DigitalBeam(beam_device): self.relative_input_positions = input_itrf - reference_itrf # use all antennas in the mapping for all beamlets, unless specified otherwise - self.write_input_select_RW(numpy.zeros((constants.MAX_INPUTS, constants.N_beamlets_ctrl), dtype=bool)) + self.write_input_select_RW(numpy.zeros((constants.S_ant, constants.N_beamlets_ctrl), dtype=bool)) self.write_antenna_select_RW(numpy.ones((self.nr_inputs(), constants.N_beamlets_ctrl), dtype=bool)) # -------- @@ -175,7 +175,7 @@ class DigitalBeam(beam_device): Returns delays[antenna][beamlet] """ - delays = numpy.zeros((constants.MAX_INPUTS, constants.N_beamlets_ctrl), dtype=numpy.float64) + delays = numpy.zeros((constants.S_ant, constants.N_beamlets_ctrl), dtype=numpy.float64) d = self.delay_calculator d.set_measure_time(timestamp) @@ -189,7 +189,7 @@ class DigitalBeam(beam_device): """ Converts an array with dimensions [antenna][beamlet] -> [fpga_nr][input_nr][pol_nr][beamlet] by repeating the values for both polarisations. """ - assert arr.shape == (constants.MAX_INPUTS, constants.N_beamlets_ctrl) + assert arr.shape == (constants.S_ant, constants.N_beamlets_ctrl) # Each antenna maps on [fpga_nr][input_nr][0] and [fpga_nr][input_nr][1], and we work # with [antenna][beamlet], so we have to interleave copies of the input array per beamlet diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/sst.py b/tangostationcontrol/tangostationcontrol/devices/sdp/sst.py index 0a7d7c8186d8d69d53011f2bd86b8a45ee5981bd..cc0bc9b0687166edcc5f028346b3592b67d12576 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/sst.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/sst.py @@ -100,14 +100,14 @@ class SST(Statistics): # number of packets with invalid payloads nof_payload_errors_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "nof_payload_errors"}, dims=(constants.N_pn,), datatype=numpy.uint64) # latest SSTs - sst_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "sst_values"}, dims=(constants.MAX_INPUTS, constants.N_sub), datatype=numpy.uint64) + sst_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "sst_values"}, dims=(StationSSTCollector.MAX_INPUTS, constants.N_sub), datatype=numpy.uint64) # reported timestamp # for each row in the latest SSTs - sst_timestamp_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "sst_timestamps"}, dims=(constants.MAX_INPUTS,), datatype=numpy.uint64) + sst_timestamp_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "sst_timestamps"}, dims=(StationSSTCollector.MAX_INPUTS,), datatype=numpy.uint64) # integration interval for each row in the latest SSTs - integration_interval_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "integration_intervals"}, dims=(constants.MAX_INPUTS,), datatype=numpy.float32) + integration_interval_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "integration_intervals"}, dims=(StationSSTCollector.MAX_INPUTS,), datatype=numpy.float32) # whether the subband data was calibrated by the SDP (that is, were subband weights applied) - subbands_calibrated_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "subbands_calibrated"}, dims=(constants.MAX_INPUTS,), datatype=bool) + subbands_calibrated_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "subbands_calibrated"}, dims=(StationSSTCollector.MAX_INPUTS,), datatype=bool) # ---------- # Summarising Attributes