From add1fe5f8cdd16969f94d23cfa87aa4ccbe33310 Mon Sep 17 00:00:00 2001 From: Sebastian Kloth Date: Fri, 19 Jan 2024 17:12:39 +0100 Subject: [PATCH] Started selector example --- examples/selector.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 examples/selector.py diff --git a/examples/selector.py b/examples/selector.py new file mode 100644 index 0000000..ef7e295 --- /dev/null +++ b/examples/selector.py @@ -0,0 +1,24 @@ +from functools import partial + +import matplotlib.pyplot as plt +from matplotlib import cm + +import mdevaluate as md + +data_dir = "/data/skloth/python_packages/mdevaluate_examples/plots" +path_to_sim = "/data/skloth/sim/silica_pore/tip4p2005/D3_L6_S4.9_R0/T300_isochor/" +trajectory = md.open(path_to_sim, topology="run.tpr", trajectory="out/traj_full.xtc") + +oxygen_water = trajectory.subset(atom_name="OW", residue_name="SOL") + +time, result_all = md.correlation.shifted_correlation( + partial(md.correlation.isf, q=22.7), + oxygen_water, + segments=10, + skip=0.1 + ) + +plt.figure() +plt.plot(time, result_all) +plt.xscale("log") +plt.savefig(f"{data_dir}/selector.png", dpi=300, bbox_inches="tight")