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

dielectrics bulk loss corrected

parent 1de008e6
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@ import sys
import matplotlib.pyplot as plt
import numpy as np
datapath = "./data"
# datapath = "./Examples/data"
# datapath = "./data"
datapath = "./Examples/data"
ViewHREELS.runViewer(datapath=datapath, startWithFile='c1a03')
\ No newline at end of file
__version__ = "1.0.8"
__version__ = "1.1.0"
import numpy as np
from matplotlib import pyplot as plt
def findPeriod(list, period):
'''For a list of times (relative to a sync pulse) calculate the average time deviation squared.
'''
residuum = []
sum_residuum = 0
for each in list:
r = each % period
residuum.append(r)
sum_residuum += r
av_res = sum_residuum / len(list)
deviation = 0
for res in residuum:
deviation += (res - av_res)**2
deviation /= (len(residuum)*period**2)
return deviation, av_res
def makeTimeRelative(times, durations):
list = []
synced = False
t_zero = 0
for each in pulses:
if synced:
list.append(pulses[each][0]-t_zero)
if 9000 < pulses[each][2] < 9800:
print("synced")
t_zero = pulses[each][0]
synced = True
return list
data = [] # read dat from file [[time in microsec, low duration, high duration], [...], ...]
with open("data433_Signal2.txt", 'r') as f:
for line in f:
data.append([int(each) for each in line.split(',')])
sumOn = 0; sumOff = 0
for pulse in data[1:]:
sumOn += pulse[2]
sumOff += pulse[1]
sumOn /= len(data)
sumOff /= len(data)
print("Average on and off times:", sumOn, sumOff)
......@@ -46,7 +46,7 @@ except:
class lambin:
def __init__(self, film, setup=setup, instrument=instrument):
if not sys.version.startswith('3.6'):
if not (sys.version.startswith('3.6') or sys.version.startswith('3.8')):
print('''Make sure the Fortran routines 'myEels2' and 'myBoson'
have been complied with the proper f2py3 for the right
python version!!''')
......@@ -124,7 +124,8 @@ class lambin:
emin,emax,wmin,wmax,loss_array,self.debug,len(loss_array))
if normalized:
norm = max(spectrum[:n])
return xOut[:n], spectrum[:n]/norm
# return xOut[:n], spectrum[:n]/norm
return xOut[:len(x)], spectrum[:len(x)]/norm
def calcEps(self, x):
epsArray = []
......
......@@ -18,7 +18,7 @@ def doping2surfacePlasma(doping,epsInfinity=1.):
return np.sqrt(doping)*1.8817885780819758e-06/np.sqrt(1+epsInfinity)
def loss(eps):
return -np.imag(eps)
return np.imag(1/eps)
def surfaceLoss(eps):
return np.imag(1/(1+eps))
......@@ -28,14 +28,13 @@ def reflectivity(eps): # IR reflectivity
a =np.abs((sq-1)/(sq+1))
return a*a
def sigma(eps,w): # Complex conductivity (ignored factor eps_0)
return (eps-1)*w/1j
def sigma(eps,w,eps_Infinity=1): # Complex conductivity
return np.imag((eps-eps_Infinity)*w)
def plotDielectrics(x,eps):
fig, axs = plt.subplots(3, 1, sharex=True)
axs[0].plot(x, loss(eps), label='Loss function')
axs[0].plot(x, np.real(eps), label='Re( $\epsilon (\omega )$ )')
axs[0].legend()
fig, axs = plt.subplots(3, 1, sharex=True, figsize=(6,6))
axs[0].plot(x, -np.imag(eps), label='-Im $\epsilon (\omega )$')
axs[0].plot(x, np.real(eps), label='Re $\epsilon (\omega )$') axs[0].legend()
axs[0].set_ylabel('Dielectric Function')
axs[1].plot(x, surfaceLoss(eps), lineStyle='-')
......@@ -49,7 +48,6 @@ def plotDielectrics(x,eps):
axs[0].set_xlim(left=0, right=max(x))
plt.show()
class oscillator:
def __init__(self, wTO, wLO, gammaTO=20, gammaLO=20):
self.wTO = wTO
......
This diff is collapsed.
[tool.poetry]
name = "libhreels"
version = "1.0.8"
version = "1.1.1"
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