diff --git a/tangostationcontrol/tangostationcontrol/common/constants.py b/tangostationcontrol/tangostationcontrol/common/constants.py index 69dc7c2f435838fc620b90d7491ca36732ed3397..b78fc592ab23a702b9ff1d0b75af438306b53f85 100644 --- a/tangostationcontrol/tangostationcontrol/common/constants.py +++ b/tangostationcontrol/tangostationcontrol/common/constants.py @@ -6,7 +6,6 @@ class constants: A good source for a good chunk of the constants can be found here: https://support.astron.nl/confluence/display/L2M/L2+STAT+Decision%3A+SC+-+SDP+OPC-UA+interface """ - # TODO FIX # number of dual polarization antennas in the band. N_ant = 48 @@ -16,12 +15,10 @@ class constants: # number of polarisations per antenna (X and y polarisations) N_pol = 2 - # TODO FIX # Single polarization signal inputs ( N_ant * N_pol) S_ant = 96 # number of polarisations for beamforming - # TODO: this is used alongside N_pol, but its not clear to me whats the difference N_pol_bf = 2 # antennas per FPGA @@ -40,48 +37,51 @@ class constants: # number of RCU's per subrack N_rcu = 32 + # Number of antenna inputs per RCU + N_rcu_inp = 3 + # number of hops that the data of the stream has traveled to reach the BSN aligner on this node P_sum = 2 # the number of square correlator cells produced per FPGA for XST's (P_sq := N_pn // 2 + 1) P_sq = 9 + # total number of beamsets N_beamsets_sdp = 2 + # number of beamsets we control N_beamsets_ctrl = 1 # The maximum amount of beamlets the SDP (and we) support N_beamlets_max = 976 # number of actively controlled beamlets N_beamlets_ctrl = 488 - N_beamlets_out = 488 # Maximum number of subbands we support N_sub = 512 # Number of points per subband - N_fft = 1024 - - # Maximum array size to allocate for beam_device pointings, - MAX_POINTINGS = 1024 + N_sub_pts = 1024 # Maximum number of antenna inputs we support (used to determine array sizes) MAX_INPUTS = 192 + + + # main clock frequency's are 200MHz and 160MHz + CLK_200 = 200_000_000 + CLK_160 = 160_000_000 + + # Maximum number of subbands for which we collect XSTs simultaneously MAX_PARALLEL_SUBBANDS = 8 # Expected block for XST's BLOCK_LENGTH = 12 - # Complex values are (real, imag). A bit silly, but we don't want magical + # Complex values are (real, imag). VALUES_PER_COMPLEX = 2 # Max blocks for the BST statistics - MAX_BLOCKS = 2 + BST_MAX_BLOCKS = 2 + # number of sockets the psoc has PSOC_SOCKETS = 8 - # main clock frequency of the subrack is 200MHz NOTE: type is a float here - CLK_200 = 200_000_000 - CLK_160 = 160_000_000 - - # default subband we use because of its low RFI - DEFAULT_SUBBAND = 102 # UNB2 constants # number of uniboards in a subrack @@ -93,6 +93,18 @@ class constants: # number of QSFP tranceivers per uniboard N_qsfp = 24 + # the three spatial dimensions XYZ used a lot for pointing directions and ITRF coordinates. + N_xyz = 3 + # number of values for latitude/longitude coordinates + N_coord = 2 + + + # default subband we use because of its low RFI + DEFAULT_SUBBAND = 102 + + # Maximum array size to allocate for beam_device pointings, + MAX_POINTINGS = 1024 + # max size for a statistic packet MAX_PACKET_SIZE = 9000 @@ -108,11 +120,6 @@ class constants: # The default polling period for polled attributes DEFAULT_POLLING_PERIOD = 1000 - # the three spatial dimensions XYZ used a lot for pointing directions and ITRF coordinates. - N_xyz = 3 - # number of values for latitude/longitude coordinates - N_coord = 2 - """ These classes for now exist for future use diff --git a/tangostationcontrol/tangostationcontrol/devices/recv.py b/tangostationcontrol/tangostationcontrol/devices/recv.py index e2af04031106819c05fd6d6009c4d2061ea0b1b9..7d7cba44c2f8da666a6c8f8c5db780cf47b0cfeb 100644 --- a/tangostationcontrol/tangostationcontrol/devices/recv.py +++ b/tangostationcontrol/tangostationcontrol/devices/recv.py @@ -226,7 +226,7 @@ class RECV(opcua_device): return (self.read_attribute("ANT_mask_RW") & ( self.alarm_val("RCU_PWR_ANT_VIN_R") | self.alarm_val("RCU_PWR_ANT_VOUT_R") - )).reshape(constants.N_rcu,3).any(axis=1) | (self.read_attribute("RCU_mask_RW") & ( + )).reshape(constants.N_rcu,constants.N_rcu_inp).any(axis=1) | (self.read_attribute("RCU_mask_RW") & ( self.alarm_val("RCU_PWR_1V8_R") | self.alarm_val("RCU_PWR_2V5_R") | self.alarm_val("RCU_PWR_3V3_R") diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py b/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py index e86bd456220b85c2d2b3e3124e873e6a729929f4..63486ef8edb947292b929929baf06265371b4b8a 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py @@ -293,7 +293,7 @@ class Beamlet(opcua_device): def _subband_frequencies(subbands: numpy.ndarray, clock: int, nyquist_zone: int) -> numpy.ndarray: """ Obtain the frequencies of each subband, given a clock and an antenna type. """ - subband_width = clock / constants.N_fft + subband_width = clock / constants.N_sub_pts base_subband = nyquist_zone * constants.N_sub # broadcast clock across frequencies diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/bst.py b/tangostationcontrol/tangostationcontrol/devices/sdp/bst.py index 016fa9c16adc5cba577f654fca11cc11916b7263..3636ea25c548fdb41058abc6a48049ddd86bee4e 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/bst.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/bst.py @@ -88,10 +88,10 @@ class BST(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 BSTs - bst_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "bst_values"}, dims=(constants.MAX_BLOCKS, constants.N_beamlets_max), datatype=numpy.uint64) + bst_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "bst_values"}, dims=(constants.BST_MAX_BLOCKS, constants.N_beamlets_max), datatype=numpy.uint64) # reported timestamp # for each row in the latest BSTs - bst_timestamp_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "bst_timestamps"}, dims=(constants.MAX_BLOCKS,), datatype=numpy.uint64) + bst_timestamp_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "bst_timestamps"}, dims=(constants.BST_MAX_BLOCKS,), datatype=numpy.uint64) # ---------- # Summarising Attributes diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py b/tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py index 4ede62a8c8e7042d3916abdd70b9f0b182d16baa..e1c742d2e47c27d8f605b806d5061e3ac24d815c 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py @@ -76,7 +76,7 @@ class SDP(opcua_device): dtype='DevVarDoubleArray', mandatory=False, # Emit a signal on subband 102 - default_value=[[constants.DEFAULT_SUBBAND * float(constants.CLK_200) / constants.N_fft] * S_pn] * N_pn + default_value=[[constants.DEFAULT_SUBBAND * float(constants.CLK_200) / constants.N_sub_pts] * S_pn] * N_pn ) FPGA_wg_phase_RW_default = device_property(