In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import openpathsampling as paths
import numpy as np
In [2]:
%%time
storage = paths.AnalysisStorage('mstis_data.nc')
Analyze the rate with no snapshots present in the analyzed file
In [3]:
mstis = storage.networks.load(0)
In [4]:
mstis.hist_args['max_lambda'] = { 'bin_width' : 0.02, 'bin_range' : (0.0, 0.5) }
mstis.hist_args['pathlength'] = { 'bin_width' : 5, 'bin_range' : (0, 150) }
In [5]:
%%time
mstis.rate_matrix(storage.steps, force=True)
Out[5]:
In [6]:
scheme = storage.schemes[0]
In [7]:
scheme.move_summary(storage.steps)
In [8]:
import openpathsampling.visualize as vis
reload(vis)
from IPython.display import SVG
In [9]:
tree = vis.PathTree(
storage.steps[0:200],
vis.ReplicaEvolution(replica=2, accepted=False)
)
SVG(tree.svg())
Out[9]:
In [10]:
decorrelated = tree.generator.decorrelated
print "We have " + str(len(decorrelated)) + " decorrelated trajectories."
In [11]:
from toy_plot_helpers import ToyPlot
background = ToyPlot()
background.contour_range = np.arange(-1.5, 1.0, 0.1)
background.add_pes(storage.engines[0].pes)
In [12]:
xval = paths.FunctionCV("xval", lambda snap : snap.xyz[0][0])
yval = paths.FunctionCV("yval", lambda snap : snap.xyz[0][1])
live_vis = paths.StepVisualizer2D(mstis, xval, yval, [-1.0, 1.0], [-1.0, 1.0])
live_vis.background = background.plot()
to make this work we need the actual snapshot coordinates! These are not present in the data file anymore so we attach the traj as a fallback. We are not using analysis storage since we do not cache anything.
In [14]:
storage.cvs
Out[14]:
In [13]:
fallback = paths.Storage('mstis_traj.nc', 'r')
In [14]:
storage.fallback = fallback
In [15]:
live_vis.draw_samples(list(tree.samples))
Out[15]:
In [ ]: