In [1]:
%matplotlib notebook

In [2]:
import os, sys
sys.path.append(os.path.abspath('../../main/python'))

In [3]:
import thalesians.tsa.filtering.visual as vis
import thalesians.tsa.pypes as pypes

In [4]:
import matplotlib.pyplot as plt

In [5]:
pype = pypes.Pype(pypes.Direction.INCOMING, name='FILTER', port=5758)

In [6]:
kwargs = {'min_refresh_interval': 0.5, 'pad_bottom': 0.05, 'pad_top': 0.05}
fig = plt.figure(figsize=(8, 10))
ax = fig.add_subplot(9, 1, 1)
prior_state_plot = vis.StatePlot(fig=fig, ax=ax, is_posterior=False, **kwargs)
ax = fig.add_subplot(9, 1, 2)
posterior_state_plot = vis.StatePlot(fig=fig, ax=ax, is_posterior=True, **kwargs)
ax = fig.add_subplot(9, 1, 3)
error_plot = vis.ErrorPlot(fig=fig, ax=ax, is_posterior=True, **kwargs)
ax = fig.add_subplot(9, 1, 4)
rmse_plot = vis.ErrorPlot(fig=fig, ax=ax, is_posterior=True, rmse=True, **kwargs)
ax = fig.add_subplot(9, 1, 5)
obs_plot = vis.ObsPlot(fig=fig, ax=ax, **kwargs)
ax = fig.add_subplot(9, 1, 6)
innov_plot = vis.InnovPlot(fig=fig, ax=ax, **kwargs)
ax = fig.add_subplot(9, 1, 7)
cusum_plot = vis.CUSUMPlot(fig=fig, ax=ax, **kwargs)
ax = fig.add_subplot(9, 1, 8)
log_likelihood_plot = vis.LogLikelihoodPlot(fig=fig, ax=ax, **kwargs)
ax = fig.add_subplot(9, 1, 9)
gain_plot = vis.GainPlot(fig=fig, ax=ax, **kwargs)
for x in pype:
    prior_state_plot.process_filter_object(x)
    posterior_state_plot.process_filter_object(x)
    error_plot.process_filter_object(x)
    rmse_plot.process_filter_object(x)
    obs_plot.process_filter_object(x)
    innov_plot.process_filter_object(x)
    cusum_plot.process_filter_object(x)
    log_likelihood_plot.process_filter_object(x)
    gain_plot.process_filter_object(x)
prior_state_plot.refresh(force=True)
posterior_state_plot.refresh(force=True)
error_plot.refresh(force=True)
rmse_plot.refresh(force=True)
obs_plot.refresh(force=True)
innov_plot.refresh(force=True)
log_likelihood_plot.refresh(force=True)
gain_plot.refresh(force=True)