Added example for single selector
This commit is contained in:
parent
0f6f293090
commit
8c246af1b5
@ -6,19 +6,38 @@ 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/"
|
||||
path_to_sim = (
|
||||
"/data/skloth/sim/silica_pore/tip4p2005/D3_L6_S4.9_R0/T300_isochor/T250_nvt_short"
|
||||
)
|
||||
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=100, skip=0.1
|
||||
)
|
||||
time, result_wall = md.correlation.shifted_correlation(
|
||||
partial(md.correlation.isf, q=22.7),
|
||||
oxygen_water,
|
||||
segments=10,
|
||||
skip=0.1
|
||||
)
|
||||
selector=partial(md.coordinates.selector_radial_cylindrical, r_min=1.0, r_max=1.5),
|
||||
segments=100,
|
||||
skip=0.1,
|
||||
)
|
||||
time, result_center = md.correlation.shifted_correlation(
|
||||
partial(md.correlation.isf, q=22.7),
|
||||
oxygen_water,
|
||||
selector=partial(md.coordinates.selector_radial_cylindrical, r_min=0.0, r_max=0.5),
|
||||
segments=100,
|
||||
skip=0.1,
|
||||
)
|
||||
|
||||
plt.figure()
|
||||
plt.plot(time, result_all)
|
||||
plt.plot(time, result_all, "k-", label="all")
|
||||
plt.plot(time, result_wall, "r.", label="wall")
|
||||
plt.plot(time, result_center, "b.", label="center")
|
||||
plt.legend()
|
||||
plt.xscale("log")
|
||||
plt.xlabel(r"$t$ / ps")
|
||||
plt.ylabel(r"S_q(t)")
|
||||
plt.savefig(f"{data_dir}/selector.png", dpi=300, bbox_inches="tight")
|
||||
plt.show()
|
||||
|
Loading…
x
Reference in New Issue
Block a user