diff --git a/libhreels/HREELS.py b/libhreels/HREELS.py index e68634da0d3bc10fefba0391af321c332e0eea23..6778f2efbf87582983a5018fcce58ecf54931366 100644 --- a/libhreels/HREELS.py +++ b/libhreels/HREELS.py @@ -65,16 +65,20 @@ def HREELS_elog_Dictionary(file, path): class HREELS: """This class handles HREELS data and their plotting. """ path = "\\\\backup-ep3\\BackUp02\\0_experiments\\EELS-PC4\HREELS\\gph_dat\\" - pathSav = "\\\\backup-ep3\\BackUp02\\0_experiments\\EELS-PC4\HREELS\\BATCH\\sav" + pathSav = "\\\\backup-ep3\\BackUp02\\0_experiments\\EELS-PC4\HREELS\\BATCH\\sav\\" # path = "./" - def __init__(self, _filename, datapath=path, dataSav=pathSav, scan=-1): + def __init__(self, _filename, datapath=path, dataSav=" ", scan=-1): + # def __init__(self, _filename, datapath=path, dataSav=pathSav, scan=-1): global eV2cm eV2cm = 8065.6 self.maxIntensity = 1. if scan < 0: self.datapath = myPath(datapath) else: - self.datapath = myPath(dataSav) + if dataSav == " ": + self.datapath = myPath(datapath+"..\\BATCH\\sav\\") + else: + self.datapath = myPath(dataSav) print('Directory {} is used to access individual scans.'.format(dataSav)) _filename += '.{:03.0f}'.format(scan) print('File {} is used.'.format(_filename)) diff --git a/libhreels/ViewAuger.py b/libhreels/ViewAuger.py index 47d32c0f9ee479bc0088e36c58c4452580bea62b..7e02fa08d99e954d02ab31c4fa4e0addcff5ceaf 100644 --- a/libhreels/ViewAuger.py +++ b/libhreels/ViewAuger.py @@ -17,8 +17,8 @@ hhPath = hh.__path__[0] from libhreels.Auger import Auger # fix HighRes Displays -QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True) -QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True) +# QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True) +# QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True) class Auger_Window(QtWidgets.QMainWindow): diff --git a/libhreels/ViewHREELS.py b/libhreels/ViewHREELS.py index 4fdca545149a14b03a58056de7b5566b831cb7a1..abcc8120d6a86bc05939a60ee157c6de64a5621d 100644 --- a/libhreels/ViewHREELS.py +++ b/libhreels/ViewHREELS.py @@ -19,8 +19,8 @@ import argparse import libhreels.NoExpLogbook as lgb # fix HighRes Displays -QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True) -QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True) +# QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True) +# QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True) class HREELS_Window(QtWidgets.QMainWindow): """ fill in some initial data """ diff --git a/libhreels/calcHREELS.py b/libhreels/calcHREELS.py index 948c8597fd25d64e4efff08f4ccfe09536de581b..5bdd9e936f91cdd6cc9f8bd3b9136537f980a865 100644 --- a/libhreels/calcHREELS.py +++ b/libhreels/calcHREELS.py @@ -53,10 +53,14 @@ def importMaterials(string='', path=libDir): def addDrude(wPlasma, gPlasma, material): - ''' Adds a Drude response and returns a dictionary with all phonon parameters for the material provided - as 3rd argument. + ''' Adds a simple Drude response to the materials properties (which are provided + as 3rd argument) and returns a new materials dictionary with all phonon parameters. Note + that at least the eps_infinity has to given before. ''' newMaterial = deepcopy(material) + # To select the Drude response, the Lambin Fortran code requires a negative first oscillator frequency + # which is then interpreted as plasma frequency. + # The values of the former LO parameter are irrelevant (but need to be provided). try: if len(newMaterial['wTO']) > 0: newMaterial['wTO'] += [-1*wPlasma] @@ -167,9 +171,10 @@ def myMain(): film1 = lambin(film=[[oxide,d],[substrate,1000.]]) # xs, spectrum = film1.calcSurfaceLoss(x) xs, spectrum = film1.calcHREELS(x, normalized=True) - plt.plot(xs,spectrum, label=d) + plt.plot(xs,spectrum, label='{:.0f}'.format(d)) plt.ylabel('HREELS Intensity') plt.xlabel('Energy Loss (cm$^{-1}$)') + plt.legend(title='Thickness in ($\AA$)') plt.show() if __name__ == '__main__': diff --git a/libhreels/dielectrics.py b/libhreels/dielectrics.py index 38c49ec625a806823176f021e278dadff1cc5c78..5a98d6798f5fcbf630e2f2ff7f77963a98afbc1e 100644 --- a/libhreels/dielectrics.py +++ b/libhreels/dielectrics.py @@ -76,25 +76,37 @@ class simpleOsci(oscillator): return nom/denom class drude: + '''Returns the additive Drude response with plasma frequency and damping as parameters. Note that for the + full dielctric response, this Drude contribution has to be added to eps_infinity and any phonon + contribution. + ''' def __init__(self, wPL, gamma): self.wPL = wPL self.gamma = gamma def eps(self,w): - return 1. - (self.wPL*self.wPL)/(w*w - 1j*self.gamma*w) + # Starting from libhreels version 1.1.4, it has been corrected: + return -(self.wPL*self.wPL)/(w*w - 1j*self.gamma*w) + def __call__(self, w): return self.eps(w) class drude2: - '''This defines an additive Drude component to a dielectric function: - eps_drude = drude2(omega_p, gamma_p, gamma_0) - ... eps(omega) + eps_drude(omega) + '''Returns the additive extended Drude response with three arguments: plasma frequency and two damping + parameters. The first damping parameter is the plasma damping and the second the damping at frequency + zero. Note that for the full dielectric response, this Drude contribution has to be added to eps_infinity + and any phonon contribution. + + eps = drude2(omega_p, gamma_p, gamma_0) ''' - def __init__(self, omega_p, gamma_p, gamma_0): + def __init__(self, omega_p, gamma_p, gamma_0=None): self.omega_p = omega_p self.gamma_p = gamma_p - self.gamma_0 = gamma_0 + if gamma_0: + self.gamma_0 = gamma_0 + else: + self.gamma_0 = gamma_p def eps(self,w): newW = np.where(w==0, 0.000567894, w) # Avoid zeros to avoid devision by zero @@ -114,12 +126,14 @@ def myMain(): oscis = [simpleOsci(TO, Q, f*TO) for (TO, Q, f) in data] - x = np.linspace(0,1000,num=1200) + x = np.linspace(5,1000,num=1200) epsInfinity = 5.25 eps = epsInfinity for each in oscis: eps += each(x) + # Now add Drude contribution: + eps += drude2(1200,60)(x) plotDielectrics(x, eps) if __name__ == '__main__': diff --git a/libhreels/mod_doeels.mod b/libhreels/mod_doeels.mod index da9db7080b19394948d95c96b304783a21845be8..221c658ae96d0bbceb9a3785c8fc2508c6090133 100644 Binary files a/libhreels/mod_doeels.mod and b/libhreels/mod_doeels.mod differ diff --git a/pyproject.toml b/pyproject.toml index e48a3f6f92cabefd8e9554a3532d1f10bdfd2ca2..1ca0fd6a3f0437fc1f30079dfeac138ccb5d0569 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "libhreels" -version = "1.1.3" +version = "1.1.4" description = "Handling, simulating, and plotting HREELS and Auger spectroscopy data" authors = ["Wolf Widdra <wolf.widdra@physik.uni-halle.de>"] include = ["*./libhreels/*"]