Skip to content
Snippets Groups Projects
Commit 3e91cdc5 authored by Taya Snijder's avatar Taya Snijder
Browse files

small changes and removed unused imports

parent ace79082
No related branches found
No related tags found
1 merge request!465added constants.py and replaced most magic numbers
...@@ -15,7 +15,6 @@ from tangostationcontrol.clients.comms_client import AsyncCommClient ...@@ -15,7 +15,6 @@ from tangostationcontrol.clients.comms_client import AsyncCommClient
from tangostationcontrol.clients.tcp_replicator import TCPReplicator from tangostationcontrol.clients.tcp_replicator import TCPReplicator
from tangostationcontrol.clients.udp_receiver import UDPReceiver from tangostationcontrol.clients.udp_receiver import UDPReceiver
from tangostationcontrol.clients.statistics.consumer import StatisticsConsumer from tangostationcontrol.clients.statistics.consumer import StatisticsConsumer
from tangostationcontrol.common.constants import constants
logger = logging.getLogger() logger = logging.getLogger()
......
from tangostationcontrol.common.baselines import nr_baselines
class constants: class constants:
...@@ -53,7 +54,6 @@ class constants: ...@@ -53,7 +54,6 @@ class constants:
CLK_200_MHZ = 200_000_000 CLK_200_MHZ = 200_000_000
CLK_160_MHZ = 160_000_000 CLK_160_MHZ = 160_000_000
# Maximum number of subbands for which we collect XSTs simultaneously # Maximum number of subbands for which we collect XSTs simultaneously
MAX_PARALLEL_SUBBANDS = 8 MAX_PARALLEL_SUBBANDS = 8
# Expected block for XST's # Expected block for XST's
...@@ -62,7 +62,8 @@ class constants: ...@@ -62,7 +62,8 @@ class constants:
VALUES_PER_COMPLEX = 2 VALUES_PER_COMPLEX = 2
# Max blocks for the BST statistics # Max blocks for the BST statistics
BST_MAX_BLOCKS = 2 BST_MAX_BLOCKS = 2
# 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)
# UNB2 constants # UNB2 constants
# number of uniboards in a subrack # number of uniboards in a subrack
......
...@@ -27,7 +27,6 @@ from tangostationcontrol.devices.device_decorators import only_in_states ...@@ -27,7 +27,6 @@ from tangostationcontrol.devices.device_decorators import only_in_states
from tangostationcontrol.common.entrypoint import entry from tangostationcontrol.common.entrypoint import entry
from tangostationcontrol.common.lofar_logging import device_logging_to_python, log_exceptions from tangostationcontrol.common.lofar_logging import device_logging_to_python, log_exceptions
from tangostationcontrol.common.states import OPERATIONAL_STATES from tangostationcontrol.common.states import OPERATIONAL_STATES
from tangostationcontrol.common.constants import constants
from tangostationcontrol.devices.lofar_device import lofar_device from tangostationcontrol.devices.lofar_device import lofar_device
import logging import logging
......
...@@ -153,7 +153,7 @@ class XST(Statistics): ...@@ -153,7 +153,7 @@ class XST(Statistics):
# number of packets with invalid payloads # 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) 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 XSTs # latest XSTs
xst_blocks_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "xst_blocks", "reshape": True}, dims=(constants.MAX_PARALLEL_SUBBANDS, XSTCollector.MAX_BLOCKS, constants.BLOCK_LENGTH, constants.BLOCK_LENGTH, constants.VALUES_PER_COMPLEX), datatype=numpy.int64) xst_blocks_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "xst_blocks", "reshape": True}, dims=(constants.MAX_PARALLEL_SUBBANDS, constants.MAX_BLOCKS, constants.BLOCK_LENGTH, constants.BLOCK_LENGTH, constants.VALUES_PER_COMPLEX), datatype=numpy.int64)
# whether the values in the block are conjugated and transposed # whether the values in the block are conjugated and transposed
xst_conjugated_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "xst_conjugated", "reshape": True}, dims=(constants.MAX_PARALLEL_SUBBANDS, XSTCollector.MAX_BLOCKS), datatype=bool) xst_conjugated_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "statistics", "parameter": "xst_conjugated", "reshape": True}, dims=(constants.MAX_PARALLEL_SUBBANDS, XSTCollector.MAX_BLOCKS), datatype=bool)
# reported timestamp for each subband in the latest XSTs # reported timestamp for each subband in the latest XSTs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment