In [1]:
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
from scipy.interpolate import griddata
In [3]:
%matplotlib inline
#STRIDE 500!!
#read the data in from a text file
fesdata = np.genfromtxt('fes.dat',comments='#');
dim1=985
dim2=986
fesdata = fesdata[:,0:3]
enertokcal=4.184
#some post-processing to be compatible with contourf
X=np.reshape(fesdata[:,0],[dim1,dim2],order="F") #order F was 20% faster than A/C
Y=np.reshape(fesdata[:,1],[dim1,dim2],order="F")
Z=np.reshape((fesdata[:,2]-np.min(fesdata[:,2]))/enertokcal,[dim1,dim2],order="F") #convert to kcal/mol
#what spacing do you want?
spacer=1.0
lines=10 #this goes to 80 kcal/mol (2*40)
levels=np.linspace(0,lines*spacer,num=(lines+1),endpoint=True)
fig=plt.figure(figsize=(10,8))
axes = fig.add_subplot(111)
plt.contourf(X, Y, Z, levels, cmap=plt.cm.bone,)
plt.colorbar()
plt.xlabel('$d1$')
plt.ylabel('$d2$')
axes.set_ylim([.1,.5])
axes.set_xlim([0.1,0.5])
plt.rcParams.update({'font.size': 18})
plt.show()
In [3]:
%matplotlib inline
#STRIDE 1K!!
#read the data in from a text file
fesdata = np.genfromtxt('fes_1K.dat',comments='#');
dim1=985
dim2=985
fesdata = fesdata[:,0:3]
enertokcal=4.184
#some post-processing to be compatible with contourf
X=np.reshape(fesdata[:,0],[dim1,dim2],order="F") #order F was 20% faster than A/C
Y=np.reshape(fesdata[:,1],[dim1,dim2],order="F")
Z=np.reshape((fesdata[:,2]-np.min(fesdata[:,2]))/enertokcal,[dim1,dim2],order="F") #convert to kcal/mol
#what spacing do you want?
spacer=1.0
lines=10 #this goes to 80 kcal/mol (2*40)
levels=np.linspace(0,lines*spacer,num=(lines+1),endpoint=True)
fig=plt.figure(figsize=(10,8))
axes = fig.add_subplot(111)
plt.contourf(X, Y, Z, levels, cmap=plt.cm.bone,)
plt.colorbar()
plt.xlabel('$d1$')
plt.ylabel('$d2$')
axes.set_ylim([.1,.5])
axes.set_xlim([0.1,0.5])
plt.rcParams.update({'font.size': 12})
plt.show()
In [6]:
%matplotlib inline
#STRIDE 1K!!
#read the data in from a text file
fesdata = np.genfromtxt('fes_20K.dat',comments='#');
dim1=972
dim2=974
fesdata = fesdata[:,0:3]
enertokcal=4.184
#some post-processing to be compatible with contourf
X=np.reshape(fesdata[:,0],[dim1,dim2],order="F") #order F was 20% faster than A/C
Y=np.reshape(fesdata[:,1],[dim1,dim2],order="F")
Z=np.reshape((fesdata[:,2]-np.min(fesdata[:,2]))/enertokcal,[dim1,dim2],order="F") #convert to kcal/mol
#what spacing do you want?
spacer=1.0
lines=10 #this goes to 80 kcal/mol (2*40)
levels=np.linspace(0,lines*spacer,num=(lines+1),endpoint=True)
fig=plt.figure(figsize=(10,8))
axes = fig.add_subplot(111)
plt.contourf(X, Y, Z, levels, cmap=plt.cm.bone,)
plt.colorbar()
plt.xlabel('$d1$')
plt.ylabel('$d2$')
axes.set_ylim([.1,.5])
axes.set_xlim([0.1,0.5])
plt.rcParams.update({'font.size': 12})
plt.show()
In [3]:
%matplotlib inline
#read the data in from a text file
fesdata = np.genfromtxt('rew_avg.dat',comments='#');
dim1=200
dim2=200
fesdata = fesdata[:,0:3]
enertokcal=1.0
#some post-processing to be compatible with contourf
X=np.reshape(fesdata[:,0],[dim1,dim2],order="F") #order F was 20% faster than A/C
Y=np.reshape(fesdata[:,1],[dim1,dim2],order="F")
Z=np.reshape((fesdata[:,2]-np.min(fesdata[:,2]))/enertokcal,[dim1,dim2],order="F") #convert to kcal/mol
#what spacing do you want?
spacer=1.
lines=10 #this goes to 80 kcal/mol (2*40)
levels=np.linspace(0,lines*spacer,num=(lines+1),endpoint=True)
fig=plt.figure(figsize=(10,8))
axes = fig.add_subplot(111)
plt.contourf(X, Y, Z, levels, cmap=plt.cm.bone,)
plt.colorbar()
plt.xlabel('$d1$')
plt.ylabel('$d2$')
axes.set_ylim([.1,.5])
axes.set_xlim([0.1,0.5])
plt.rcParams.update({'font.size': 12})
plt.show()
In [4]:
#read the data in from a text file
fesdata = np.genfromtxt('G09.PES.dat',comments='#');
dim1=39
dim2=39
fesdata = fesdata[:,0:3]
enertokcal=1.0
#some post-processing to be compatible with contourf
X=np.reshape(fesdata[:,0]/10.0,[dim1,dim2],order="F") #order F was 20% faster than A/C
Y=np.reshape(fesdata[:,1]/10.0,[dim1,dim2],order="F")
Z=np.reshape((fesdata[:,2]-np.min(fesdata[:,2]))/enertokcal,[dim1,dim2],order="F") #convert to kcal/mol
#what spacing do you want?
spacer=1.
lines=10 #this goes to 80 kcal/mol (2*40)
levels=np.linspace(0,lines*spacer,num=(lines+1),endpoint=True)
fig=plt.figure(figsize=(10,8))
axes = fig.add_subplot(111)
plt.contourf(X, Y, Z, levels, cmap=plt.cm.bone,)
plt.colorbar()
plt.xlabel('$d1$')
plt.ylabel('$d2$')
axes.set_ylim([.1,.5])
axes.set_xlim([0.1,0.5])
plt.rcParams.update({'font.size': 12})
plt.show()
In [3]:
##THIS IS THE PES FROM GAUSSIAN
fesdata = np.genfromtxt('G09.PES.dat',comments='#');
sig=.05
method='cubic'
newxr=np.arange(fesdata[:,0].min()+.1,fesdata[:,0].max(),sig)
newyr=np.arange(fesdata[:,1].min()+.1,fesdata[:,1].max(),sig)
Xnew,Ynew=np.meshgrid(newxr,newyr)
Znew=griddata(fesdata[:,:2],fesdata[:,2]-np.min(fesdata[:,2]),(Xnew, Ynew),method=method)
%matplotlib inline
#what spacing do you want?
spacer=1.
lines=10 #this goes to 80 kcal/mol (2*40)
levels=np.linspace(0,lines*spacer,num=(lines+1),endpoint=True)
fig=plt.figure(figsize=(10,8))
axes = fig.add_subplot(111)
plt.contourf(Xnew/10.0, Ynew/10.0, Znew, levels, cmap=plt.cm.bone,)
plt.colorbar()
plt.xlabel('$d1$')
plt.ylabel('$d2$')
axes.set_ylim([.1,.5])
axes.set_xlim([0.1,0.5])
plt.rcParams.update({'font.size': 12})
plt.show()
In [4]:
##THIS IS THE PES FROM REWEIGHT
fesdata = np.genfromtxt('rew_avg.dat',comments='#');
sig=.05
method='cubic'
#newxr=np.arange(fesdata[:,0].min(),fesdata[:,0].max(),sig)
#newyr=np.arange(fesdata[:,1].min(),fesdata[:,1].max(),sig)
#Xnew2,Ynew2=np.meshgrid(newxr,newyr)
Znew2=griddata(fesdata[:,:2],fesdata[:,2]-np.min(fesdata[:,2]),(Xnew/10.0, Ynew/10.0),method=method)
#what spacing do you want?
spacer=1.
lines=10 #this goes to 80 kcal/mol (2*40)
levels=np.linspace(0,lines*spacer,num=(lines+1),endpoint=True)
fig=plt.figure(figsize=(10,8))
axes = fig.add_subplot(111)
plt.contourf(Xnew/10.0, Ynew/10.0, Znew2, levels, cmap=plt.cm.bone,)
plt.colorbar()
plt.xlabel('$d1$')
plt.ylabel('$d2$')
axes.set_ylim([.1,.5])
axes.set_xlim([0.1,0.5])
plt.rcParams.update({'font.size': 12})
plt.show()
In [6]:
##THIS IS THE PES FROM REWEIGHT
#what spacing do you want?
spacer=.1
lines=10.0 #this goes to 80 kcal/mol (2*40)
levels=np.linspace(0,lines*spacer,num=(lines+1),endpoint=True)
fig=plt.figure(figsize=(10,8))
axes = fig.add_subplot(111)
plt.contourf(Xnew/10.0, Ynew/10.0, np.abs(Znew-Znew2), levels, cmap=plt.cm.bone,)
plt.colorbar()
plt.xlabel('$d1$')
plt.ylabel('$d2$')
axes.set_ylim([.1,.5])
axes.set_xlim([0.1,0.5])
plt.rcParams.update({'font.size': 12})
plt.show()
In [22]:
def saddle(A):
#returns coordinates of saddles in A maximum in rows, minimum in columns """
S = []
for i in range(0,A.shape[0]):
max = A[i,0]; maxcol = 0;
for j in range(1,A.shape[1]):
if(A[i,j] > max):
max = A[i,j]; maxcol = j
is_saddle = True
for k in range(0,A.shape[0]):
if(k != i):
if(A[k,maxcol] < max):
is_saddle = False; break
if is_saddle:
S.append((i,maxcol));
return S
In [23]:
S=saddle(Znew-Znew.min())
In [24]:
print S
In [6]:
#read the data in from a text file
%matplotlib inline
fesdata = np.genfromtxt('G09BLYP.PES.dat',comments='#');
dim1=39
dim2=39
fesdata = fesdata[:,0:3]
enertokcal=1.0
#some post-processing to be compatible with contourf
X=np.reshape(fesdata[:,0]/10.0,[dim1,dim2],order="F") #order F was 20% faster than A/C
Y=np.reshape(fesdata[:,1]/10.0,[dim1,dim2],order="F")
Z=np.reshape((fesdata[:,2]-np.min(fesdata[:,2]))/enertokcal,[dim1,dim2],order="F") #convert to kcal/mol
#what spacing do you want?
spacer=1.
lines=5 #this goes to 80 kcal/mol (2*40)
levels=np.linspace(0,lines*spacer,num=(lines+1),endpoint=True)
fig=plt.figure(figsize=(10,8))
axes = fig.add_subplot(111)
plt.contourf(X, Y, Z, levels, cmap=plt.cm.bone,)
plt.colorbar()
plt.xlabel('$d1$')
plt.ylabel('$d2$')
axes.set_ylim([.1,.6])
axes.set_xlim([0.1,0.6])
plt.rcParams.update({'font.size': 12})
plt.show()
In [ ]: