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

Added verify that auto correlation visibilities are > 0 and real.

parent c9a96b8c
No related branches found
No related tags found
No related merge requests found
...@@ -302,10 +302,11 @@ for bui in beamlets: ...@@ -302,10 +302,11 @@ for bui in beamlets:
rdVisibilities = [] rdVisibilities = []
even = True even = True
for data in rdPayload: for data in rdPayload:
dataNtoh = cm.reverse_word(data) # change endianess
if even: if even:
visReal = cm.to_signed(data, 32) visReal = cm.to_signed(dataNtoh, 32)
else: else:
visImag = cm.to_signed(data, 32) visImag = cm.to_signed(dataNtoh, 32)
rdVisibilities.append(complex(visReal, visImag)) rdVisibilities.append(complex(visReal, visImag))
even = not even even = not even
...@@ -315,15 +316,31 @@ for bui in beamlets: ...@@ -315,15 +316,31 @@ for bui in beamlets:
nonZeroTp = apr.tp_pairs_to_active_tp(nonZeroTpPairs) nonZeroTp = apr.tp_pairs_to_active_tp(nonZeroTpPairs)
nonZeroDishes = apr.tp_to_dish_indices(nonZeroTp) nonZeroDishes = apr.tp_to_dish_indices(nonZeroTp)
nonZeroPolarizations = apr.tp_to_pol_indices(nonZeroTp) nonZeroPolarizations = apr.tp_to_pol_indices(nonZeroTp)
nonZeroAutoVisibilities = apr.get_auto_visibilities(nonZeroTp)
# Assume the BF weights have been set to select at least one ADC input per CB then the input (sky) noise at the ADC # Verify that the active TP yield non-zero visibilities
# will contribute to all channels, so the visibilities for the TP pairs of active TP will then be none zero. # . Assume the BF weights have been set to select at least one ADC input per CB then the input (sky) noise at the ADC
# will contribute to all channels, so the visibilities for the TP pairs of active TP will then be none zero.
if activeTp == nonZeroTp: if activeTp == nonZeroTp:
tc.append_log(tc.V_INFO_DETAILS, reportStr + 'Non zero TP = %s : polarizations = %s and dishes = %s are OK' % (nonZeroTp, nonZeroPolarizations, nonZeroDishes)) tc.append_log(tc.V_INFO_DETAILS, reportStr + 'Non zero TP = %s : polarizations = %s and dishes = %s are OK' % (nonZeroTp, nonZeroPolarizations, nonZeroDishes))
else: else:
tc.append_log(tc.V_ERRORS, reportStr + 'Non zero TP are wrong (read %s != %s expected)' % (nonZeroTp, activeTp)) tc.append_log(tc.V_ERRORS, reportStr + 'Non zero TP are wrong (read %s != %s expected)' % (nonZeroTp, activeTp))
tc.set_result('FAILED') tc.set_result('FAILED')
# Verify that the auto correlation visibilities for the active TP are real and > 0
atpFail = []
for ai in nonZeroAutoVisibilities:
atp2 = apr.visibilities_to_tp_pairs(ai)
atp = atp2[0][0] # get tp from list with one tuple(tp, tp), both tp in tuple are the same index for auto correlation visibility
if not (rdVisibilities[ai].real>0 and rdVisibilities[ai].imag==0):
atpFail.append(atp)
#print ai, atp2, atp, rdVisibilities[ai]
if len(atpFail)==0:
tc.append_log(tc.V_INFO_DETAILS, reportStr + 'Auto correlation for TP = %s : polarizations = %s and dishes = %s are OK' % (nonZeroTp, nonZeroPolarizations, nonZeroDishes))
else:
tc.append_log(tc.V_ERRORS, reportStr + 'Auto correlation for TP = %s : polarizations = %s and dishes = %s are wrong' % (atpFail, apr.tp_to_pol_indices(tpFail), apr.tp_to_pol_indices(tpFail)))
tc.set_result('FAILED')
############################################################################### ###############################################################################
# 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