total, lags, visibility, phase_fit, m, c) = correlator.get_correlation() baseline = left, right logger.debug('received baseline %s' % repr(baseline)) except NoCorrelations: widget.after(1, update_plots, widget, baselines) return # it never comes to this if baseline not in baselines.keys(): corr.axes.grid() #corr.axes.set_xlabel('Lag', size='large') #corr.axes.set_ylabel('Correlation Function', size='large') phase_line = corr.plot(f, angle(visibility), '%so' % colors[current%len(colors)], linewidth=1, label=repr(baseline))[0] fit_line = corr.plot(f, real(phase_fit), '%s-' % colors[current%len(colors)], linewidth=1, label=None)[0] baselines[baseline] = phase_line, fit_line else: corr.axes.legend() phase_line, fit_line = baselines[baseline] corr.update_line(phase_line, f, angle(visibility)) corr.update_line(fit_line, f, real(phase_fit)) if current == total-1: widget.update() logger.info('update in') widget.after_idle(update_plots, widget, baselines) root.update() root.geometry(frame.winfo_geometry()) root.after_idle(update_plots, root, {}) root.deiconify() root.mainloop()
lags_line, phase_line, fit_line, phist_line, mag_line = baselines[baseline] lags.update_line(lags_line, l, abs(lag/norm)) corr.update_line(phase_line, f, phases) corr.update_line(fit_line, f, phase_fit) hist.update_line(phist_line, datetime.fromtimestamp(corr_time), phase) maghist.update_line(mag_line, datetime.fromtimestamp(corr_time), 10*log10(abs(lag/norm).max())) status = statusbar[baseline] mean = 100*abs(lag).mean()/(2**31) span = 100.*(abs(lag).max() - abs(lag).min())/(2**31) try: snr = 10*log10(abs(lag).max() / abs(lag).mean()) except ZeroDivisionError: snr = inf status.set(u"{0}-{1} SNR {2:.2f} \u03b4{3:.2f} \u2220{4:.2f}\u00b0".format(left, right, snr, delay, phase*(180/pi))) #logger.info('{0}-{1} >> phase={2:8.2f}deg, mean/span={3:.2f}/{4:.2f}'.format(left, right, phase*(180/pi), mean, span)) if current == total-1: widget.update() #root.geometry(window.winfo_geometry()) #root.deiconify() #logger.info('update in') widget.after_idle(update_plots, widget, baselines, statusbar) root.update() root.geometry(window.winfo_geometry()) root.after_idle(update_plots, root, {}, {}) root.deiconify() root.mainloop()