Skip to content

Commit

Permalink
Add ModeInspector.plot_ppation_base which serves as the base plotting…
Browse files Browse the repository at this point in the history
… function for participation ratios

Should be used by the other ppation plotting method.
  • Loading branch information
ajkerr0 committed Dec 10, 2016
1 parent e954849 commit 5b1a01a
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions kappa/conductivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,31 @@ def tcond(self):
def plot_mode(self, evec_index):

from .plot import normal_modes
normal_modes(self.mol, self.evec[:self.N, evec_index])
normal_modes(self.mol, self.evec[1][:self.N, evec_index])

def plot_ppation_base(self, indices):

val = self.evec[0][indices]
vec = self.evec[1][:self.N,indices]

num = np.sum((vec**2), axis=0)**2
den = len(vec)*np.sum(vec**4, axis=0)

fig = plt.figure()

plt.plot(val, num/den, 'bo')

fig.suptitle("Val vs p-ratio of selected modes")

plt.show()

def plot_ppation(self):

kappa, kappaList, val, vec = self.tcond()

pprint.pprint(kappaList)

N = len(self.mol.posList)

vec = vec[:N,:]
vec = vec[:self.N,:]

num = np.sum((vec**2), axis=0)**2
den = len(vec)*np.sum(vec**4, axis=0)
Expand Down Expand Up @@ -233,6 +247,7 @@ def plot_contrib_mode(self, kappa_index):

dict_ = self.kappaList[kappa_index]
sigma, tau = dict_['sigma'], dict_['tau']
print(sigma, tau)

self.plot_mode(sigma)
self.plot_mode(tau)
Expand Down

0 comments on commit 5b1a01a

Please sign in to comment.