I keep needing a python code to generate the dielectric functions of plasmonic materials such as Au, Ag, Pd, and Pt. I wanted the dielectric functions called by other python codes such as TMM. So I wrote a python version of LD.m
LD.m is a matlab file written by Bora Ung that produces dielectric functions of metals either for Lortenz and Loretnz drude models. The dielectric functions are given as follows:
The first part of the function is the Drude part and the second part is the Lorentz part. The parameters for these models are taken from Rakic et al., Optical properties of metallic films for vertical-cavity optoelectronic devices, Applied Optics (1998).
You can find my module (LD.py) and its documentation at my github account.
A typical example is shown below:
import numpy as np
lamda = np.linspace(300E-9,1000E-9,100) # Creates a wavelength vector from 300 nm to 1000 nm of length 100
gold = LD(lamda, material = 'Au',model = 'LD') # Creates gold object with dielectric function of LD model
print gold.epsilon_real # prints the real part of the epislion
print gold.epsilon_imag # prints the imag part of the epsilon
print gold.n # prints the real part of the refractive index
print gold.k # prints the imag part of the refactive index
gold.plot_epsilon() # plots wavelength vs real epilon and imag epsilon
gold.plot_n_k() # plots wavelength vs n and k .