Skip to content
Snippets Groups Projects
Commit fdf174f4 authored by Wolf Widdra's avatar Wolf Widdra
Browse files

modified fortran code for extended Drude

parent e3db4459
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,7 @@ if not (sys.version.startswith('3.6') or sys.version.startswith('3.8')):
try:
from libhreels import myEels2 as LambinEELS # wrapper for myEels2.f90
from libhreels import myBoson as LambinBoson # wrapper for myBoson.f90
from libhreels import myEels3 as LambinEELS3 # wrapper for myEels3.f90
except:
print('myEels2 and MyBoson are not available here (Check your version)')
......@@ -61,6 +62,9 @@ def addDrude(wPlasma, gPlasma, 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).
if not wPlasma > 0:
print('Cannot add Drude to material',material)
return material
try:
if len(newMaterial['wTO']) > 0:
newMaterial['wTO'] += [-1*wPlasma]
......@@ -139,6 +143,25 @@ class lambin:
i += 1
return wn_array[i-1:], loss_array[i-1:]
def calcSurfaceLoss3(self,x):
''' Calculate the surface loss spectrum for the array of x, which needs to be an equidistant array.
All parameters are defined in the class __init__() call.'''
wmin = min(x)
wmax = max(x)-0.001
dw = (wmax-wmin)/(len(x)-1) # assumes that x is an equidistant array
wn_array_size = len(x) # size of array for x and epsilon (wn_array, loss_array)
nper = 1.
contrl = '{:<10}'.format('None'[:10]) # Can be 'image' to include image charge
mode = '{:<10}'.format('kurosawa'[:10])
wn_array,loss_array = LambinEELS3.mod_doeels.doeels(self.e0,self.theta,self.phia,self.phib,
wmin,wmax,dw,self.layers,self.neps,nper,self.name,
self.thick,self.epsinf,self.listNOsci,self.osc,contrl,mode,wn_array_size)
i=0
for item in wn_array:
if item > 0: break
i += 1
return wn_array[i-1:], loss_array[i-1:]
def calcHREELS(self,x, normalized=True):
emin = min(x)
emax = max(x)-0.001
......@@ -161,6 +184,14 @@ class lambin:
epsArray.append(yn)
return np.transpose(np.array(epsArray))
def calcEps3(self, x):
epsArray = []
nOsci = len(self.wOsc)
for wn in x:
yn = LambinEELS3.mod_doeels.seteps(self.listNOsci,nOsci,self.osc,self.epsinf,wn,self.layers)
epsArray.append(yn)
return np.transpose(np.array(epsArray))
####################################################################################
def myMain():
import matplotlib.pyplot as plt
......
No preview for this file type
File added
This diff is collapsed.
[tool.poetry]
name = "libhreels"
version = "1.1.4"
version = "1.2.0"
description = "Handling, simulating, and plotting HREELS and Auger spectroscopy data"
authors = ["Wolf Widdra <wolf.widdra@physik.uni-halle.de>"]
include = ["*./libhreels/*"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment