This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dummy gro file for velocity error | |
1 | |
1FOO foo 9328 3.064 2.394 6.775-10.3772 -0.2281 2.8391 | |
5.70000 3.41000 34.06000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d = np.linspace(0, 2, num=10000) | |
A = 1 - 2 /np.pi * ((1 - d/2)*np.sqrt(d - d**2/4) + np.arctan((1-d/2)/(np.sqrt(d-d**2/4)))) | |
fig, axes = plt.subplots(1, 3, figsize = (16, 3)) | |
axes[0].plot(d/2, A) | |
axes[0].grid() | |
axes[1].plot(d/2, np.gradient(A, d/2)) | |
axes[2].plot(d/2, np.gradient(np.gradient(A, d/2), d/2)) | |
for ax in axes: | |
ax.set_xlim(0, 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
histo = np.loadtxt('histo.xvg', comments=['#', '@']) | |
x_values = histo[:, 0] | |
plt.figure(figsize=(10, 4)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def find_nearest(distances, val): | |
idx = (np.abs(distances[:, 1] - val)).argmin() | |
return distances[idx, 0] | |
spacing = 0.05 | |
distances = np.loadtxt('distance_summary.dat') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
#@setup_pdf | |
# | |
read | |
stru frozen_500ps.stru | |
# pound is a comment before and ! for comments after | |
#can use this section to change B_iso values | |
#b[1] = 1.5000 !r[203] !H | |
#b[2] = 0.9000 !r[204] !O | |
#b[3] = 0.4000 !r[205] !Ti |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import mdtraj as md | |
import pdb | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
from mdtraj.geometry.order import _compute_director | |
from matplotlib.colors import normalize | |
def cat_angle(A, B, C): | |
a = (B[:,:,1]-A[:,:,1])*(C[:,:,2]-A[:,:,2])-(C[:,:,1]-A[:,:,1])*(B[:,:,2]-A[:,:,2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 | |
0 1 0 1 0 0 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 0 1 0 1 0 0 1 1 0 0 0 1 | |
0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 | |
0 1 0 1 0 0 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 0 1 0 1 0 0 1 1 0 0 0 1 | |
0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 | |
1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 | |
0 1 0 1 0 0 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 0 1 0 1 0 0 1 1 0 0 0 1 | |
0 1 0 1 0 0 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 0 1 0 1 0 0 1 1 0 0 0 1 | |
1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 | |
0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def _atoi(text): | |
return int(text) if text.isdigit() else text | |
def natural_sort(text): | |
return [_atoi(a) for a in re.split(r'(\d+)', text)] | |
lst = ['mxene_001g', 'mxene_002', 'mxene_003', 'mxene_004', 'mxene_005', 'opls_753', 'opls_754', 'opls_755', 'opls_759'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import numpy as np | |
composition = [1/3, 1/3, 1/3] | |
sites = np.zeros(shape=(300,)) | |
val_1 = composition[2] + composition[1] |
OlderNewer