From 5f0ba53d82979d02a3be1c8f55ae7c124efe5409 Mon Sep 17 00:00:00 2001 From: Stefano Di Frischia <stefano.difrischia@inaf.it> Date: Fri, 4 Aug 2023 07:55:30 +0000 Subject: [PATCH] Align BST dimensions with latest update in lofar-station-client 0.15.6 --- tangostationcontrol/requirements.txt | 2 +- .../tangostationcontrol/common/constants.py | 5 +++-- .../tangostationcontrol/devices/sdp/bst.py | 22 ++++++++++++++----- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/tangostationcontrol/requirements.txt b/tangostationcontrol/requirements.txt index 7bbe91f55..69d5381d6 100644 --- a/tangostationcontrol/requirements.txt +++ b/tangostationcontrol/requirements.txt @@ -2,7 +2,7 @@ # order of appearance. Changing the order has an impact on the overall # integration process, which may cause wedges in the gate later. -lofar-station-client@git+https://git.astron.nl/lofar2.0/lofar-station-client +lofar-station-client@git+https://git.astron.nl/lofar2.0/lofar-station-client # Apache 2 PyTango>=9.4.2 # LGPL v3 numpy>=1.21.6 # BSD3 asyncua >= 0.9.90 # LGPLv3 diff --git a/tangostationcontrol/tangostationcontrol/common/constants.py b/tangostationcontrol/tangostationcontrol/common/constants.py index 8ac862a38..8f13c57dd 100644 --- a/tangostationcontrol/tangostationcontrol/common/constants.py +++ b/tangostationcontrol/tangostationcontrol/common/constants.py @@ -41,7 +41,7 @@ N_beamsets_max = 2 # number of beamsets we control N_beamsets_ctrl = 1 # The maximum amount of beamlets the SDP (and we) support -N_beamlets_max = 976 +N_beamlets_max = 488 # number of actively controlled beamlets N_beamlets_ctrl = 488 @@ -61,7 +61,8 @@ BLOCK_LENGTH = 12 # Complex values are (real, imag). VALUES_PER_COMPLEX = 2 # Max blocks for the BST statistics -BST_MAX_BLOCKS = 2 +# We support only one beamset for now, to avoid unnecessary explosion of the matrices +MAX_BEAMSETS = 1 # Expected number of blocks: enough to cover all baselines without the conjugates (that is, the top-left triangle of the matrix). MAX_BLOCKS = nr_baselines(MAX_INPUTS // BLOCK_LENGTH) diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/bst.py b/tangostationcontrol/tangostationcontrol/devices/sdp/bst.py index 48f0c19e5..cafa419d5 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/bst.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/bst.py @@ -13,7 +13,11 @@ from tango.server import device_property, attribute from tangostationcontrol.clients.opcua_client import OPCUAConnection from tangostationcontrol.clients.statistics.client import StatisticsClient -from tangostationcontrol.common.constants import N_pn, BST_MAX_BLOCKS, N_beamlets_max +from tangostationcontrol.common.constants import ( + N_pn, + N_beamlets_max, + N_pol, +) # Own imports from tangostationcontrol.common.entrypoint import entry @@ -148,16 +152,24 @@ class BST(Statistics): bst_R = AttributeWrapper( comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "bst_values"}, - dims=(BST_MAX_BLOCKS, N_beamlets_max), + dims=(N_beamlets_max, N_pol), datatype=numpy.uint64, ) # reported timestamp - # for each row in the latest BSTs + # from each FPGA in the latest BSTs bst_timestamp_R = AttributeWrapper( comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "bst_timestamps"}, - dims=(BST_MAX_BLOCKS,), - datatype=numpy.uint64, + dims=(N_pn,), + datatype=numpy.float32, + ) + # reported integration interval + # from each FPGA in the latest BSTs + bst_integration_interval_R = AttributeWrapper( + comms_id=StatisticsClient, + comms_annotation={"type": "statistics", "parameter": "integration_intervals"}, + dims=(N_pn,), + datatype=numpy.float32, ) # ---------- -- GitLab