devices.rst

Devices
RECV
The recv == Device("LTS/RECV/1")
device controls the RCUs, the LBA antennas, and HBA tiles. Central to its operation are the masks:
- The
RCU_mask_RW
attribute is an array ofbool[N_RCUs]
. It controls which RCUs will actually be configured, when fields referring to RCUs are set. Any RCU for which the mask is False will not be configured when RCU control points are set. - The
Ant_mask_RW
attribute is an array ofbool[N_RCUs][N_Antennas_per_RCU]
. It controls which antennas will actually be configured, when fields referring to antennas are set. Any antenna for which the mask is False will not be configured when antenna control points are set.
Typically, N_RCUs == 32
, and N_Antennas_per_RCU == 3
.
SST and XST
The sst == Device("LTS/SST/1")
and xst == Device("LTS/XST/1")
devices manages the SSTs (subband statistics) and XSTs (crosslet statistics), respectively. The statistics are emitted piece-wise through UDP packets by the FPGAs on the Uniboards in SDP. By default, each device configures the statistics to be streamed to itself (the device), from where the user can obtain them.
The statistics are exposed in two ways, as:
- Attributes, representing the most recently received values,
- TCP stream, to allow the capture and recording of the statistics over any period of time.
SST Statistics attributes
The SSTs represent the amplitude of the signal in each subband, for each antenna, as an integer value. They are exposed through the following attributes:
sst_R: |
Amplitude of each subband, from each antenna.
|
||
---|---|---|---|
sst_timestamp_R: |
Timestamp of the data, per antenna.
|
||
integration_interval_R: |
Timespan over which the SSTs were integrated, per antenna.
|
||
subbands_calibrated_R: |
Whether the subband data was calibrated using the subband weights.
|
Typically, N_ant == 192
, and N_subbands == 512
.
XST Statistics attributes
The XSTs represent the cross-correlations between each pair of antennas, as complex values. The phases and amplitudes of the XSTs represent the phase and amplitude difference between the antennas, respectively. They are exposed as a matrix xst[a][b]
, of which only the triangle a<=b
is filled, as the cross-correlation between antenna pairs (b,a)
is equal to the complex conjugate of the cross-correlation of (a,b)
. The other triangle contains incidental values, but will be mostly 0.
Complex values which cannot be represented in Tango attributes. Instead, the XST matrix is exposed as both their carthesian and polar parts:
xst_power_R, xst_phase_R: |
Amplitude and phase of the crosslet statistics.
|
||
---|---|---|---|
xst_real_R, xst_imag_R: |
Real and imaginary parts of the crosslet statistics.
|
||
xst_blocks_R: |
Blocks of crosslet statistics, as received from the FPGA (see below).
|
||
xst_timestamp_R: |
Timestamp of each block.
|
||
integration_interval_R: |
Timespan over which the XSTs were integrated, for each block.
|
Typically, N_ant == 192
.
The metadata refers to the blocks, which are emitted by the FPGAs to represent the XSTs between 12 x 12 antennas. The following code converts block numbers to the indices of the first antenna pair in a block:
from common.baselines import baseline_from_index
def first_antenna_pair(block_nr: int) -> int:
coarse_a, coarse_b = baseline_from_index(block_nr)
return (coarse_a * 12, coarse_b * 12)
Conversely, to calculate the block index for an antenna pair (a,b)
, use:
from common.baselines import baseline_index
def block_nr(a: int, b: int) -> int:
return baseline_index(a / 12, b / 12)
The block_size
is equal to the number of antennas, times two for the real and imaginary parts (stored consecutively), so 12*12*2
.
TCP stream
The TCP stream interface allows a user to subscribe to the statistics packet streams, combined into a single TCP stream. To do so, simply connect to the following port:
Device | TCP end point |
---|---|
SST | localhost:5101 |
XST | localhost:5102 |
The easiest way to capture this stream is to use our statistics_writer
, which will capture the statistics and store them in HDF5 file(s): the writer recognised packet boundaries, converts the packets into their respective matrix, and store a matrix for each received timestamp. Furthermore, packet header information is periodically recorded as HDF5 attributes:
cd devices/statistics_writer
python3 statistics_writer.py --mode SST --host localhost
The correct port will automatically be chosen, depending on the given mode. See also statistics_writer.py -h
for more information.
The writer can also parse a statistics stream stored in a file, so the stream can be captured and processed later using the writer. Capturing the stream could be done using netcat
:
nc localhost 5101 > SST-packets.bin
Performance monitoring
All statistics expose attributes that provide general statistics about the data received. The counters are set to 0 when the device is initialised:
last_packet_timestamp_R: |
Timestamp of the last received packets.
|
||
---|---|---|---|
nof_packets_received_R: |
Number of UDP packets received.
|
||
nof_bytes_received_R: |
Number of bytes received (sum of UDP payload sizes).
|
||
nof_packets_dropped_R: |
Number of packets dropped because processing was overloaded.
|
||
nof_invalid_packets_R: |
Number of packets dropped because their header is invalid.
|
||
nof_payload_errors_R: |
Number of packets marked as having an invalid payload, per FPGA.
|
||
nof_valid_payloads_R: |
Number of valid packets with valid payloads received, per FPGA.
|
Note that nominally:
nof_packets_received_R = nof_packets_dropped_R
+ nof_invalid_packets_R
+ sum(nof_payload_errors_R)
+ sum(nof_valid_payloads_R)