Skip to content
Snippets Groups Projects
Commit 603a594f authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Added rdPayload and derived nonZeroTp from that.

parent e3997c7b
No related branches found
No related tags found
No related merge requests found
...@@ -37,12 +37,14 @@ ...@@ -37,12 +37,14 @@
# -v 0, 1, 2 or 3 for regression test # -v 0, 1, 2 or 3 for regression test
# At central correlator verify expected result via DB # At central correlator verify expected result via DB
> python $RADIOHDL/applications/apertif/commissioning/main.py --app apertif-dev --tel a --pol 0,1 --unb 0,1
> python $RADIOHDL/applications/apertif/commissioning/tests/verify_correlator_db_output.py -v 3 --tel a --unb 0 --fn 0:3 --bn 0:3 --beamlets 0 --channels 0 > python $RADIOHDL/applications/apertif/commissioning/tests/verify_correlator_db_output.py -v 3 --tel a --unb 0 --fn 0:3 --bn 0:3 --beamlets 0 --channels 0
""" """
############################################################################### ###############################################################################
# System imports # System imports
import sys import sys
import operator
import common as cm import common as cm
import test_case import test_case
import node_io import node_io
...@@ -269,7 +271,13 @@ for bui in beamlets: ...@@ -269,7 +271,13 @@ for bui in beamlets:
################################################################### ###################################################################
# Verify payload data # Verify payload data
#
# A visibility packet contains all N_vis = 300 visibilities for one (beamlet, channel):
# - The visibilities for which at least one TP is inactive must be zero, because for those TP the
# firmware forces the data to zero.
# - If both TP in a visibility are active, then the visibility can be non-zero. The visibility
# can still be zero if the BF weights for the corresponding beamlet are zero.
#
# Visibility (col, row) indices for # Visibility (col, row) indices for
# 0 vis (0,0) # 0 vis (0,0)
# 1 vis (0,1) 24 vis (1,1) # 1 vis (0,1) 24 vis (1,1)
...@@ -280,9 +288,22 @@ for bui in beamlets: ...@@ -280,9 +288,22 @@ for bui in beamlets:
# #
# 24 + 23 + 22 ... + 1 = 300 visibilities # 24 + 23 + 22 ... + 1 = 300 visibilities
# #
# The visibilities are stored in two 32b words: real, imag, so in total 600 words. # The visibilities are stored in two 32b words: real, imag, so in total 600 words payload.
# rdPayload = rdData[corrPacketInfo.vis_header_size:corrPacketInfo.vis_header_size+N_vis*cm.c_nof_complex]
# rdVisibilities = []
even = True
for data in rdPayload:
if even:
visReal = cm.to_signed(data)
else:
visImag = cm.to_signed(data)
rdVisibilities.append(complex(visReal, visImag))
# Find the TP for all read visibilities that are non-zero
nonZeroVisibilities = cm.find_indices_where_value_ne(rdVisibilities, 0)
nonZeroTpPairs = visibilities_to_tp_pairs(nonZeroVisibilities)
nonZeroTp = tp_pairs_to_active_tp(tpPairs)
tc.append_log(tc.V_INFO_DETAILS, reportStr + 'Non zero TP = %s' % nonZeroTp)
############################################################################### ###############################################################################
# End # End
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment