diff --git a/applications/apertif/commissioning/tests/verify_correlator_db_output.py b/applications/apertif/commissioning/tests/verify_correlator_db_output.py index 78f7798b959dcbeedfa36f843b0f345438a6da0b..46eca974d48cfdb4103305fb975eb20e7b9fef8a 100644 --- a/applications/apertif/commissioning/tests/verify_correlator_db_output.py +++ b/applications/apertif/commissioning/tests/verify_correlator_db_output.py @@ -100,10 +100,19 @@ corrPacketInfo = apr.CorrelatorPacketInfo(N_vis) # One or more beamlet and channel indices to select the visibility packets beamlets = tc.beamlets +if not cm.exist_all_elements_from_a_in_b(beamlets, range(M_blk)): + tc.append_log(tc.V_ERRORS, 'Specified --beamlets %s must fit in range(%d)' % (tc.beamlets, M_blk)) + tc.set_result('FAILED') + sys.exit() + channels = tc.channels +if not cm.exist_all_elements_from_a_in_b(channels, range(N_chan_x)): + tc.append_log(tc.V_ERRORS, 'Specified --channels %s must fit in range(%d)' % (tc.channels, N_chan_x)) + tc.set_result('FAILED') + sys.exit() tc.append_log(3, '>>>') -tc.append_log(1, '>>> Title : Test case to verify visibility packet header in correlator DB OUTPUT for %s' % tc.unb_nodes_string()) +tc.append_log(1, '>>> Title : Test case to verify visibility packet header and zero/non-zero payload of correlator DB OUTPUT for %s' % tc.unb_nodes_string()) tc.append_log(3, '>>> . beamlet(s) : %s (from range(M_blk) = [0:%d])' % (beamlets, M_blk-1)) tc.append_log(3, '>>> . channel(s) : %s (from range(N_chan_x) = [0:%d])' % (channels, N_chan_x-1)) tc.append_log(3, '>>>') @@ -306,7 +315,14 @@ for bui in beamlets: nonZeroTp = apr.tp_pairs_to_active_tp(nonZeroTpPairs) nonZeroDishes = apr.tp_to_dish_indices(nonZeroTp) nonZeroPolarizations = apr.tp_to_pol_indices(nonZeroTp) - tc.append_log(tc.V_INFO, reportStr + 'Non zero TP = %s : polarizations = %s and dishes = %s' % (nonZeroTp, nonZeroPolarizations, nonZeroDishes)) + + # 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: + tc.append_log(tc.V_INFO_DETAILS, reportStr + 'Non zero TP = %s : polarizations = %s and dishes = %s are OK' % (nonZeroTp, nonZeroPolarizations, nonZeroDishes)) + else: + tc.append_log(tc.V_ERRORS, reportStr + 'Non zero TP are wrong (read %s != %s expected)' % (nonZeroTp, activeTp)) + tc.set_result('FAILED') ###############################################################################