From 08680b527a23bcb6746d07ea4f6e72ee76eb3c1a Mon Sep 17 00:00:00 2001 From: Daniel van der Schuur <schuur@astron.nl> Date: Fri, 21 Nov 2014 12:54:15 +0000 Subject: [PATCH] -Printing channel amplitudes. --- .../dsp/correlator/tb/python/tc_correlator.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/libraries/dsp/correlator/tb/python/tc_correlator.py b/libraries/dsp/correlator/tb/python/tc_correlator.py index 6dc2bb0c2c..d897a8d174 100644 --- a/libraries/dsp/correlator/tb/python/tc_correlator.py +++ b/libraries/dsp/correlator/tb/python/tc_correlator.py @@ -64,6 +64,7 @@ data = transpose(data) for sample_nr in range(NOF_TIMESAMPLES): mat_list = [] + amplitudes = [] for channel_nr in range(NOF_CHANNELS): ############################################################################### # Convert the unsigned words to complex @@ -80,14 +81,16 @@ for sample_nr in range(NOF_TIMESAMPLES): ############################################################################### for index,word in enumerate(channel_data): channel_data[index] = complex_binomial_to_phasor(word) - + ############################################################################### - # Extract the phases from the complex data + # Extract the phases and amplitudes from the complex data ############################################################################### phases = [] + for word in channel_data: + amplitudes.append(word[0]) phases.append(word[1]) - + ################################################################################ # Re-shape the flat list into a matrix ################################################################################ @@ -97,6 +100,11 @@ for sample_nr in range(NOF_TIMESAMPLES): ################################################################################ # re-shape the flat list of 64 matrices into a an 8*8 matrix of matrices, plot ################################################################################ + print 'Plotting phases of timesample %d, %d channels.' %(sample_nr,NOF_CHANNELS) + print '. Channel amplitudes:' + for channel_nr in range(NOF_CHANNELS): + print ' .', channel_nr, ' - ', amplitudes[channel_nr] + mat_mat = split_list(mat_list, 8) plot_matrix_color(mat_mat) -- GitLab