Skip to content

Commit

Permalink
More comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JaGeo committed Dec 15, 2017
1 parent a9b0011 commit 603d446
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions IRDipoleApprox/IR.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self,PoscarName='POSCAR',BornFileName='BORN',ForceConstants=False,F
This class was also carefully compared to the results of the script by D. Karhanek available at http://homepage.univie.ac.at/david.karhanek/downloads.html
Args:
args:
PoscarNamse (str): name of the POSCAR that was used for the phonon calculation
BornFileName (str): name of the file with BORN charges (formatted with outcar-born)
ForceConstants (boolean): If True, ForceConstants are read in. If False, forces are read in.
Expand Down Expand Up @@ -314,15 +314,13 @@ def __write_file_yaml(self,filename,spectrum):
file.close()










def plot_spectrum(self,filename):
"""
Plots frequencies in cm-1 and oscillator strengths
args:
filename(str): name of the file
"""
spectrum=self.get_spectrum()
plt.stem(spectrum['Frequencies'].tolist(),spectrum['Intensities'].tolist(), markerfmt=' ')
plt.xlabel('Wave number (cm$^{-1}$)')
Expand All @@ -331,6 +329,12 @@ def plot_spectrum(self,filename):
plt.show()

def plot_gaussiansmearedspectrum(self,filename,sigma):
"""
Plots frequencies in cm-1 and smeared oscillator strengths
args:
filename(str): name of the file
sigma(float): smearing
"""
spectrum=self.get_gaussiansmearedspectrum(sigma)
plt.plot(spectrum['Frequencies'].tolist(),spectrum['Intensities'].tolist())
plt.xlabel('Wave number (cm$^{-1}$)')
Expand Down

0 comments on commit 603d446

Please sign in to comment.