├── LICENSE ├── README.md ├── agf2yml ├── .gitignore ├── README.md ├── agf2yml.py └── input │ ├── cdgm_2017-09.AGF │ ├── cdgm_2022-06.agf │ ├── hikari_2015.agf │ ├── hoya_2015-06-18.agf │ ├── hoya_2017-04-01.agf │ ├── nikon_2017-11.agf │ ├── ohara_2015-12-01.agf │ ├── ohara_2017-11-30.agf │ ├── schott_2015-07-22.agf │ ├── schott_2017-01-20b.agf │ └── sumita_2017-02-02.agf ├── calc └── reflection.py ├── check_db ├── README.md └── check_db.py ├── ldbb ├── README.md ├── example.py ├── example2.py └── ldbb.py └── scripts ├── Adachi 1989 - AlGaAs 0.315.py ├── Adachi 1989 - AlGaAs 0.700.py ├── Adachi 1989 - GaAs.py ├── Adachi 1989 - GaP.py ├── Adachi 1989 - GaSb.py ├── Adachi 1989 - InAs.py ├── Adachi 1989 - InGaAs.py ├── Adachi 1989 - InGaAsP.py ├── Adachi 1989 - InP.py ├── Adachi 1989 - InSb.py ├── Adachi 1990 - AlSb.py ├── Adachi 1991 - ZnSe.py ├── Adachi 1993 - CdTe.py ├── Birch 1994 - air.py ├── Bright 2012 - HfO2.py ├── Bright 2013 - Ta2O5 - amorphous.py ├── Bright 2013 - Ta2O5 - nanocrystalline.py ├── Chernova 2017 - Aux funcs.py ├── Chernova 2017 - DyScO3.py ├── Chernova 2017 - LSAT.py ├── Chernova 2017 - LaAlO3.py ├── Chernova 2017 - MAS.py ├── Chernova 2017 - MgO.py ├── Chernova 2017 - NbSrTiO3.py ├── Chernova 2017 - SrTiO3.py ├── Ciddor 1996 - air.py ├── Djurisic 1999 - Graphite-e.py ├── Djurisic 1999 - Graphite-o.py ├── Djurisic 2000 - AlSb.py ├── Djurisic 2000 - GaSb.py ├── Djurisic 2000 - InSb.py ├── Kaiser 1962 - BaF2.py ├── Kaiser 1962 - CaF2.py ├── Kaiser 1962 - SrF2.py ├── Kawashima 1997 - GaN.py ├── Kitamura 2007 - Fused silica.py ├── Le 2022 - InGaAs.py ├── Mathar 2007 - Air 1.3-2.5um.py ├── Mathar 2007 - Air 16-24um.py ├── Mathar 2007 - Air 2.8-4.2um.py ├── Mathar 2007 - Air 4.35-5.2um.py ├── Mathar 2007 - Air 7.5-14.1um.py ├── Ninomiya 1995 - CdS-e.py ├── Ninomiya 1995 - CdS-o.py ├── Ninomiya 1995 - cubic CdSe.py ├── Ninomiya 1995 - hexagonal CdSe-e.py ├── Ninomiya 1995 - hexagonal CdSe-o.py ├── Ozaki 1993 - ZnS.py ├── Ozaki 1995 - GaAs.py ├── Rakic 1996 - AlAs.py ├── Rakic 1996 - GaAs.py ├── Rakic 1998 - Ag (BB model).py ├── Rakic 1998 - Ag (LD model).py ├── Rakic 1998 - Al (BB model).py ├── Rakic 1998 - Al (LD model).py ├── Rakic 1998 - Au (BB model).py ├── Rakic 1998 - Au (LD model).py ├── Rakic 1998 - Be (BB model).py ├── Rakic 1998 - Be (LD model).py ├── Rakic 1998 - Cr (BB model).py ├── Rakic 1998 - Cr (LD model).py ├── Rakic 1998 - Cu (BB model).py ├── Rakic 1998 - Cu (LD model).py ├── Rakic 1998 - Ni (BB model).py ├── Rakic 1998 - Ni (LD model).py ├── Rakic 1998 - Pd (BB model).py ├── Rakic 1998 - Pd (LD model).py ├── Rakic 1998 - Pt (BB model).py ├── Rakic 1998 - Pt (LD model).py ├── Rakic 1998 - Ti (BB model).py ├── Rakic 1998 - Ti (LD model).py ├── Rakic 1998 - W (BB model).py ├── Rakic 1998 - W (LD model).py ├── Sato 1993 - ZnTe.py ├── Suzuki 1995 - PbSe.py ├── Synowicki 2004 - As2S3 -- IR.py ├── Synowicki 2004 - As2S3 -- UV.py ├── Synowicki 2004 - Aux funcs.py ├── Synowicki 2004 - MgO -- IR.py ├── Synowicki 2004 - MgO -- UV.py ├── Synowicki 2004 - ZrO2 -- IR.py ├── Synowicki 2004 - ZrO2 -- UV.py ├── Tsuda 2018 - PMMA (BB model).py ├── Tsuda 2018 - PMMA (LD model).py └── Zhang 1998 - Kapton.py /README.md: -------------------------------------------------------------------------------- 1 | # refractiveindex.info-scripts 2 | Collection of Python scripts related to refractiveindex.info database 3 | 4 | ## check_db 5 | Checks the integrity of the `refractiveindex.info database` 6 | 7 | ## agf2yml 8 | Converts ZEMAX `.agf` glass catalog format into `YAML` format used by the refractiveindex.info database 9 | 10 | ## ldbb 11 | Calculates optical constants of several metals 12 | 13 | # Other projects related to refractiveindex.info dtabase 14 | 15 | ## PyTMM 16 | https://github.com/kitchenknif/PyTMM 17 | 18 | Database browser and Transfer Matrix Method implementation (by Pavel Dmitriev) 19 | 20 | ## refractiveindex.info-sqlite 21 | https://github.com/HugoGuillen/refractiveindex.info-sqlite 22 | 23 | Python 3 + SQLite wrapper for the refractiveindex.info database (by Hugo Guillen) 24 | 25 | ## refractiveindex.info 26 | https://github.com/cinek810/refractiveindex.info 27 | 28 | Support for operations not possible through the web interface, e.g. find materials with refractive index within a specified range (by Marcin Stolarek) 29 | -------------------------------------------------------------------------------- /agf2yml/.gitignore: -------------------------------------------------------------------------------- 1 | *.yml 2 | -------------------------------------------------------------------------------- /agf2yml/README.md: -------------------------------------------------------------------------------- 1 | # agf2yml 2 | `agf2yml` converts a ZEMAX `.agf` file into a set of files in `YAML` format used by the refractiveindex.info database 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /calc/reflection.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Fresnel reflection calculator 3 | # (see https://en.wikipedia.org/wiki/Fresnel_equations for equations) 4 | # Author: Mikhail Polyanskiy 5 | # Last modified: 2017-11-24 6 | 7 | import numpy as np 8 | 9 | ########################## input parameters ################################### 10 | n1 = 1.0 #complex ior of first medium (1 for vacuum) 11 | n2 = 2.6332 + 3.3060j #complex ior of second medium 12 | θi = 81.0 #incidence angle (degrees) 13 | ############################################################################### 14 | 15 | θi = np.deg2rad(θi) # incidence angle (radians) 16 | θt = np.arcsin(n1/n2*np.sin(θi)) # refraction angle (radians) 17 | 18 | rs = (n1*np.cos(θi)-n2*np.cos(θt)) / (n1*np.cos(θi)+n2*np.cos(θt)) 19 | rp = (n2*np.cos(θi)-n1*np.cos(θt)) / (n1*np.cos(θt)+n2*np.cos(θi)) 20 | 21 | Rs = np.abs(rs)**2 22 | Rp = np.abs(rp)**2 23 | 24 | Φs = np.rad2deg(np.angle(rs)) 25 | Φp = np.rad2deg(np.angle(rp)) 26 | 27 | print('Rs = {:f}\nRp = {:f}\nΦs = {:f}\nΦp = {:f}'.format(Rs, Rp, Φs, Φp)) 28 | -------------------------------------------------------------------------------- /check_db/README.md: -------------------------------------------------------------------------------- 1 | # check_db 2 | The script `check_db.py` takes the `refractiveindex.info-database` root directory (`database/`), and checks if the YAML files present in its subfolders also appear in the index of `library.yml`. Also, the script checks that files in the index are present on disk. 3 | Since some YAML files appear several times in `library.yml`, the script outputs the number of files, the number of references to YAML files in the index, and the list of files that appear more than once in the library. 4 | 5 | ``` 6 | usage: check_db.py [-h] database 7 | 8 | Checks that all files on disk also appear in the index library.yml. Also 9 | checks that all files in the index have their counterpart on disk. 10 | 11 | positional arguments: 12 | database database root directory (database/) 13 | 14 | optional arguments: 15 | -h, --help show this help message and exit 16 | ``` 17 | -------------------------------------------------------------------------------- /check_db/check_db.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # coding: utf-8 3 | 4 | import argparse 5 | import yaml 6 | 7 | import os 8 | import fnmatch 9 | 10 | if __name__ == "__main__": 11 | 12 | parser = argparse.ArgumentParser(description=""" 13 | Checks that all files on disk also appear 14 | in the index catalog-nk.yml. 15 | Also checks that all files in the index 16 | have their counterpart on disk. 17 | """) 18 | parser.add_argument('database', action='store', 19 | help='database root directory (database/)') 20 | args = parser.parse_args() 21 | 22 | db_path = args.database 23 | 24 | ## List all YML files in the database, recursively. 25 | existing_files = [os.path.normpath(os.path.join(dirpath, f)) 26 | for dirpath, dirnames, files in os.walk(db_path+"/data") 27 | for f in fnmatch.filter(files, '*.yml')] 28 | 29 | listed_files = [] 30 | 31 | ################################## nk ##################################### 32 | catalog = "catalog-nk.yml" 33 | lib_path = os.path.join(db_path, catalog) 34 | library = yaml.safe_load(open(lib_path, 'r').read()) 35 | 36 | print("\nFinding data files listed in " + catalog + "\n") 37 | 38 | for shelf in library: 39 | if "SHELF" in shelf: 40 | shelf_id = shelf["SHELF"] 41 | shelf_name = shelf["name"] 42 | print(shelf_id) 43 | for book in shelf["content"]: 44 | if "BOOK" in book: 45 | book_id = book["BOOK"] 46 | book_name = book["name"] 47 | print(" "+book_id) 48 | for page in book["content"]: 49 | if "PAGE" in page: 50 | page_id = page["PAGE"] 51 | page_name = page["name"] 52 | page_data = page["data"] 53 | page_path = os.path.normpath(os.path.join(db_path, 'data', page_data)) 54 | listed_files.append(page_path) 55 | print(" " + page_id + ": " + page_data) 56 | 57 | ################################## n2 ##################################### 58 | catalog = "catalog-n2.yml" 59 | lib_path = os.path.join(db_path, catalog) 60 | library = yaml.safe_load(open(lib_path, 'r').read()) 61 | 62 | print("\nFinding data files listed in " + catalog + "\n") 63 | 64 | for shelf in library: 65 | if "SHELF" in shelf: 66 | shelf_id = shelf["SHELF"] 67 | shelf_name = shelf["name"] 68 | print(shelf_id) 69 | for book in shelf["content"]: 70 | if "BOOK" in book: 71 | book_id = book["BOOK"] 72 | book_name = book["name"] 73 | print(" "+book_id) 74 | for page in book["content"]: 75 | if "PAGE" in page: 76 | page_id = page["PAGE"] 77 | page_name = page["name"] 78 | page_data = page["data"] 79 | page_path = os.path.normpath(os.path.join(db_path, 'data', page_data)) 80 | listed_files.append(page_path) 81 | print(" " + page_id + ": " + page_data) 82 | 83 | ################################ COMPARE ################################## 84 | 85 | print("{} unique data files listed in the catalogs".format(len(set(listed_files)))) 86 | 87 | diff = set(listed_files).difference(set(existing_files)) 88 | if(len(diff)==0): 89 | print("No missing data files") 90 | else: 91 | print("Missing data files:") 92 | for path in diff: 93 | print(path) 94 | 95 | -------------------------------------------------------------------------------- /ldbb/README.md: -------------------------------------------------------------------------------- 1 | # ldbb 2 | `ldbb` is a Python script written by Aaron Webster for calculating optical constants of several metals using the Drude, Lorentz-Drude, or Brendel-Bormann models. The code is based on the paper by A. D. Rakić et al. "Optical properties of metallic films for vertical-cavity optoelectronic devices", [Appl. Opt. 37, 5271-5283 (1998)](http://dx.doi.org/10.1364/AO.37.005271) 3 | 4 | ## Files in this directory: 5 | 6 | `ldbb.py` - Returns the complex permittivity for different metals using the Drude, Lorentz-Drude, or Brendel-Bormann models. 7 | 8 | `example.py` - An example how to use ldbb.py 9 | 10 | `example2.py` - Enother example how to use ldbb.py 11 | 12 | -------------------------------------------------------------------------------- /ldbb/example.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # example of how to use ldbb.py 3 | 4 | from ldbb import LDBB 5 | from numpy import * 6 | import matplotlib.pyplot as plt 7 | 8 | # wavelength range of interest 9 | lambda0 = linspace(200e-9,2000e-9,100) 10 | epsD = LDBB('Au','D',lambda0) 11 | epsLD = LDBB('Au','LD',lambda0) 12 | epsBB = LDBB('Au','BB',lambda0) 13 | 14 | # scale wavelength for plot 15 | lambda0 = lambda0*1e6 16 | 17 | # LDBB returns permittivity, but we can easily convert it to refractive index 18 | 19 | plt.subplot(2,1,1) 20 | plt.title("Refractive Index of Au") 21 | plt.ylabel('n') 22 | plt.xlabel('wavelength (microns)') 23 | plt.plot(lambda0,real(sqrt(epsD)), label="D") 24 | plt.plot(lambda0,real(sqrt(epsBB)), label="LD") 25 | plt.plot(lambda0,real(sqrt(epsLD)), label="BB") 26 | plt.legend() 27 | 28 | plt.subplot(2,1,2) 29 | plt.ylabel('k') 30 | plt.xlabel('wavelength (microns)') 31 | plt.plot(lambda0,imag(sqrt(epsD)),label="D") 32 | plt.plot(lambda0,imag(sqrt(epsBB)),label="LD") 33 | plt.plot(lambda0,imag(sqrt(epsLD)),label="BB") 34 | plt.legend() 35 | 36 | plt.show() 37 | -------------------------------------------------------------------------------- /ldbb/example2.py: -------------------------------------------------------------------------------- 1 | ### BEGIN EXAMPLE ### 2 | #!/usr/bin/python 3 | # example of how to use ldbb.py - text version 4 | 5 | from ldbb import LDBB 6 | from numpy import * 7 | 8 | # wavelength range of interest (in meters) and number of points 9 | lambda0 = logspace(log10(0.2066e-6),log10(12.40e-6),200) 10 | #epsD = LDBB('Au','D',lambda0) 11 | #epsLD = LDBB('Au','LD',lambda0) 12 | epsBB = LDBB('Ti','BB',lambda0) 13 | 14 | 15 | # LDBB returns permittivity, but we can easily convert it to refractive index 16 | for l,e in zip(lambda0,epsBB): 17 | print(l*1e6, real(sqrt(e)), imag(sqrt(e))) 18 | 19 | ### END EXAMPLE ### 20 | -------------------------------------------------------------------------------- /scripts/Adachi 1989 - InP.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-07-08 4 | # Original data: Adachi 1989, https://doi.org/10.1063/1.343580 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | π = np.pi 9 | 10 | # model parameters 11 | E0 = 1.35 #eV 12 | Δ0 = 1.45-E0 #eV 13 | E1 = 3.10 #eV 14 | Δ1 = 3.25-E1 #eV 15 | E2 = 4.7 #eV 16 | Eg = 2.05 #eV 17 | A = 6.57 #eV**1.5 18 | B1 = 4.93 19 | B11 = 10.43 #eV**-0.5 20 | Γ = 0.10 #eV 21 | C = 1.49 22 | γ = 0.094 23 | D = 60.4 24 | εinf = 1.6 25 | 26 | def H(x): #Heviside function 27 | return 0.5 * (np.sign(x) + 1) 28 | 29 | def Epsilon_A(ħω): #E0 30 | χ0 = ħω/E0 31 | χso = ħω / (E0+Δ0) 32 | H0 = H(1-χ0) 33 | Hso = H(1-χso) 34 | fχ0 = χ0**-2 * ( 2 -(1+χ0)**0.5 - ((1-χ0)*H0)**0.5 ) 35 | fχso = χso**-2 * ( 2 - (1+χso)**0.5 - ((1-χso)*Hso)**0.5 ) 36 | H0 = H(χ0-1) 37 | Hso = H(χso-1) 38 | ε2 = A/(ħω)**2 * ( ((ħω-E0)*H0)**0.5 + 0.5*((ħω-E0-Δ0)*Hso)**0.5) 39 | ε1 = A*E0**-1.5 * (fχ0+0.5*(E0/(E0+Δ0))**1.5*fχso) 40 | return ε1 + 1j*ε2 41 | 42 | def Epsilon_B(ħω): #E1 43 | # ignoring E1+Δ1 contribution - no data on B2 & B21 in the paper 44 | χ1 = ħω/E1 45 | H1 = H(1-χ1) 46 | ε2 = π*χ1**-2*(B1-B11*((E1-ħω)*H1)**0.5) 47 | ε2 *= H(ε2) #undocumented trick: ignore negative ε2 48 | χ1 = (ħω+1j*Γ)/E1 49 | ε1 = -B1*χ1**-2*np.log(1-χ1**2) 50 | return ε1.real + 1j*ε2.real 51 | 52 | def Epsilon_C(ħω): #E2 53 | χ2 = ħω/E2 54 | ε2 = C*χ2*γ / ((1-χ2**2)**2+(χ2*γ)**2) 55 | ε1 = C*(1-χ2**2) / ((1-χ2**2)**2+(χ2*γ)**2) 56 | return ε1 + 1j*ε2 57 | 58 | def Epsilon_D(ħω): #Eg 59 | # ignoring ħωq - no data in the paper 60 | Ech = E1 61 | χg = Eg/ħω 62 | χch = ħω/Ech 63 | Hg = H(1-χg) 64 | Hch = H(1-χch) 65 | ε2 = D/ħω**2 * (ħω-Eg)**2 * Hg * Hch 66 | return 1j*ε2 67 | 68 | 69 | ev_min=0.1 70 | ev_max=6 71 | npoints=200 72 | eV = np.linspace(ev_min, ev_max, npoints) 73 | μm = 4.13566733e-1*2.99792458/eV 74 | εA = Epsilon_A(eV) 75 | εB = Epsilon_B(eV) 76 | εC = Epsilon_C(eV) 77 | εD = Epsilon_D(eV) 78 | ε = εA + εB + εC + εD + εinf 79 | n = (ε**.5).real 80 | k = (ε**.5).imag 81 | α = 4*π*k/μm*1e4 #1/cm 82 | 83 | 84 | #============================ DATA OUTPUT ================================= 85 | file = open('out.txt', 'w') 86 | for i in range(npoints-1, -1, -1): 87 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 88 | file.close() 89 | 90 | 91 | #=============================== PLOT ===================================== 92 | plt.rc('font', family='Arial', size='14') 93 | 94 | #plot ε1 vs eV 95 | plt.figure(1) 96 | plt.plot(eV, ε.real, label="ε1") 97 | plt.plot(eV, εA.real, label="Re(εA)") 98 | plt.plot(eV, εB.real, label="Re(εB)") 99 | plt.plot(eV, εC.real, label="Re(εC)") 100 | plt.xlabel('Photon energy (eV)') 101 | plt.ylabel('ε1') 102 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 103 | 104 | #plot ε2 vs eV 105 | plt.figure(2) 106 | plt.plot(eV, ε.imag, label="ε2") 107 | plt.plot(eV, εA.imag, label="Im(εA)") 108 | plt.plot(eV, εB.imag, label="Im(εB)") 109 | plt.plot(eV, εC.imag, label="Im(εC)") 110 | plt.plot(eV, εD.imag, label="Im(εD)") 111 | plt.yscale('log') 112 | plt.xlabel('Photon energy (eV)') 113 | plt.ylabel('ε2') 114 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 115 | plt.ylim([1e-2,1e2]) 116 | 117 | #plot n,k vs eV 118 | plt.figure(3) 119 | plt.plot(eV, n, label="n") 120 | plt.plot(eV, k, label="k") 121 | plt.xlabel('Photon energy (eV)') 122 | plt.ylabel('n, k') 123 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 124 | 125 | #plot n,k vs μm 126 | plt.figure(4) 127 | plt.plot(μm, n, label="n") 128 | plt.plot(μm, k, label="k") 129 | plt.xlabel('Wavelength (μm)') 130 | plt.ylabel('n, k') 131 | plt.xscale('log') 132 | plt.yscale('log') 133 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 134 | 135 | #plot α vs eV 136 | plt.figure(7) 137 | plt.plot(eV,α) 138 | plt.yscale('log') 139 | plt.ylim([1e3,1e7]) 140 | plt.xlabel('Photon energy (eV)') 141 | plt.ylabel('α (1/cm)') -------------------------------------------------------------------------------- /scripts/Adachi 1991 - ZnSe.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-09 4 | # Original data: Adachi and Taguchi 1991, https://doi.org/10.1103/PhysRevB.43.9569 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | π = np.pi 9 | 10 | # parameters from table II 11 | E0 = 2.69 #eV 12 | Δ0 = 3.10-E0 #eV 13 | G0 = 0.017 #eV 14 | A = 23.4 #eV**1.5 15 | A0x = 0.03 #eV 16 | Γ0 = 0.030 #eV 17 | 18 | E1 = 4.75 #eV 19 | Δ1 = 5.05-E1 #eV 20 | B1x = 2.31 #eV 21 | B2x = 1.16 #eV 22 | Γ1 = 0.37 #eV 23 | 24 | E2 = 6.7 #eV 25 | C = 1.6 26 | γ = 0.2 27 | 28 | ε1 = 1.2 29 | 30 | def Epsilon_A(ħω): 31 | χ0 = (ħω+1j*Γ0) / E0 32 | χs0 = (ħω+1j*Γ0) / (E0+Δ0) 33 | fχ0 = χ0**-2 * ( 2-(1+χ0)**0.5-(1-χ0)**0.5 ) 34 | fχs0 = χs0**-2 * ( 2-(1+χs0)**0.5-(1-χs0)**0.5 ) 35 | return A*E0**-1.5 * (fχ0+0.5*(E0/(E0+Δ0))**1.5*fχs0) 36 | 37 | def Epsilon_Ax(ħω): 38 | y=0 39 | for n in range(1,1000): 40 | y += A0x/n**3 * ( 1/(E0-G0/n**2-ħω-1j*Γ0) + 0.5/(E0+Δ0-G0/n**2-ħω-1j*Γ0) ) 41 | return y 42 | 43 | def Epsilon_Bx(ħω): 44 | y=0 45 | for n in range(1,1000): 46 | y += 1/(2*n-1)**3 * ( B1x/(E1-ħω-1j*Γ1) + B2x/(E1+Δ1-ħω-1j*Γ1) ) 47 | return y 48 | 49 | def Epsilon_C(ħω): 50 | χ2 = ħω/E2 51 | return C/((1-χ2**2)-1j*χ2*γ) 52 | 53 | ev_min=1.5 54 | ev_max=5.3 55 | npoints=500 56 | 57 | eV = np.linspace(ev_min, ev_max, npoints) 58 | μm = 4.13566733e-1*2.99792458/eV 59 | εA = Epsilon_A(eV) 60 | εAx = Epsilon_Ax(eV) 61 | εBx = Epsilon_Bx(eV) 62 | εC = Epsilon_C(eV) 63 | ε = εA + εAx + εBx + εC + ε1 64 | n = (ε**.5).real 65 | k = (ε**.5).imag 66 | α = 4*π*k/μm*1e4 #1/cm 67 | 68 | 69 | #============================ DATA OUTPUT ================================= 70 | file = open('out.txt', 'w') 71 | for i in range(npoints-1, -1, -1): 72 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 73 | file.close() 74 | 75 | 76 | #=============================== PLOT ===================================== 77 | plt.rc('font', family='Arial', size='14') 78 | 79 | #plot ε vs eV 80 | plt.figure(1) 81 | plt.plot(eV, ε.real, label="ε1") 82 | plt.plot(eV, ε.imag, label="ε2") 83 | plt.xlabel('Photon energy (eV)') 84 | plt.ylabel('ε') 85 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 86 | 87 | #plot intermediate data (for debugging) 88 | plt.figure(2) 89 | plt.plot(eV, εA.real, label="Re(εA)") 90 | plt.plot(eV, εAx.real, label="Re(εAx)") 91 | plt.plot(eV, εBx.real, label="Re(εBx)") 92 | plt.plot(eV, εC.real, label="Re(εC)") 93 | plt.xlabel('Photon energy (eV)') 94 | plt.ylabel('ε') 95 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 96 | 97 | plt.figure(3) 98 | plt.plot(eV, εA.imag, label="Im(εA)") 99 | plt.plot(eV, εAx.imag, label="Im(εAx)") 100 | plt.plot(eV, εBx.imag, label="Im(εBx)") 101 | plt.plot(eV, εC.imag, label="Im(εC)") 102 | plt.xlabel('Photon energy (eV)') 103 | plt.ylabel('ε') 104 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 105 | 106 | #plot n,k vs eV 107 | plt.figure(4) 108 | plt.plot(eV, n, label="n") 109 | plt.plot(eV, k, label="k") 110 | plt.xlabel('Photon energy (eV)') 111 | plt.ylabel('n, k') 112 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 113 | 114 | #plot n,k vs μm 115 | plt.figure(5) 116 | plt.plot(μm, n, label="n") 117 | plt.plot(μm, k, label="k") 118 | plt.xlabel('Wavelength (μm)') 119 | plt.ylabel('n, k') 120 | plt.yscale('log') 121 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 122 | 123 | #plot α vs eV 124 | plt.figure(6) 125 | plt.plot(eV,α) 126 | plt.yscale('log') 127 | plt.ylim([1e3,1e7]) 128 | plt.xlabel('Photon energy (eV)') 129 | plt.ylabel('α (1/cm)') -------------------------------------------------------------------------------- /scripts/Birch 1994 - air.py: -------------------------------------------------------------------------------- 1 | # Original data: Birch and Downs 1994, https://doi.org/10.1088/0026-1394/31/4/006 2 | 3 | # CHANGELOG 4 | # 2024-02-21 [aspen138] original version 5 | # 2024-03-03 [Misha Polyanskiy] minor refactoring 6 | 7 | ############################################################################### 8 | 9 | import numpy as np 10 | import matplotlib.pyplot as plt 11 | 12 | π = np.pi 13 | 14 | def n(λ, t, p, f): 15 | # λ: wavelength, 0.35 to 0.65 μm 16 | # t: temperature, °C 17 | # p: pressure, Pa 18 | # f: partial vapour pressure, Pa 19 | 20 | #esT= 6.112*1e-3*np.exp(17.62*t /(243.12+t)) # the saturation vapor pressure, using the Magnus-Tetens approximation 21 | #pv= esT*h # pressure of water vapour 22 | 23 | A = 8342.54 24 | B = 2406147 25 | C = 15998 26 | D = 96095.43 27 | E = 0.601 28 | F = 0.00972 29 | G = 0.003661 30 | 31 | ns = 1 + 1e-8 * (A + B / (130 - λ**(-2) ) + C / (38.9 - λ**(-2))) 32 | ntp=1+p*(ns-1)*(1+1e-8*(E-F*t)*p)/(1+G*t)/D 33 | n=ntp-f*(3.73345-0.0401/ (λ)**2 )*1e-10 34 | 35 | return n 36 | 37 | 38 | 39 | # output - modify code below the line to match your needs 40 | ############################################################################## 41 | 42 | # calculate n at particular conditions 43 | print("n =",n(0.633,19.526,102094.8,1065)) 44 | 45 | # write n(λ) data to a file 46 | λ = np.arange(0.35, 0.65, 0.01) 47 | n0 = n(λ,15,101325,0) # Standard air: 15 °C, 101325 Pa, dry 48 | file = open('out.txt', 'w') 49 | for i in range(0, len(λ)): 50 | file.write('\n {:.2f} {:.12f}'.format(λ[i],n0[i])) 51 | file.close() 52 | 53 | 54 | #plot n vs μm 55 | λ = np.arange(0.35, 0.65, 0.01) 56 | n1 = n(λ,15,101325,0) #dry air, 15 °C 57 | n2 = n(λ,26.85,101325,0) #dry air, 300K 58 | plt.rc('font', family='Arial', size='14') 59 | plt.figure(1) 60 | plt.plot(λ, n1-1, label="dry air, 15 °C, 101325 Pa") 61 | plt.plot(λ, n2-1, label="300K (26.75 °C)") 62 | plt.xlabel('Wavelength (μm)') 63 | plt.ylabel('n-1') 64 | plt.legend() 65 | 66 | t = np.arange(-40, 100.1, 1) 67 | n3 = n(0.6328,t,101325,0) #dry air @ HeNe wavelength 68 | plt.figure(2) 69 | plt.plot(t, n3-1, label="dry air, 101325 Pa, 632.8 nm") 70 | plt.xlabel('Temperature (°C)') 71 | plt.ylabel('n-1') 72 | plt.legend() 73 | 74 | p = np.arange(80000, 120001, 250) 75 | n4 = n(0.6328,15,p,0) #dry air, 15 ° @ HeNe wavelength 76 | plt.figure(3) 77 | plt.plot(p, n4-1, label="dry air, 15 °, 632.8 nm") 78 | plt.xlabel('Pressure (Pa)') 79 | plt.ylabel('n-1') 80 | plt.legend() 81 | 82 | f = np.arange(0, 1500, 10) 83 | n5 = n(0.6328, 15, 101325, f) #15 °C, HeNe wavelength 84 | plt.figure(4) 85 | plt.plot(f, n5-1, label="15 °, 101325 Pa, 632.8 nm") 86 | plt.xlabel('Vapour pressure (Pa)') 87 | plt.ylabel('n-1') 88 | plt.legend() 89 | 90 | plt.show() 91 | -------------------------------------------------------------------------------- /scripts/Bright 2012 - HfO2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Original data: Bright et al. 2012, https://doi.org/10.1016/j.tsf.2012.07.037 4 | 5 | # Version history 6 | # 2022-12-18 first version (Mikhail Polyanskiy) 7 | # 8 | 9 | import numpy as np 10 | import matplotlib.pyplot as plt 11 | 12 | # Model parameters 13 | A = 1.956 14 | C = 6.73e-10 #cm^2 15 | ν = [187.3, 254.9, 336.9, 402.9, 506.0, 594.8] #1/cm 16 | νp = [247.1, 373.1, 683.3, 537.8, 371.1, 118.4] #1/cm 17 | γ = [215.9, 45.1, 62.4, 56.6, 54.1, 26.2 ] #1/cm 18 | 19 | def M(η): 20 | ε = A**2 + C*η**2 + 0*1j 21 | for i in range(6): 22 | ε += νp[i]**2 / (ν[i]**2 - η**2 - 1j*γ[i]*η) 23 | return ε 24 | 25 | η_min=20 #1/cm 26 | η_max=26000 #1/cm 27 | npoints=1000 28 | η = np.logspace(np.log10(η_min), np.log10(η_max), npoints) 29 | λ = 10000/η #1/cm -> μm 30 | ε = M(η) 31 | n = (ε**.5).real 32 | k = (ε**.5).imag 33 | 34 | 35 | #============================ DATA OUTPUT ================================= 36 | file = open('out.txt', 'w') 37 | for i in range(npoints-1, -1, -1): 38 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(λ[i],n[i],k[i])) 39 | file.close() 40 | 41 | 42 | #=============================== PLOT ===================================== 43 | plt.rc('font', family='Arial', size='14') 44 | 45 | # plot n,k - Fig. 9 of the paper 46 | plt.figure(1) 47 | plt.xscale('log') 48 | plt.ylim([0,5]) 49 | plt.grid() 50 | plt.plot(η, n, label="n") 51 | plt.plot(η, k, label="k") 52 | plt.xlabel('Wavenumber (1/cm)') 53 | plt.ylabel('Optical constants') 54 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 55 | plt.show() 56 | 57 | 58 | -------------------------------------------------------------------------------- /scripts/Bright 2013 - Ta2O5 - amorphous.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-06 4 | # Original data: Bright et al. 2013, https://doi.org/10.1063/1.4819325 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # model parameters 10 | ωj = [0, 266, 500, 609, 672, 868, 3020] 11 | ωpj = [6490, 1040, 573, 634, 408, 277, 373] 12 | γj = [6.5e5, 188, 112, 88, 43, 113, 652] 13 | A = 2.06 14 | B = 0.025 15 | 16 | 17 | def Epsilon(ω): 18 | ε = 0 19 | for j in range (0, len(ωj)): 20 | ε += ωpj[j]**2 / (ωj[j]**2 - ω**2 - 1j*γj[j]*ω) 21 | return ε 22 | 23 | 24 | ω_min = 10 # cm^-1 25 | ω_max = 20000 # cm^-1 26 | npoints = 500 27 | ω = np.logspace(np.log10(ω_min), np.log10(ω_max), npoints) 28 | μm = 10000/ω 29 | ε = (A+B/μm**2)**2 + Epsilon(ω) 30 | n = (ε**.5).real 31 | k = (ε**.5).imag 32 | 33 | 34 | #============================ DATA OUTPUT ================================= 35 | file = open('out.txt', 'w') 36 | for i in range(npoints-1, -1, -1): 37 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 38 | file.close() 39 | 40 | 41 | #=============================== PLOT ===================================== 42 | plt.rc('font', family='Arial', size='14') 43 | 44 | #plot ε vs eV 45 | plt.figure(1) 46 | plt.plot(ω, ε.real, label="ε1") 47 | plt.plot(ω, ε.imag, label="ε2") 48 | plt.xlabel('Wave number (1/cm)') 49 | plt.ylabel('ε') 50 | plt.xscale('log') 51 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 52 | 53 | #plot n,k vs ω 54 | plt.figure(2) 55 | plt.plot(ω, n, label="n") 56 | plt.plot(ω, k, label="k") 57 | plt.xlabel('Photon energy (eV)') 58 | plt.ylabel('n, k') 59 | plt.xscale('log') 60 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 61 | 62 | #plot n,k vs μm 63 | plt.figure(3) 64 | plt.plot(μm, n, label="n") 65 | plt.plot(μm, k, label="k") 66 | plt.xlabel('Wave number (1/cm)') 67 | plt.ylabel('n, k') 68 | plt.xscale('log') 69 | plt.yscale('log') 70 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Bright 2013 - Ta2O5 - nanocrystalline.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-06 4 | # Original data: Bright et al. 2013, https://doi.org/10.1063/1.4819325 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # model parameters 10 | ωj = [0, 91, 214, 324, 530, 842] 11 | ωpj = [6490, 260, 844, 391, 1019, 372] 12 | γj = [6.5e5, 74, 61, 73, 142, 114] 13 | A = 2.10 14 | B = 0.04 15 | 16 | 17 | def Epsilon(ω): 18 | ε = 0 19 | for j in range (0, len(ωj)): 20 | ε += ωpj[j]**2 / (ωj[j]**2 - ω**2 - 1j*γj[j]*ω) 21 | return ε 22 | 23 | 24 | ω_min = 10 # cm^-1 25 | ω_max = 20000 # cm^-1 26 | npoints = 500 27 | ω = np.logspace(np.log10(ω_min), np.log10(ω_max), npoints) 28 | μm = 10000/ω 29 | ε = (A+B/μm**2)**2 + Epsilon(ω) 30 | n = (ε**.5).real 31 | k = (ε**.5).imag 32 | 33 | 34 | #============================ DATA OUTPUT ================================= 35 | file = open('out.txt', 'w') 36 | for i in range(npoints-1, -1, -1): 37 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 38 | file.close() 39 | 40 | 41 | #=============================== PLOT ===================================== 42 | plt.rc('font', family='Arial', size='14') 43 | 44 | #plot ε vs eV 45 | plt.figure(1) 46 | plt.plot(ω, ε.real, label="ε1") 47 | plt.plot(ω, ε.imag, label="ε2") 48 | plt.xlabel('Wave number (1/cm)') 49 | plt.ylabel('ε') 50 | plt.xscale('log') 51 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 52 | 53 | #plot n,k vs ω 54 | plt.figure(2) 55 | plt.plot(ω, n, label="n") 56 | plt.plot(ω, k, label="k") 57 | plt.xlabel('Photon energy (eV)') 58 | plt.ylabel('n, k') 59 | plt.xscale('log') 60 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 61 | 62 | #plot n,k vs μm 63 | plt.figure(3) 64 | plt.plot(μm, n, label="n") 65 | plt.plot(μm, k, label="k") 66 | plt.xlabel('Wave number (1/cm)') 67 | plt.ylabel('n, k') 68 | plt.xscale('log') 69 | plt.yscale('log') 70 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Chernova 2017 - DyScO3.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Original data: Chernova et al. 2017, https://doi.org/10.1364/OME.7.003844 4 | 5 | # Kramers-Kroning Integration https://doi.org/10.1366/0003702884430380 6 | 7 | # Version history 8 | # 2025-02-19 first version (Pavel Dmitriev) 9 | # 2025-02-27 simplify output (Misha Polyanskiy) 10 | # 11 | 12 | import numpy as np 13 | import matplotlib.pyplot as plt 14 | 15 | 16 | def generate_epsilon(): 17 | auxfuncs = __import__("Chernova 2017 - Aux funcs") 18 | 19 | # Model parameters 20 | E = [6.5, 6.8, 7.16, 7.83, 9.19] 21 | Amplitude = [0.73, 1.95, 3.33, 6.24, 5.99] 22 | FWHM = [0.3, 0.54, 0.78, 1.22, 1.9] 23 | 24 | UV_E = 13.8 25 | UV_Amplitude = 244 26 | 27 | eps_inf = 1 28 | 29 | # Simulate range 30 | num_points = 1000 31 | eV = np.linspace(0.1, 15.0, num_points, True) 32 | dEv = eV[1]-eV[0] 33 | 34 | epsilon_1_inf = eps_inf * np.ones(eV.shape) 35 | epsilon_1_UV = [UV_Amplitude/(UV_E**2 - e**2) for e in eV] 36 | 37 | eps_1 = np.add(eps_inf, epsilon_1_UV) 38 | eps_2 = np.zeros(eV.shape) 39 | 40 | for i in range(len(E)): 41 | eps_1_osc, eps_2_osc = auxfuncs.gaussian(eV, E[i], Amplitude[i], FWHM[i]) 42 | 43 | eps_1 += eps_1_osc 44 | eps_2 += eps_2_osc 45 | 46 | epsilon = eps_1 + 1j * eps_2 47 | 48 | return eV, epsilon 49 | 50 | if __name__ == "__main__": 51 | 52 | eV, epsilon = generate_epsilon() 53 | 54 | n = (epsilon**.5).real 55 | k = (epsilon**.5).imag 56 | 57 | # 58 | # Interpolate to data range 59 | # 60 | # Model range 61 | fit_points = 100 62 | fit_eV = np.linspace(0.74, 8.8, fit_points, True) 63 | 64 | 65 | n_interp = np.interp(fit_eV, eV, n) 66 | k_interp = np.interp(fit_eV, eV, k) 67 | 68 | wl_um = np.divide(1.23984193, fit_eV) 69 | 70 | #============================ DATA OUTPUT ================================= 71 | file = open('out.txt', 'w') 72 | for i in range(fit_points-1, -1, -1): 73 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(wl_um[i],n_interp[i],k_interp[i])) 74 | file.close() 75 | 76 | 77 | #=============================== PLOT ===================================== 78 | #plot n vs eV 79 | plt.figure(1) 80 | plt.plot(fit_eV, n_interp) 81 | plt.xlabel('Photon energy (eV)') 82 | plt.ylabel('n') 83 | 84 | #plot n vs eV 85 | plt.figure(2) 86 | plt.plot(fit_eV, k_interp) 87 | plt.xlabel('Photon energy (eV)') 88 | plt.ylabel('k') 89 | 90 | #plot n,k vs μm 91 | plt.figure(3) 92 | plt.plot(wl_um, n_interp, label="n") 93 | plt.plot(wl_um, k_interp, label="k") 94 | plt.xlabel('Wavelength (μm)') 95 | plt.ylabel('n, k') 96 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 97 | 98 | plt.show() -------------------------------------------------------------------------------- /scripts/Chernova 2017 - LSAT.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Original data: Chernova et al. 2017, https://doi.org/10.1364/OME.7.003844 4 | 5 | # Kramers-Kroning Integration https://doi.org/10.1366/0003702884430380 6 | 7 | # Version history 8 | # 2025-02-19 first version (Pavel Dmitriev) 9 | # 2025-02-27 simplify output (Misha Polyanskiy) 10 | # 11 | 12 | import numpy as np 13 | import matplotlib.pyplot as plt 14 | def generate_epsilon(): 15 | auxfuncs = __import__("Chernova 2017 - Aux funcs") 16 | 17 | 18 | # Model parameters 19 | E = [6.3, 6.96, 8.62, 11.47] 20 | Amplitude = [2.95, 3.26, 2.13, 5.96] 21 | FWHM = [0.78, 0.91, 1.78, 4.65] 22 | 23 | UV_E = 12. 24 | UV_Amplitude = 148 25 | 26 | 27 | eps_inf = 1 28 | 29 | # Simulate range 30 | num_points = 1000 31 | eV = np.linspace(0.1, 15.0, num_points, True) 32 | dEv = eV[1]-eV[0] 33 | 34 | epsilon_1_inf = eps_inf * np.ones(eV.shape) 35 | epsilon_1_UV = [UV_Amplitude/(UV_E**2 - e**2) for e in eV] 36 | 37 | eps_1 = np.add(eps_inf, epsilon_1_UV) 38 | eps_2 = np.zeros(eV.shape) 39 | 40 | for i in range(len(E)): 41 | eps_1_osc, eps_2_osc = auxfuncs.gaussian(eV, E[i], Amplitude[i], FWHM[i]) 42 | 43 | eps_1 += eps_1_osc 44 | eps_2 += eps_2_osc 45 | 46 | epsilon = eps_1 + 1j * eps_2 47 | 48 | return eV, epsilon 49 | 50 | if __name__ == "__main__": 51 | 52 | eV, epsilon = generate_epsilon() 53 | 54 | n = (epsilon**.5).real 55 | k = (epsilon**.5).imag 56 | 57 | # 58 | # Interpolate to data range 59 | # 60 | # Model range 61 | fit_points = 100 62 | fit_eV = np.linspace(0.74, 8.8, fit_points, True) 63 | 64 | 65 | n_interp = np.interp(fit_eV, eV, n) 66 | k_interp = np.interp(fit_eV, eV, k) 67 | 68 | wl_um = np.divide(1.23984193, fit_eV) 69 | 70 | #============================ DATA OUTPUT ================================= 71 | file = open('out.txt', 'w') 72 | for i in range(fit_points-1, -1, -1): 73 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(wl_um[i],n_interp[i],k_interp[i])) 74 | file.close() 75 | 76 | 77 | #=============================== PLOT ===================================== 78 | #plot n vs eV 79 | plt.figure(1) 80 | plt.plot(fit_eV, n_interp) 81 | plt.xlabel('Photon energy (eV)') 82 | plt.ylabel('n') 83 | 84 | #plot n vs eV 85 | plt.figure(2) 86 | plt.plot(fit_eV, k_interp) 87 | plt.xlabel('Photon energy (eV)') 88 | plt.ylabel('k') 89 | 90 | #plot n,k vs μm 91 | plt.figure(3) 92 | plt.plot(wl_um, n_interp, label="n") 93 | plt.plot(wl_um, k_interp, label="k") 94 | plt.xlabel('Wavelength (μm)') 95 | plt.ylabel('n, k') 96 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 97 | 98 | plt.show() -------------------------------------------------------------------------------- /scripts/Chernova 2017 - LaAlO3.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Original data: Chernova et al. 2017, https://doi.org/10.1364/OME.7.003844 4 | 5 | # Kramers-Kroning Integration https://doi.org/10.1366/0003702884430380 6 | 7 | # Version history 8 | # 2025-02-19 first version (Pavel Dmitriev) 9 | # 2025-02-27 simplify output (Misha Polyanskiy) 10 | # 11 | 12 | import numpy as np 13 | import matplotlib.pyplot as plt 14 | 15 | def generate_epsilon(): 16 | auxfuncs = __import__("Chernova 2017 - Aux funcs") 17 | 18 | 19 | # Model parameters 20 | E = [6.63, 7.43, 7.87, 8.19, 9.74] 21 | Amplitude = [0.19, 2.08, 1.85, 6.89, 8.43] 22 | FWHM = [0.92, 0.27, 0.45, 1.28, 1.77] 23 | 24 | UV_E = 16. 25 | UV_Amplitude = 305. 26 | 27 | eps_inf = 1 28 | 29 | # Simulate range 30 | num_points = 1000 31 | eV = np.linspace(0.1, 15.0, num_points, True) 32 | dEv = eV[1]-eV[0] 33 | 34 | epsilon_1_inf = eps_inf * np.ones(eV.shape) 35 | epsilon_1_UV = [UV_Amplitude/(UV_E**2 - e**2) for e in eV] 36 | 37 | eps_1 = np.add(eps_inf, epsilon_1_UV) 38 | eps_2 = np.zeros(eV.shape) 39 | 40 | for i in range(len(E)): 41 | eps_1_osc, eps_2_osc = auxfuncs.gaussian(eV, E[i], Amplitude[i], FWHM[i]) 42 | 43 | eps_1 += eps_1_osc 44 | eps_2 += eps_2_osc 45 | 46 | epsilon = eps_1 + 1j * eps_2 47 | 48 | return eV, epsilon 49 | 50 | if __name__ == "__main__": 51 | 52 | eV, epsilon = generate_epsilon() 53 | 54 | n = (epsilon**.5).real 55 | k = (epsilon**.5).imag 56 | 57 | # 58 | # Interpolate to data range 59 | # 60 | # Model range 61 | fit_points = 100 62 | fit_eV = np.linspace(0.74, 8.8, fit_points, True) 63 | 64 | 65 | n_interp = np.interp(fit_eV, eV, n) 66 | k_interp = np.interp(fit_eV, eV, k) 67 | 68 | wl_um = np.divide(1.23984193, fit_eV) 69 | 70 | #============================ DATA OUTPUT ================================= 71 | file = open('out.txt', 'w') 72 | for i in range(fit_points-1, -1, -1): 73 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(wl_um[i],n_interp[i],k_interp[i])) 74 | file.close() 75 | 76 | 77 | #=============================== PLOT ===================================== 78 | #plot n vs eV 79 | plt.figure(1) 80 | plt.plot(fit_eV, n_interp) 81 | plt.xlabel('Photon energy (eV)') 82 | plt.ylabel('n') 83 | 84 | #plot n vs eV 85 | plt.figure(2) 86 | plt.plot(fit_eV, k_interp) 87 | plt.xlabel('Photon energy (eV)') 88 | plt.ylabel('k') 89 | 90 | #plot n,k vs μm 91 | plt.figure(3) 92 | plt.plot(wl_um, n_interp, label="n") 93 | plt.plot(wl_um, k_interp, label="k") 94 | plt.xlabel('Wavelength (μm)') 95 | plt.ylabel('n, k') 96 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 97 | 98 | plt.show() -------------------------------------------------------------------------------- /scripts/Chernova 2017 - MAS.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Original data: Chernova et al. 2017, https://doi.org/10.1364/OME.7.003844 4 | 5 | # Kramers-Kroning Integration https://doi.org/10.1366/0003702884430380 6 | 7 | # Version history 8 | # 2025-02-19 first version (Pavel Dmitriev) 9 | # 2025-02-27 simplify output (Misha Polyanskiy) 10 | # 11 | 12 | import numpy as np 13 | import matplotlib.pyplot as plt 14 | def generate_epsilon(): 15 | auxfuncs = __import__("Chernova 2017 - Aux funcs") 16 | 17 | 18 | # Model parameters 19 | E = [8.25, 9.38, 17.45] 20 | Amplitude = [1.66, 3.38, 3.55] 21 | FWHM = [0.47, 1.53, 4.85] 22 | 23 | UV_E = 13.5 24 | UV_Amplitude = 139 25 | 26 | 27 | eps_inf = 1 28 | 29 | # Simulate range 30 | num_points = 1000 31 | eV = np.linspace(0.1, 15.0, num_points, True) 32 | dEv = eV[1]-eV[0] 33 | 34 | epsilon_1_inf = eps_inf * np.ones(eV.shape) 35 | epsilon_1_UV = [UV_Amplitude/(UV_E**2 - e**2) for e in eV] 36 | 37 | eps_1 = np.add(eps_inf, epsilon_1_UV) 38 | eps_2 = np.zeros(eV.shape) 39 | 40 | for i in range(len(E)): 41 | eps_1_osc, eps_2_osc = auxfuncs.gaussian(eV, E[i], Amplitude[i], FWHM[i]) 42 | 43 | eps_1 += eps_1_osc 44 | eps_2 += eps_2_osc 45 | 46 | epsilon = eps_1 + 1j * eps_2 47 | 48 | return eV, epsilon 49 | 50 | if __name__ == "__main__": 51 | 52 | eV, epsilon = generate_epsilon() 53 | 54 | n = (epsilon**.5).real 55 | k = (epsilon**.5).imag 56 | 57 | # 58 | # Interpolate to data range 59 | # 60 | # Model range 61 | fit_points = 100 62 | fit_eV = np.linspace(0.74, 8.8, fit_points, True) 63 | 64 | 65 | n_interp = np.interp(fit_eV, eV, n) 66 | k_interp = np.interp(fit_eV, eV, k) 67 | 68 | wl_um = np.divide(1.23984193, fit_eV) 69 | 70 | #============================ DATA OUTPUT ================================= 71 | file = open('out.txt', 'w') 72 | for i in range(fit_points-1, -1, -1): 73 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(wl_um[i],n_interp[i],k_interp[i])) 74 | file.close() 75 | 76 | 77 | #=============================== PLOT ===================================== 78 | #plot n vs eV 79 | plt.figure(1) 80 | plt.plot(fit_eV, n_interp) 81 | plt.xlabel('Photon energy (eV)') 82 | plt.ylabel('n') 83 | 84 | #plot n vs eV 85 | plt.figure(2) 86 | plt.plot(fit_eV, k_interp) 87 | plt.xlabel('Photon energy (eV)') 88 | plt.ylabel('k') 89 | 90 | #plot n,k vs μm 91 | plt.figure(3) 92 | plt.plot(wl_um, n_interp, label="n") 93 | plt.plot(wl_um, k_interp, label="k") 94 | plt.xlabel('Wavelength (μm)') 95 | plt.ylabel('n, k') 96 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 97 | 98 | plt.show() -------------------------------------------------------------------------------- /scripts/Chernova 2017 - MgO.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Original data: Chernova et al. 2017, https://doi.org/10.1364/OME.7.003844 4 | 5 | # Kramers-Kroning Integration https://doi.org/10.1366/0003702884430380 6 | 7 | # Tauc-Lorentz oscillators https://doi.org/10.1063/1.118064 8 | 9 | # Version history 10 | # 2025-02-27 first version (Pavel Dmitriev) 11 | # 2025-02-27 simplify output (Misha Polyanskiy) 12 | # 13 | 14 | import numpy as np 15 | import matplotlib.pyplot as plt 16 | 17 | import matplotlib 18 | matplotlib.use("TkAgg") 19 | 20 | def generate_epsilon(): 21 | auxfuncs = __import__("Chernova 2017 - Aux Funcs") 22 | 23 | UV_E = 13.7 24 | UV_Amplitude = 47 25 | 26 | # Tauc-Lorentz 27 | E_TL = [7.07, 7.64] 28 | A_TL = [472.4, 818.3] 29 | C_TL = [5.99, 0.19] 30 | Eg_TL = [8.01, 7.45] 31 | 32 | # Lorentz 33 | Lorentz_Amplitude = [1.62] 34 | Lorentz_FWHM = [0.1] 35 | Lorentz_Eg = [7.6] 36 | 37 | eps_inf = 1 38 | 39 | # Simulate range 40 | num_points = 2000 41 | eV = np.linspace(0.1, 100.0, num_points, True) # long TL tail requires model to go so high 42 | eps1 = np.zeros(eV.shape) 43 | eps2 = np.zeros(eV.shape) 44 | 45 | 46 | plt.figure(0) 47 | # Tauc-Lorentz 48 | for i in range(len(E_TL)): 49 | eps_1_TL, eps_2_TL = auxfuncs.taucLorentz_KK(eV, E_TL[i], A_TL[i], C_TL[i], Eg_TL[i]) 50 | eps1 += eps_1_TL 51 | eps2 += eps_2_TL 52 | 53 | plt.plot(eV, eps_2_TL) 54 | # 55 | # Lorentz oscillators 56 | # 57 | for i in range(len(Lorentz_Eg)): 58 | eps_1_lor, eps_2_lor = auxfuncs.lorentz(eV, Lorentz_Amplitude[i], Lorentz_FWHM[i], Lorentz_Eg[i]) 59 | eps1 += eps_1_lor 60 | eps2 += eps_2_lor 61 | 62 | plt.plot(eV, eps_2_lor) 63 | 64 | # 65 | # Poles 66 | # 67 | epsilon_1_UV = np.asarray([UV_Amplitude / (UV_E ** 2 - e ** 2) for e in eV]) 68 | eps1 += epsilon_1_UV 69 | eps1 += eps_inf 70 | 71 | epsilon = eps1 + 1j * eps2 72 | 73 | plt.show() 74 | 75 | return eV, epsilon 76 | 77 | 78 | if __name__ == "__main__": 79 | 80 | eV, epsilon = generate_epsilon() 81 | 82 | n = (epsilon ** .5).real 83 | k = (epsilon ** .5).imag 84 | 85 | # 86 | # Interpolate to data range 87 | # 88 | 89 | # Model range 90 | fit_points = 100 91 | fit_eV = np.linspace(0.74, 8.8, fit_points, True) 92 | 93 | 94 | n_interp = np.interp(fit_eV, eV, n) 95 | k_interp = np.interp(fit_eV, eV, k) 96 | 97 | wl_um = np.divide(1.23984193, fit_eV) 98 | 99 | #============================ DATA OUTPUT ================================= 100 | file = open('out.txt', 'w') 101 | for i in range(fit_points-1, -1, -1): 102 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(wl_um[i],n_interp[i],k_interp[i])) 103 | file.close() 104 | 105 | 106 | #=============================== PLOT ===================================== 107 | #plot n vs eV 108 | plt.figure(1) 109 | plt.plot(fit_eV, n_interp) 110 | plt.xlabel('Photon energy (eV)') 111 | plt.ylabel('n') 112 | 113 | # #plot n vs eV 114 | # plt.figure(2) 115 | # plt.plot(eV, epsilon.imag) 116 | # plt.xlabel('Photon energy (eV)') 117 | # plt.ylabel('eps2') 118 | 119 | 120 | #plot n,k vs μm 121 | plt.figure(3) 122 | plt.plot(wl_um, n_interp, label="n") 123 | plt.plot(wl_um, k_interp, label="k") 124 | plt.xlabel('Wavelength (μm)') 125 | plt.ylabel('n, k') 126 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 127 | 128 | #plot n vs eV 129 | plt.figure(4) 130 | plt.plot(fit_eV, k_interp) 131 | plt.xlabel('Photon energy (eV)') 132 | plt.ylabel('k') 133 | 134 | 135 | plt.show() -------------------------------------------------------------------------------- /scripts/Chernova 2017 - NbSrTiO3.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Original data: Chernova et al. 2017, https://doi.org/10.1364/OME.7.003844 4 | 5 | # Kramers-Kroning Integration https://doi.org/10.1366/0003702884430380 6 | 7 | # Version history 8 | # 2025-02-27 first version (Pavel Dmitriev) 9 | # 2025-02-27 simplify output (Misha Polyanskiy) 10 | # 11 | 12 | import numpy as np 13 | import matplotlib.pyplot as plt 14 | def generate_epsilon(): 15 | auxfuncs = __import__("Chernova 2017 - Aux funcs") 16 | 17 | 18 | # Model parameters 19 | E = [3.5, 3.85, 4.16, 4.7, 4.79, 5.3, 6.32, 6.43, 9.27] 20 | Amplitude = [0.1, 0.27, 3.44, 4.1, 0.56, 4.17, 2.43, 1.32, 4.32] 21 | FWHM = [0.24, 0.2, 0.56, 0.94, 0.39, 1.27, 2.45, 0.55, 2.55] 22 | 23 | UV_E = 14.8 24 | UV_Amplitude = 228 25 | 26 | # Drude 27 | Drude_Amplitude = 98.94 28 | Drude_FWHM = 0.0045 29 | 30 | eps_inf = 1 31 | 32 | # Simulate range 33 | num_points = 1000 34 | eV = np.linspace(0.1, 15.0, num_points, True) 35 | dEv = eV[1]-eV[0] 36 | 37 | epsilon_1_inf = eps_inf * np.ones(eV.shape) 38 | epsilon_1_UV = [UV_Amplitude/(UV_E**2 - e**2) for e in eV] 39 | 40 | eps_1 = np.add(eps_inf, epsilon_1_UV) 41 | eps_2 = np.zeros(eV.shape) 42 | 43 | for i in range(len(E)): 44 | eps_1_osc, eps_2_osc = auxfuncs.gaussian(eV, E[i], Amplitude[i], FWHM[i]) 45 | 46 | eps_1 += eps_1_osc 47 | eps_2 += eps_2_osc 48 | 49 | # 50 | # Lorentz-Drude 51 | # 52 | eps_drude_1, eps_drude_2 = auxfuncs.drude(eV, Drude_Amplitude, Drude_FWHM) 53 | eps_1 += eps_drude_1 54 | eps_2 += eps_drude_2 55 | 56 | epsilon = eps_1 + 1j * eps_2 57 | 58 | return eV, epsilon 59 | 60 | if __name__ == "__main__": 61 | 62 | eV, epsilon = generate_epsilon() 63 | 64 | n = (epsilon**.5).real 65 | k = (epsilon**.5).imag 66 | 67 | # 68 | # Interpolate to data range 69 | # 70 | # Model range 71 | fit_points = 100 72 | fit_eV = np.linspace(0.74, 8.8, fit_points, True) 73 | 74 | 75 | n_interp = np.interp(fit_eV, eV, n) 76 | k_interp = np.interp(fit_eV, eV, k) 77 | 78 | wl_um = np.divide(1.23984193, fit_eV) 79 | 80 | #============================ DATA OUTPUT ================================= 81 | file = open('out.txt', 'w') 82 | for i in range(fit_points-1, -1, -1): 83 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(wl_um[i],n_interp[i],k_interp[i])) 84 | file.close() 85 | 86 | 87 | #=============================== PLOT ===================================== 88 | #plot n vs eV 89 | plt.figure(1) 90 | plt.plot(fit_eV, n_interp) 91 | plt.xlabel('Photon energy (eV)') 92 | plt.ylabel('n') 93 | 94 | #plot n vs eV 95 | plt.figure(2) 96 | plt.plot(fit_eV, k_interp) 97 | plt.xlabel('Photon energy (eV)') 98 | plt.ylabel('k') 99 | 100 | #plot n,k vs μm 101 | plt.figure(3) 102 | plt.plot(wl_um, n_interp, label="n") 103 | plt.plot(wl_um, k_interp, label="k") 104 | plt.xlabel('Wavelength (μm)') 105 | plt.ylabel('n, k') 106 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 107 | 108 | plt.show() -------------------------------------------------------------------------------- /scripts/Chernova 2017 - SrTiO3.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Original data: Chernova et al. 2017, https://doi.org/10.1364/OME.7.003844 4 | 5 | # Kramers-Kroning Integration https://doi.org/10.1366/0003702884430380 6 | 7 | # Version history 8 | # 2025-02-19 first version (Pavel Dmitriev) 9 | # 2025-02-27 simplify output (Misha Polyanskiy) 10 | # 11 | 12 | import numpy as np 13 | import matplotlib.pyplot as plt 14 | def generate_epsilon(): 15 | auxfuncs = __import__("Chernova 2017 - Aux funcs") 16 | 17 | 18 | # Model parameters 19 | E = [3.91, 4.19, 4.76, 5.03, 6.05, 6.28, 6.4, 8.3, 9.47] 20 | Amplitude = [1.16, 4.39, 2.32, 5.58, 2.53, 0.4, 1.37, 0.09, 4.32] 21 | FWHM = [0.23, 0.53, 0.42, 1.33, 1.99, 0.27, 0.48, 0.21, 3.39] 22 | 23 | UV_E = 15.8 24 | UV_Amplitude = 222 25 | 26 | eps_inf = 1 27 | 28 | # Simulate range 29 | num_points = 1000 30 | eV = np.linspace(0.1, 15.0, num_points, True) 31 | dEv = eV[1] - eV[0] 32 | 33 | epsilon_1_inf = eps_inf * np.ones(eV.shape) 34 | epsilon_1_UV = [UV_Amplitude / (UV_E ** 2 - e ** 2) for e in eV] 35 | 36 | eps_1 = np.add(eps_inf, epsilon_1_UV) 37 | eps_2 = np.zeros(eV.shape) 38 | 39 | for i in range(len(E)): 40 | eps_1_osc, eps_2_osc = auxfuncs.gaussian(eV, E[i], Amplitude[i], FWHM[i]) 41 | 42 | eps_1 += eps_1_osc 43 | eps_2 += eps_2_osc 44 | 45 | epsilon = eps_1 + 1j * eps_2 46 | 47 | return eV, epsilon 48 | 49 | 50 | if __name__ == "__main__": 51 | 52 | eV, epsilon = generate_epsilon() 53 | 54 | n = (epsilon ** .5).real 55 | k = (epsilon ** .5).imag 56 | 57 | # 58 | # Interpolate to data range 59 | # 60 | # Model range 61 | fit_points = 100 62 | fit_eV = np.linspace(0.74, 8.8, fit_points, True) 63 | 64 | n_interp = np.interp(fit_eV, eV, n) 65 | k_interp = np.interp(fit_eV, eV, k) 66 | 67 | wl_um = np.divide(1.23984193, fit_eV) 68 | 69 | # ============================ DATA OUTPUT ================================= 70 | file = open('out.txt', 'w') 71 | for i in range(fit_points - 1, -1, -1): 72 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(wl_um[i], n_interp[i], k_interp[i])) 73 | file.close() 74 | 75 | # =============================== PLOT ===================================== 76 | # plot n vs eV 77 | plt.figure(1) 78 | plt.plot(fit_eV, n_interp) 79 | plt.xlabel('Photon energy (eV)') 80 | plt.ylabel('n') 81 | 82 | # plot n vs eV 83 | plt.figure(2) 84 | plt.plot(fit_eV, k_interp) 85 | plt.xlabel('Photon energy (eV)') 86 | plt.ylabel('k') 87 | 88 | # plot n,k vs μm 89 | plt.figure(3) 90 | plt.plot(wl_um, n_interp, label="n") 91 | plt.plot(wl_um, k_interp, label="k") 92 | plt.xlabel('Wavelength (μm)') 93 | plt.ylabel('n, k') 94 | plt.legend(bbox_to_anchor=(0, 1.02, 1, 0), loc=3, ncol=2, borderaxespad=0) 95 | 96 | plt.show() -------------------------------------------------------------------------------- /scripts/Djurisic 1999 - Graphite-e.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Djurišić and Li 1999, https://doi.org/10.1063/1.369370 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # LD model parameters - Parallel polarization (extraordinary) 10 | ωp = 19 11 | εinf = 0.731 12 | 13 | f1 = 0.034 14 | Γ1 = 2.096 15 | ω1 = 11.418 16 | α1 = 0.138 17 | 18 | f2 = 0.003 19 | Γ2 = 3.492 20 | ω2 = 4.095 21 | α2 = 29.728 22 | 23 | f3 = 0.078 24 | Γ3 = 2.442 25 | ω3 = 10.003 26 | α3 = 0.516 27 | 28 | f4 = 0.131 29 | Γ4 = 2.529 30 | ω4 = 14.991 31 | α4 = 1.78e-6 32 | 33 | f5 = 0.280 34 | Γ5 = 6.829 35 | ω5 = 17.516 36 | α5 = 1.78e-6 # in the original: "1.01.78e-6" 37 | 38 | f6 = 0.855 39 | Γ6 = 14.541 40 | ω6 = 30.712 41 | α6 = 1.180 42 | 43 | f7 = 0.972 44 | Γ7 = 20.314 45 | ω7 = 46.004 46 | α7 = 9.388 47 | 48 | 49 | 50 | def LD(ω): 51 | ε = εinf; 52 | Γ = Γ1*np.exp(-α1*((ω-ω1)/Γ1)**2) 53 | ε -= f1*ωp**2 / ((ω**2-ω1**2)+1j*ω*Γ) 54 | Γ = Γ2*np.exp(-α2*((ω-ω2)/Γ2)**2) 55 | ε -= f2*ωp**2 / ((ω**2-ω2**2)+1j*ω*Γ) 56 | Γ = Γ3*np.exp(-α3*((ω-ω3)/Γ3)**2) 57 | ε -= f3*ωp**2 / ((ω**2-ω3**2)+1j*ω*Γ) 58 | Γ = Γ4*np.exp(-α4*((ω-ω4)/Γ4)**2) 59 | ε -= f4*ωp**2 / ((ω**2-ω4**2)+1j*ω*Γ) 60 | Γ = Γ5*np.exp(-α5*((ω-ω5)/Γ5)**2) 61 | ε -= f5*ωp**2 / ((ω**2-ω5**2)+1j*ω*Γ) 62 | Γ = Γ6*np.exp(-α6*((ω-ω6)/Γ6)**2) 63 | ε -= f6*ωp**2 / ((ω**2-ω6**2)+1j*ω*Γ) 64 | Γ = Γ7*np.exp(-α7*((ω-ω7)/Γ7)**2) 65 | ε -= f7*ωp**2 / ((ω**2-ω7**2)+1j*ω*Γ) 66 | return ε 67 | 68 | 69 | ev_min=2.1 70 | ev_max=40 71 | npoints=1000 72 | eV = np.linspace(ev_min, ev_max, npoints) 73 | μm = 4.13566733e-1*2.99792458/eV 74 | ε = LD(eV) 75 | n = (ε**.5).real 76 | k = (ε**.5).imag 77 | 78 | 79 | #============================ DATA OUTPUT ================================= 80 | file = open('out.txt', 'w') 81 | for i in range(npoints-1, -1, -1): 82 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 83 | file.close() 84 | 85 | 86 | #=============================== PLOT ===================================== 87 | plt.rc('font', family='Arial', size='14') 88 | 89 | #plot ε vs eV 90 | plt.figure(1) 91 | plt.plot(eV, ε.real, label="ε1") 92 | plt.plot(eV, ε.imag, label="ε2") 93 | plt.xlabel('Photon energy (eV)') 94 | plt.ylabel('ε') 95 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 96 | 97 | #plot n,k vs eV 98 | plt.figure(2) 99 | plt.plot(eV, n, label="n") 100 | plt.plot(eV, k, label="k") 101 | plt.xlabel('Photon energy (eV)') 102 | plt.ylabel('n, k') 103 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 104 | 105 | #plot n,k vs μm 106 | plt.figure(3) 107 | plt.plot(μm, n, label="n") 108 | plt.plot(μm, k, label="k") 109 | plt.xlabel('Wavelength (μm)') 110 | plt.ylabel('n, k') 111 | plt.xscale('log') 112 | plt.yscale('log') 113 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Djurisic 1999 - Graphite-o.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Djurišić and Li 1999, https://doi.org/10.1063/1.369370 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # LD model parameters - Normal polarization (ordinary) 10 | ωp = 27 11 | εinf = 1.070 12 | 13 | f0 = 0.014 14 | Γ0 = 6.365 15 | ω0 = 0 16 | α0 = 0 17 | 18 | f1 = 0.073 19 | Γ1 = 4.102 20 | ω1 = 0.275 21 | α1 = 0.505 22 | 23 | f2 = 0.056 24 | Γ2 = 7.328 25 | ω2 = 3.508 26 | α2 = 7.079 27 | 28 | f3 = 0.069 29 | Γ3 = 1.414 30 | ω3 = 4.451 31 | α3 = 0.362 32 | 33 | f4 = 0.005 34 | Γ4 = 0.46 # 0.046 in the original paper! 35 | ω4 = 13.591 36 | α4 = 7.426 37 | 38 | f5 = 0.262 39 | Γ5 = 1.862 40 | ω5 = 14.226 41 | α5 = 3.82e-4 42 | 43 | f6 = 0.460 44 | Γ6 = 11.922 45 | ω6 = 15.550 46 | α6 = 1.387 47 | 48 | f7 = 0.200 49 | Γ7 = 39.091 50 | ω7 = 32.011 51 | α7 = 28.963 52 | 53 | 54 | def LD(ω): 55 | ε = εinf; 56 | Γ = Γ0*np.exp(-α0*((ω-ω0)/Γ0)**2) 57 | ε -= f0*ωp**2 / ((ω**2-ω0**2)+1j*ω*Γ) 58 | Γ = Γ1*np.exp(-α1*((ω-ω1)/Γ1)**2) 59 | ε -= f1*ωp**2 / ((ω**2-ω1**2)+1j*ω*Γ) 60 | Γ = Γ2*np.exp(-α2*((ω-ω2)/Γ2)**2) 61 | ε -= f2*ωp**2 / ((ω**2-ω2**2)+1j*ω*Γ) 62 | Γ = Γ3*np.exp(-α3*((ω-ω3)/Γ3)**2) 63 | ε -= f3*ωp**2 / ((ω**2-ω3**2)+1j*ω*Γ) 64 | Γ = Γ4*np.exp(-α4*((ω-ω4)/Γ4)**2) 65 | ε -= f4*ωp**2 / ((ω**2-ω4**2)+1j*ω*Γ) 66 | Γ = Γ5*np.exp(-α5*((ω-ω5)/Γ5)**2) 67 | ε -= f5*ωp**2 / ((ω**2-ω5**2)+1j*ω*Γ) 68 | Γ = Γ6*np.exp(-α6*((ω-ω6)/Γ6)**2) 69 | ε -= f6*ωp**2 / ((ω**2-ω6**2)+1j*ω*Γ) 70 | Γ = Γ7*np.exp(-α7*((ω-ω7)/Γ7)**2) 71 | ε -= f7*ωp**2 / ((ω**2-ω7**2)+1j*ω*Γ) 72 | return ε 73 | 74 | 75 | ev_min=0.12 76 | ev_max=40 77 | npoints=1000 78 | eV = np.linspace(ev_min, ev_max, npoints) 79 | μm = 4.13566733e-1*2.99792458/eV 80 | ε = LD(eV) 81 | n = (ε**.5).real 82 | k = (ε**.5).imag 83 | 84 | 85 | #============================ DATA OUTPUT ================================= 86 | file = open('out.txt', 'w') 87 | for i in range(npoints-1, -1, -1): 88 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 89 | file.close() 90 | 91 | 92 | #=============================== PLOT ===================================== 93 | plt.rc('font', family='Arial', size='14') 94 | 95 | #plot ε vs eV 96 | plt.figure(1) 97 | plt.plot(eV, ε.real, label="ε1") 98 | plt.plot(eV, ε.imag, label="ε2") 99 | plt.xlabel('Photon energy (eV)') 100 | plt.ylabel('ε') 101 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 102 | 103 | #plot n,k vs eV 104 | plt.figure(2) 105 | plt.plot(eV, n, label="n") 106 | plt.plot(eV, k, label="k") 107 | plt.xlabel('Photon energy (eV)') 108 | plt.ylabel('n, k') 109 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 110 | 111 | #plot n,k vs μm 112 | plt.figure(3) 113 | plt.plot(μm, n, label="n") 114 | plt.plot(μm, k, label="k") 115 | plt.xlabel('Wavelength (μm)') 116 | plt.ylabel('n, k') 117 | plt.xscale('log') 118 | plt.yscale('log') 119 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Djurisic 2000 - AlSb.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-09 4 | # Original data: Djurišić et al. 2000, https://doi.org/10.1007/s003390050006 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # model parameters from table I 10 | E0 = 2.27 #eV 11 | Δ0 = 2.93-E0 #eV 12 | E1 = 2.82 #eV 13 | Δ1 = 3.22-E1 #eV 14 | A = 0.009 #eV**1.5 15 | 16 | εinf = 0.068 17 | Γ0 = 0.006 #eV 18 | α0 = 6.579 19 | 20 | B1 = 6.025 21 | B1s = 0.328 22 | Γ1 = 0.146 #eV 23 | α1 = 0.062 24 | 25 | F2 = 5.261 #eV 26 | Γ2 = 1.209 #eV 27 | α2 = 1.486 28 | E2 = 3.175 #eV 29 | 30 | F3 = 1.540 #eV 31 | Γ3 = 0.426 #eV 32 | α3 = 1.318 33 | E3 = 5.254 #eV 34 | 35 | F4 = 5.338 #eV 36 | Γ4 = 0.491 #eV 37 | α4 = 0.429 38 | E4 = 4.016 #eV 39 | 40 | 41 | def Epsilon_I(ħω): 42 | Γ0ω = Γ0*np.exp(-α0*((ħω-E0)/Γ0)**2) 43 | χ0 = (ħω + 1j*Γ0ω) / E0 44 | χ0s = (ħω + 1j*Γ0ω) / (E0+Δ0) 45 | fχ0 = χ0**-2 * ( 2 -(1+χ0)**0.5 - (1-χ0)**0.5 ) 46 | fχ0s = χ0s**-2 * ( 2 - (1+χ0s)**0.5 - (1-χ0s)**0.5 ) 47 | return A*E0**-1.5 * (fχ0+0.5*(E0/(E0+Δ0))**1.5*fχ0s) 48 | 49 | def Epsilon_II(ħω): 50 | Γ1ω = Γ1*np.exp(-α1*((ħω-E1)/Γ1)**2) 51 | χ1 = (ħω + 1j*Γ1ω) / E1 52 | χ1s = (ħω + 1j*Γ1ω) / (E1+Δ1) 53 | return -B1*χ1**-2*np.log(1-χ1**2) - B1s*χ1s**-2*np.log(1-χ1s**2) 54 | 55 | def Epsilon_III(ħω): 56 | Γ2ω = Γ2*np.exp(-α2*((ħω-E2)/Γ2)**2) 57 | ε2 = F2**2 / (E2**2 - ħω**2 - 1j*ħω*Γ2ω) 58 | Γ3ω = Γ3*np.exp(-α3*((ħω-E3)/Γ3)**2) 59 | ε3 = F3**2 / (E3**2 - ħω**2 - 1j*ħω*Γ3ω) 60 | Γ4ω = Γ4*np.exp(-α4*((ħω-E4)/Γ4)**2) 61 | ε4 = F4**2 / (E4**2 - ħω**2 - 1j*ħω*Γ4ω) 62 | return ε2+ε3+ε4 63 | 64 | 65 | ev_min=0.1 66 | ev_max=6 67 | npoints=500 68 | eV = np.linspace(ev_min, ev_max, npoints) 69 | μm = 4.13566733e-1*2.99792458/eV 70 | ε = εinf + Epsilon_I(eV) + Epsilon_II(eV) + Epsilon_III(eV) 71 | n = (ε**.5).real 72 | k = (ε**.5).imag 73 | 74 | 75 | #============================ DATA OUTPUT ================================= 76 | file = open('out.txt', 'w') 77 | for i in range(npoints-1, -1, -1): 78 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 79 | file.close() 80 | 81 | 82 | #=============================== PLOT ===================================== 83 | plt.rc('font', family='Arial', size='14') 84 | 85 | #plot ε vs eV 86 | plt.figure(1) 87 | plt.plot(eV, ε.real, label="ε1") 88 | plt.plot(eV, ε.imag, label="ε2") 89 | plt.xlabel('Photon energy (eV)') 90 | plt.ylabel('ε') 91 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 92 | 93 | #plot n,k vs eV 94 | plt.figure(2) 95 | plt.plot(eV, n, label="n") 96 | plt.plot(eV, k, label="k") 97 | plt.xlabel('Photon energy (eV)') 98 | plt.ylabel('n, k') 99 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 100 | 101 | #plot n,k vs μm 102 | plt.figure(3) 103 | plt.plot(μm, n, label="n") 104 | plt.plot(μm, k, label="k") 105 | plt.xlabel('Wavelength (μm)') 106 | plt.ylabel('n, k') 107 | plt.xscale('log') 108 | plt.yscale('log') 109 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Djurisic 2000 - GaSb.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-09 4 | # Original data: Djurišić et al. 2000, https://doi.org/10.1007/s003390050006 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # model parameters from table I 10 | E0 = 0.72 #eV 11 | Δ0 = 1.46-E0 #eV 12 | E1 = 2.17 #eV 13 | Δ1 = 2.63-E1 #eV 14 | A = 0.096 #eV**1.5 15 | 16 | εinf = 0.003 17 | Γ0 = 0.001 #eV 18 | α0 = 6.394 19 | 20 | B1 = 11.642 21 | B1s = 0.001 22 | Γ1 = 0.380 #eV 23 | α1 = 0.005 24 | 25 | F2 = 1.865 #eV 26 | Γ2 = 0.203 #eV 27 | α2 = 0.001 28 | E2 = 2.062 #eV 29 | 30 | F3 = 3.688 #eV 31 | Γ3 = 0.595 #eV 32 | α3 = 0.993 33 | E3 = 3.651 #eV 34 | 35 | F4 = 4.800 #eV 36 | Γ4 = 0.438 #eV 37 | α4 = 0.001 38 | E4 = 4.050 #eV 39 | 40 | 41 | def Epsilon_I(ħω): 42 | Γ0ω = Γ0*np.exp(-α0*((ħω-E0)/Γ0)**2) 43 | χ0 = (ħω + 1j*Γ0ω) / E0 44 | χ0s = (ħω + 1j*Γ0ω) / (E0+Δ0) 45 | fχ0 = χ0**-2 * ( 2 -(1+χ0)**0.5 - (1-χ0)**0.5 ) 46 | fχ0s = χ0s**-2 * ( 2 - (1+χ0s)**0.5 - (1-χ0s)**0.5 ) 47 | return A*E0**-1.5 * (fχ0+0.5*(E0/(E0+Δ0))**1.5*fχ0s) 48 | 49 | def Epsilon_II(ħω): 50 | Γ1ω = Γ1*np.exp(-α1*((ħω-E1)/Γ1)**2) 51 | χ1 = (ħω + 1j*Γ1ω) / E1 52 | χ1s = (ħω + 1j*Γ1ω) / (E1+Δ1) 53 | return -B1*χ1**-2*np.log(1-χ1**2) - B1s*χ1s**-2*np.log(1-χ1s**2) 54 | 55 | def Epsilon_III(ħω): 56 | Γ2ω = Γ2*np.exp(-α2*((ħω-E2)/Γ2)**2) 57 | ε2 = F2**2 / (E2**2 - ħω**2 - 1j*ħω*Γ2ω) 58 | Γ3ω = Γ3*np.exp(-α3*((ħω-E3)/Γ3)**2) 59 | ε3 = F3**2 / (E3**2 - ħω**2 - 1j*ħω*Γ3ω) 60 | Γ4ω = Γ4*np.exp(-α4*((ħω-E4)/Γ4)**2) 61 | ε4 = F4**2 / (E4**2 - ħω**2 - 1j*ħω*Γ4ω) 62 | return ε2+ε3+ε4 63 | 64 | 65 | ev_min=0.5 66 | ev_max=6 67 | npoints=500 68 | eV = np.linspace(ev_min, ev_max, npoints) 69 | μm = 4.13566733e-1*2.99792458/eV 70 | ε = εinf + Epsilon_I(eV) + Epsilon_II(eV) + Epsilon_III(eV) 71 | n = (ε**.5).real 72 | k = (ε**.5).imag 73 | 74 | 75 | #============================ DATA OUTPUT ================================= 76 | file = open('out.txt', 'w') 77 | for i in range(npoints-1, -1, -1): 78 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 79 | file.close() 80 | 81 | 82 | #=============================== PLOT ===================================== 83 | plt.rc('font', family='Arial', size='14') 84 | 85 | #plot ε vs eV 86 | plt.figure(1) 87 | plt.plot(eV, ε.real, label="ε1") 88 | plt.plot(eV, ε.imag, label="ε2") 89 | plt.xlabel('Photon energy (eV)') 90 | plt.ylabel('ε') 91 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 92 | 93 | #plot n,k vs eV 94 | plt.figure(2) 95 | plt.plot(eV, n, label="n") 96 | plt.plot(eV, k, label="k") 97 | plt.xlabel('Photon energy (eV)') 98 | plt.ylabel('n, k') 99 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 100 | 101 | #plot n,k vs μm 102 | plt.figure(3) 103 | plt.plot(μm, n, label="n") 104 | plt.plot(μm, k, label="k") 105 | plt.xlabel('Wavelength (μm)') 106 | plt.ylabel('n, k') 107 | plt.xscale('log') 108 | plt.yscale('log') 109 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Djurisic 2000 - InSb.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-09 4 | # Original data: Djurišić et al. 2000, https://doi.org/10.1007/s003390050006 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # model parameters from table I 10 | E0 = 0.18 #eV 11 | Δ0 = 0.99-E0 #eV 12 | E1 = 1.87 #eV 13 | Δ1 = 2.45-E1 #eV 14 | A = 0.267 #eV**1.5 15 | 16 | εinf = 0.564 17 | Γ0 = 0.003 #eV 18 | α0 = 0.528 19 | 20 | B1 = 9.365 21 | B1s = 1.466 22 | Γ1 = 0.464 #eV 23 | α1 = 0.008 24 | 25 | F2 = 5.848 #eV 26 | Γ2 = 0.666 #eV 27 | α2 = 0.023 28 | E2 = 3.812 #eV 29 | 30 | F3 = 1.613 #eV 31 | Γ3 = 0.284 #eV 32 | α3 = 0.149 33 | E3 = 2.357 #eV 34 | 35 | F4 = 1.765 #eV 36 | Γ4 = 0.231 #eV 37 | α4 = 0.118 38 | E4 = 1.877 #eV 39 | 40 | 41 | def Epsilon_I(ħω): 42 | Γ0ω = Γ0*np.exp(-α0*((ħω-E0)/Γ0)**2) 43 | χ0 = (ħω + 1j*Γ0ω) / E0 44 | χ0s = (ħω + 1j*Γ0ω) / (E0+Δ0) 45 | fχ0 = χ0**-2 * ( 2 -(1+χ0)**0.5 - (1-χ0)**0.5 ) 46 | fχ0s = χ0s**-2 * ( 2 - (1+χ0s)**0.5 - (1-χ0s)**0.5 ) 47 | return A*E0**-1.5 * (fχ0+0.5*(E0/(E0+Δ0))**1.5*fχ0s) 48 | 49 | def Epsilon_II(ħω): 50 | Γ1ω = Γ1*np.exp(-α1*((ħω-E1)/Γ1)**2) 51 | χ1 = (ħω + 1j*Γ1ω) / E1 52 | χ1s = (ħω + 1j*Γ1ω) / (E1+Δ1) 53 | return -B1*χ1**-2*np.log(1-χ1**2) - B1s*χ1s**-2*np.log(1-χ1s**2) 54 | 55 | def Epsilon_III(ħω): 56 | Γ2ω = Γ2*np.exp(-α2*((ħω-E2)/Γ2)**2) 57 | ε2 = F2**2 / (E2**2 - ħω**2 - 1j*ħω*Γ2ω) 58 | Γ3ω = Γ3*np.exp(-α3*((ħω-E3)/Γ3)**2) 59 | ε3 = F3**2 / (E3**2 - ħω**2 - 1j*ħω*Γ3ω) 60 | Γ4ω = Γ4*np.exp(-α4*((ħω-E4)/Γ4)**2) 61 | ε4 = F4**2 / (E4**2 - ħω**2 - 1j*ħω*Γ4ω) 62 | return ε2+ε3+ε4 63 | 64 | 65 | ev_min=1 66 | ev_max=6 67 | npoints=500 68 | eV = np.linspace(ev_min, ev_max, npoints) 69 | μm = 4.13566733e-1*2.99792458/eV 70 | ε = εinf + Epsilon_I(eV) + Epsilon_II(eV) + Epsilon_III(eV) 71 | n = (ε**.5).real 72 | k = (ε**.5).imag 73 | 74 | 75 | #============================ DATA OUTPUT ================================= 76 | file = open('out.txt', 'w') 77 | for i in range(npoints-1, -1, -1): 78 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 79 | file.close() 80 | 81 | 82 | #=============================== PLOT ===================================== 83 | plt.rc('font', family='Arial', size='14') 84 | 85 | #plot ε vs eV 86 | plt.figure(1) 87 | plt.plot(eV, ε.real, label="ε1") 88 | plt.plot(eV, ε.imag, label="ε2") 89 | plt.xlabel('Photon energy (eV)') 90 | plt.ylabel('ε') 91 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 92 | 93 | #plot n,k vs eV 94 | plt.figure(2) 95 | plt.plot(eV, n, label="n") 96 | plt.plot(eV, k, label="k") 97 | plt.xlabel('Photon energy (eV)') 98 | plt.ylabel('n, k') 99 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 100 | 101 | #plot n,k vs μm 102 | plt.figure(3) 103 | plt.plot(μm, n, label="n") 104 | plt.plot(μm, k, label="k") 105 | plt.xlabel('Wavelength (μm)') 106 | plt.ylabel('n, k') 107 | plt.xscale('log') 108 | plt.yscale('log') 109 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Kaiser 1962 - BaF2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Braden Czapla (2019) 3 | # Original data: Kaiser et al. 1962, https://doi.org/10.1103/PhysRev.127.1950 4 | 5 | # Version history 6 | # 2019-04-29 first version (Braden Czapla) 7 | # 2025-02-28 simplify output (Misha Polyanskiy) 8 | 9 | from __future__ import absolute_import, division, print_function 10 | import numpy as np 11 | import matplotlib.pyplot as plt 12 | 13 | ############################################################################### 14 | 15 | # Determine wavelengths to sample 16 | def w(w_max, w_min, step): 17 | linspace_lower = (np.floor_divide(w_min, step)+1)*step 18 | N = np.floor_divide(w_max-w_min, step) 19 | linspace_upper = linspace_lower + N*step 20 | w = np.linspace(linspace_lower, linspace_upper, int(N)+1) 21 | 22 | if not np.isclose(w[0], w_min, atol=step/5.): 23 | w = np.concatenate((np.array([w_min]), w)) 24 | 25 | if not np.isclose(w[-1], w_max, atol=step/5.): 26 | w = np.concatenate((w,np.array([w_max]))) 27 | 28 | return w, len(w) 29 | 30 | # Compute dielectric function using Lorentzian model. 31 | # Units of w and ResFreq must match and must be directly proportional to angular frequency. All other parameters are unitless. 32 | def Lorentzian(w, ResFreq, Strength, Damping, Eps_Inf): 33 | Permittivity = Eps_Inf*np.ones(len(w), dtype=complex) 34 | for ii in range(len(ResFreq)): 35 | Permittivity += Strength[ii]/( 1. - (w/ResFreq[ii])**2 - 1j*Damping[ii]*(w/ResFreq[ii]) ) 36 | return Permittivity 37 | 38 | ############################################################################### 39 | 40 | ## Wavelengths to sample ## 41 | w_um_max = 80. # [um] 42 | w_um_min = 10. # [um] 43 | step_um = 0.05 # [um] 44 | 45 | w_um, N_freq = w(w_um_max, w_um_min, step_um) 46 | w_invcm = 10000./w_um 47 | ## ## 48 | 49 | ## Model Parameters ## 50 | # See Table I 51 | ResFreq = np.array([184., 278.]) # [cm^-1] 52 | Strength = np.array([4.50, 0.07]) 53 | Damping = np.array([0.020, 0.30]) 54 | Eps_Inf = 2.16 55 | ## ## 56 | 57 | ## Generate and Save Data ## 58 | eps = Lorentzian(w_invcm, ResFreq, Strength, Damping, Eps_Inf) 59 | RefInd = np.sqrt(eps) 60 | 61 | export = np.column_stack((w_um, np.real(RefInd), np.imag(RefInd))) 62 | np.savetxt('out.txt', export, fmt=' %4.3f %#.6g %#.3e') 63 | 64 | ## Plotting ## 65 | plt.figure('Figure 7 - n') 66 | plt.plot(w_um, np.real(RefInd), label='BaF$_{2}$') 67 | 68 | plt.legend(loc=1) 69 | plt.xlim(10,80) 70 | plt.ylim(0,14) 71 | 72 | 73 | plt.figure('Figure 8 - k') 74 | plt.plot(w_um, np.imag(RefInd), label='BaF$_{2}$') 75 | 76 | plt.legend(loc=1) 77 | plt.xlim(10,80) 78 | plt.ylim(0,14) 79 | ## ## -------------------------------------------------------------------------------- /scripts/Kaiser 1962 - CaF2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Braden Czapla (2019) 3 | # Original data: Kaiser et al. 1962, https://doi.org/10.1103/PhysRev.127.1950 4 | 5 | # Version history 6 | # 2019-04-29 first version (Braden Czapla) 7 | # 2025-02-28 simplify output (Misha Polyanskiy) 8 | 9 | from __future__ import absolute_import, division, print_function 10 | import numpy as np 11 | import matplotlib.pyplot as plt 12 | 13 | ############################################################################### 14 | 15 | # Determine wavelengths to sample 16 | def w(w_max, w_min, step): 17 | linspace_lower = (np.floor_divide(w_min, step)+1)*step 18 | N = np.floor_divide(w_max-w_min, step) 19 | linspace_upper = linspace_lower + N*step 20 | w = np.linspace(linspace_lower, linspace_upper, int(N)+1) 21 | 22 | if not np.isclose(w[0], w_min, atol=step/5.): 23 | w = np.concatenate((np.array([w_min]), w)) 24 | 25 | if not np.isclose(w[-1], w_max, atol=step/5.): 26 | w = np.concatenate((w,np.array([w_max]))) 27 | 28 | return w, len(w) 29 | 30 | # Compute dielectric function using Lorentzian model. 31 | # Units of w and ResFreq must match and must be directly proportional to angular frequency. All other parameters are unitless. 32 | def Lorentzian(w, ResFreq, Strength, Damping, Eps_Inf): 33 | Permittivity = Eps_Inf*np.ones(len(w), dtype=complex) 34 | for ii in range(len(ResFreq)): 35 | Permittivity += Strength[ii]/( 1. - (w/ResFreq[ii])**2 - 1j*Damping[ii]*(w/ResFreq[ii]) ) 36 | return Permittivity 37 | 38 | ############################################################################### 39 | 40 | ## Wavelengths to sample ## 41 | w_um_max = 80. # [um] 42 | w_um_min = 10. # [um] 43 | step_um = 0.05 # [um] 44 | 45 | w_um, N_freq = w(w_um_max, w_um_min, step_um) 46 | w_invcm = 10000./w_um 47 | ## ## 48 | 49 | ## Model Parameters ## 50 | # See Table I 51 | ResFreq = np.array([257., 328.]) # [cm^-1] 52 | Strength = np.array([4.20, 0.40]) 53 | Damping = np.array([0.018, 0.35]) 54 | Eps_Inf = 2.045 55 | ## ## 56 | 57 | ## Generate and Save Data ## 58 | eps = Lorentzian(w_invcm, ResFreq, Strength, Damping, Eps_Inf) 59 | RefInd = np.sqrt(eps) 60 | 61 | export = np.column_stack((w_um, np.real(RefInd), np.imag(RefInd))) 62 | np.savetxt('out.txt', export, fmt=' %4.3f %#.6g %#.3e') 63 | 64 | ## Plotting ## 65 | plt.figure('Figure 7 - n') 66 | plt.plot(w_um, np.real(RefInd), label='CaF$_{2}$') 67 | 68 | plt.legend(loc=1) 69 | plt.xlim(10,80) 70 | plt.ylim(0,14) 71 | 72 | 73 | plt.figure('Figure 8 - k') 74 | plt.plot(w_um, np.imag(RefInd), label='CaF$_{2}$') 75 | 76 | plt.legend(loc=1) 77 | plt.xlim(10,80) 78 | plt.ylim(0,14) 79 | ## ## -------------------------------------------------------------------------------- /scripts/Kaiser 1962 - SrF2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Braden Czapla (2019) 3 | # Original data: Kaiser et al. 1962, https://doi.org/10.1103/PhysRev.127.1950 4 | 5 | # Version history 6 | # 2019-04-29 first version (Braden Czapla) 7 | # 2025-02-28 simplify output (Misha Polyanskiy) 8 | 9 | from __future__ import absolute_import, division, print_function 10 | import numpy as np 11 | import matplotlib.pyplot as plt 12 | 13 | ############################################################################### 14 | 15 | # Determine wavelengths to sample 16 | def w(w_max, w_min, step): 17 | linspace_lower = (np.floor_divide(w_min, step)+1)*step 18 | N = np.floor_divide(w_max-w_min, step) 19 | linspace_upper = linspace_lower + N*step 20 | w = np.linspace(linspace_lower, linspace_upper, int(N)+1) 21 | 22 | if not np.isclose(w[0], w_min, atol=step/5.): 23 | w = np.concatenate((np.array([w_min]), w)) 24 | 25 | if not np.isclose(w[-1], w_max, atol=step/5.): 26 | w = np.concatenate((w,np.array([w_max]))) 27 | 28 | return w, len(w) 29 | 30 | # Compute dielectric function using Lorentzian model. 31 | # Units of w and ResFreq must match and must be directly proportional to angular frequency. All other parameters are unitless. 32 | def Lorentzian(w, ResFreq, Strength, Damping, Eps_Inf): 33 | Permittivity = Eps_Inf*np.ones(len(w), dtype=complex) 34 | for ii in range(len(ResFreq)): 35 | Permittivity += Strength[ii]/( 1. - (w/ResFreq[ii])**2 - 1j*Damping[ii]*(w/ResFreq[ii]) ) 36 | return Permittivity 37 | 38 | ############################################################################### 39 | 40 | ## Wavelengths to sample ## 41 | w_um_max = 80. # [um] 42 | w_um_min = 10. # [um] 43 | step_um = 0.05 # [um] 44 | 45 | w_um, N_freq = w(w_um_max, w_um_min, step_um) 46 | w_invcm = 10000./w_um 47 | ## ## 48 | 49 | ## Model Parameters ## 50 | # See Table I 51 | ResFreq = np.array([217., 316.]) # [cm^-1] 52 | Strength = np.array([4.00, 0.07]) 53 | Damping = np.array([0.017, 0.25]) 54 | Eps_Inf = 2.07 55 | ## ## 56 | 57 | ## Generate and Save Data ## 58 | eps = Lorentzian(w_invcm, ResFreq, Strength, Damping, Eps_Inf) 59 | RefInd = np.sqrt(eps) 60 | 61 | export = np.column_stack((w_um, np.real(RefInd), np.imag(RefInd))) 62 | np.savetxt('out.txt', export, fmt=' %4.3f %#.6g %#.3e') 63 | 64 | ## Plotting ## 65 | plt.figure('Figure 7 - n') 66 | plt.plot(w_um, np.real(RefInd), label='SrF$_{2}$') 67 | 68 | plt.legend(loc=1) 69 | plt.xlim(10,80) 70 | plt.ylim(0,14) 71 | 72 | 73 | plt.figure('Figure 8 - k') 74 | plt.plot(w_um, np.imag(RefInd), label='SrF$_{2}$') 75 | 76 | plt.legend(loc=1) 77 | plt.xlim(10,80) 78 | plt.ylim(0,14) 79 | ## ## -------------------------------------------------------------------------------- /scripts/Kawashima 1997 - GaN.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-23 4 | # Original data: Kawashima et al. 1997, https://doi.org/10.1063/1.365671 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | π = np.pi 9 | 10 | # parameters from table II 11 | E0 = 3.38 #eV 12 | G0 = 0.02 #eV 13 | A0 = 27 #eV**1.5 14 | A0x = 0.055 #eV**-1 15 | Γ0 = 0.06 #eV 16 | 17 | EminusG1A=6.8 #eV 18 | EminusG1B=7.9 #eV 19 | EminusG1C=9.0 #eV 20 | B1xA = 6.2 #eV 21 | B1xB = 0.6 #eV 22 | B1xC = 3.0 #eV 23 | Γ1A = 0.78 #eV 24 | Γ1B = 0.35 #eV 25 | Γ1C = 1.0 #eV 26 | 27 | ε1 = 2.20 28 | 29 | def Epsilon_A(ħω): 30 | χ0 = (ħω+1j*Γ0) / E0 31 | fχ0 = χ0**-2 * ( 2-(1+χ0)**0.5-(1-χ0)**0.5 ) 32 | return A0*E0**-1.5 * fχ0 33 | 34 | def Epsilon_Ax(ħω): 35 | y=0 36 | for n in range(1,1000): 37 | y += A0x/n**3 / (E0-G0/n**2-ħω-1j*Γ0) 38 | return y 39 | 40 | def Epsilon_B(ħω): 41 | ε = B1xA / (EminusG1A-ħω-1j*Γ1A) 42 | ε += B1xB / (EminusG1B-ħω-1j*Γ1B) 43 | ε += B1xC / (EminusG1C-ħω-1j*Γ1C) 44 | return ε 45 | 46 | ev_min=1.25 47 | ev_max=10 48 | npoints=500 49 | 50 | eV = np.linspace(ev_min, ev_max, npoints) 51 | μm = 4.13566733e-1*2.99792458/eV 52 | εA = Epsilon_A(eV) 53 | εAx = Epsilon_Ax(eV) 54 | εB = Epsilon_B(eV) 55 | ε = εA + εAx + εB + ε1 56 | n = (ε**.5).real 57 | k = (ε**.5).imag 58 | α = 4*π*k/μm*1e4 #1/cm 59 | 60 | 61 | #============================ DATA OUTPUT ================================= 62 | file = open('out.txt', 'w') 63 | for i in range(npoints-1, -1, -1): 64 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 65 | file.close() 66 | 67 | 68 | #=============================== PLOT ===================================== 69 | plt.rc('font', family='Arial', size='14') 70 | 71 | #plot ε vs eV 72 | plt.figure(1) 73 | plt.plot(eV, ε.real, label="ε1") 74 | plt.plot(eV, ε.imag, label="ε2") 75 | plt.xlabel('Photon energy (eV)') 76 | plt.ylabel('ε') 77 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 78 | 79 | #plot intermediate data (for debugging) 80 | plt.figure(2) 81 | plt.plot(eV, εA.real, label="Re(εA)") 82 | plt.plot(eV, εAx.real, label="Re(εAx)") 83 | plt.plot(eV, εB.real, label="Re(εB)") 84 | plt.xlabel('Photon energy (eV)') 85 | plt.ylabel('ε') 86 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 87 | 88 | plt.figure(3) 89 | plt.plot(eV, εA.imag, label="Im(εA)") 90 | plt.plot(eV, εAx.imag, label="Im(εAx)") 91 | plt.plot(eV, εB.imag, label="Im(εB)") 92 | plt.xlabel('Photon energy (eV)') 93 | plt.ylabel('ε') 94 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 95 | 96 | #plot n,k vs eV 97 | plt.figure(4) 98 | plt.plot(eV, n, label="n") 99 | plt.plot(eV, k, label="k") 100 | plt.xlabel('Photon energy (eV)') 101 | plt.ylabel('n, k') 102 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 103 | 104 | #plot n,k vs μm 105 | plt.figure(5) 106 | plt.plot(μm, n, label="n") 107 | plt.plot(μm, k, label="k") 108 | plt.xlabel('Wavelength (μm)') 109 | plt.ylabel('n, k') 110 | plt.yscale('log') 111 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 112 | 113 | #plot α vs eV 114 | plt.figure(6) 115 | plt.plot(eV,α) 116 | plt.yscale('log') 117 | plt.ylim([1e3,1e7]) 118 | plt.xlabel('Photon energy (eV)') 119 | plt.ylabel('α (1/cm)') -------------------------------------------------------------------------------- /scripts/Kitamura 2007 - Fused silica.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy (2017) 3 | # corrected/improved by Braden Czapla (2019) 4 | # Last modified: 2019-04-26 5 | # Original data: Kitamura et al. 2007, https://doi.org/10.1364/AO.46.008118 6 | 7 | import numpy as np 8 | from scipy.special import dawsn 9 | import matplotlib.pyplot as plt 10 | π = np.pi 11 | 12 | # Model parameters 13 | εinf = 2.1232 14 | α = [3.7998, .46089, 1.2520, 7.8147, 1.0313, 5.3757, 6.3305, 1.2948] 15 | η0 = [1089.7, 1187.7, 797.78, 1058.2, 446.13, 443.00, 465.80, 1026.7] #1/cm 16 | σ = [31.454, 100.46, 91.601, 63.153, 275.111, 45.220, 22.680, 232.14] #1/cm 17 | 18 | 19 | D = lambda x: dawsn(x) 20 | 21 | def M(η): 22 | ε = εinf 23 | for i in range(0,8): 24 | gc = α[i]*np.exp(-4*np.log(2)*((η-η0[i])/σ[i])**2) - α[i]*np.exp(-4*np.log(2)*((η+η0[i])/σ[i])**2) 25 | gckkg = 2*α[i]/np.sqrt(π) * (D(2*np.log(2)**.5*(η+η0[i])/σ[i]) - D(2*np.log(2)**.5*(η-η0[i])/σ[i])) 26 | # !misprint in the original publication: π in the denominator instead of sqrt(π)! 27 | ε += gckkg + 1j*gc 28 | return ε 29 | 30 | η_min=10000/50 #μm -> 1/cm 31 | η_max=10000/7 #μm -> 1/cm 32 | npoints=200 33 | η = np.linspace(η_min, η_max, npoints) 34 | λ = 10000/η #1/cm -> μm 35 | ε = M(η) 36 | n = (ε**.5).real 37 | k = (ε**.5).imag 38 | 39 | 40 | #============================ DATA OUTPUT ================================= 41 | file = open('out.txt', 'w') 42 | for i in range(npoints-1, -1, -1): 43 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(λ[i],n[i],k[i])) 44 | file.close() 45 | 46 | 47 | #=============================== PLOT ===================================== 48 | plt.rc('font', family='Arial', size='14') 49 | 50 | plt.figure(1) 51 | plt.plot(η, ε.real, label="ε1") 52 | plt.plot(η, ε.imag, label="ε2") 53 | plt.xlabel('Wavenumber (1/cm)') 54 | plt.ylabel('ε') 55 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 56 | 57 | #plot n vs wavelength (Fig. 3 top in the paper) 58 | plt.figure(2) 59 | plt.plot(λ, n, label="n") 60 | plt.xlabel('Wavelength (μm)') 61 | plt.ylabel('n') 62 | plt.xlim([1,15]) 63 | plt.ylim([0,4]) 64 | 65 | #plot k vs wavelength (Fig. 3 bottom in the paper) 66 | plt.figure(3) 67 | plt.plot(λ, k, label="k") 68 | plt.xlabel('Wavelength (μm)') 69 | plt.ylabel('k') 70 | plt.yscale('log') 71 | plt.xlim([1,15]) 72 | plt.ylim([1e-8 ,10]) 73 | 74 | #plot n vs wavelength (Fig. 4 top in the paper) 75 | plt.figure(4) 76 | plt.plot(λ, n, label="n") 77 | plt.xlabel('Wavelength (μm)') 78 | plt.ylabel('n') 79 | plt.xlim([15,100]) 80 | plt.ylim([0,3]) 81 | 82 | 83 | #plot k vs wavelength (Fig. 4 bottom in the paper) 84 | plt.figure(5) 85 | plt.plot(λ, k, label="k") 86 | plt.xlabel('Wavelength (μm)') 87 | plt.ylabel('k') 88 | plt.yscale('log') 89 | plt.xlim([15,100]) 90 | plt.ylim([1e-2 ,10]) 91 | -------------------------------------------------------------------------------- /scripts/Le 2022 - InGaAs.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy (2017) 3 | # modified by S.Vassant for InGaAs data 4 | # Last modified: 2022-10-23 5 | # Original data: Le et al. 2022, https://doi.org/10.1364/OME.455445 6 | 7 | import numpy as np 8 | from scipy.special import dawsn 9 | import matplotlib.pyplot as plt 10 | π = np.pi 11 | 12 | # Model parameters 13 | εinf = 11.31 14 | α = [18.65, 21.23, 10.13] 15 | η0 = [225.31, 245.23, 254.14] #1/cm 16 | σ = [12.11,23.08,7.16] #1/cm 17 | 18 | 19 | D = lambda x: dawsn(x) 20 | 21 | def M(η): 22 | ε = εinf 23 | for i in range(0,3): 24 | gc = α[i]*np.exp(-4*np.log(2)*((η-η0[i])/σ[i])**2) - α[i]*np.exp(-4*np.log(2)*((η+η0[i])/σ[i])**2) 25 | gckkg = 2*α[i]/np.sqrt(π) * (D(2*np.log(2)**.5*(η+η0[i])/σ[i]) - D(2*np.log(2)**.5*(η-η0[i])/σ[i])) 26 | ε += gckkg + 1j*gc 27 | return ε 28 | 29 | η_min=150 #μm -> 1/cm 30 | η_max=350 #μm -> 1/cm 31 | npoints=200 32 | η = np.linspace(η_min, η_max, npoints) 33 | λ = 10000/η #1/cm -> μm 34 | ε = M(η) 35 | n = (ε**.5).real 36 | k = (ε**.5).imag 37 | 38 | 39 | #============================ DATA OUTPUT ================================= 40 | file = open('out.txt', 'w') 41 | for i in range(npoints-1, -1, -1): 42 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(λ[i],n[i],k[i])) 43 | file.close() 44 | 45 | 46 | #=============================== PLOT ===================================== 47 | plt.rc('font', family='Arial', size='14') 48 | 49 | # plot Re(ε), Im(ε), Fig. 4 of the paper 50 | plt.figure(1) 51 | plt.plot(η, ε.real, label="ε1") 52 | plt.plot(η, ε.imag, label="ε2") 53 | plt.xlabel('Wavenumber (1/cm)') 54 | plt.ylabel('ε') 55 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 56 | plt.show() 57 | 58 | # plot n,k (λ) 59 | plt.figure(2) 60 | plt.plot(λ, n, label="n") 61 | plt.plot(λ, k, label="k") 62 | plt.xlabel('Wavelength μm') 63 | plt.ylabel('n,k') 64 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 65 | plt.show() 66 | -------------------------------------------------------------------------------- /scripts/Mathar 2007 - Air 1.3-2.5um.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-11-16 4 | # Original data: Mathar 2007, https://doi.org/10.1088/1464-4258/9/5/008 5 | 6 | ############################### 1.3-2.5 μm #################################### 7 | 8 | import numpy as np 9 | import matplotlib.pyplot as plt 10 | π = np.pi 11 | 12 | # adjustable parameters 13 | T = 273.15+15 # Temperature: K 14 | p = 101325 # Pressure: Pa 15 | H = 0 # Humidity: 0-100% 16 | 17 | # model parameters 18 | cref = [ 0.200192e-3, 0.113474e-9, -0.424595e-14, 0.100957e-16, -0.293315e-20, 0.307228e-24] # cm^j 19 | cT = [ 0.588625e-1, -0.385766e-7, 0.888019e-10, -0.567650e-13, 0.166615e-16, -0.174845e-20] # cm^j · K 20 | cTT = [-3.01513, 0.406167e-3, -0.514544e-6, 0.343161e-9, -0.101189e-12, 0.106749e-16] # cm^j · K^2 21 | cH = [-0.103945e-7, 0.136858e-11, -0.171039e-14, 0.112908e-17, -0.329925e-21, 0.344747e-25] # cm^j · %^-1 22 | cHH = [ 0.573256e-12, 0.186367e-16, -0.228150e-19, 0.150947e-22, -0.441214e-26, 0.461209e-30] # cm^j · %^-2 23 | cp = [ 0.267085e-8, 0.135941e-14, 0.135295e-18, 0.818218e-23, -0.222957e-26, 0.249964e-30] # cm^j · Pa^-1 24 | cpp = [ 0.609186e-17, 0.519024e-23, -0.419477e-27, 0.434120e-30, -0.122445e-33, 0.134816e-37] # cm^j · Pa^-2 25 | cTH = [ 0.497859e-4, -0.661752e-8, 0.832034e-11, -0.551793e-14, 0.161899e-17, -0.169901e-21] # cm^j · K · %^-1 26 | cTp = [ 0.779176e-6, 0.396499e-12, 0.395114e-16, 0.233587e-20, -0.636441e-24, 0.716868e-28] # cm^j · K · Pa^-1 27 | cHp = [-0.206567e-15, 0.106141e-20, -0.149982e-23, 0.984046e-27, -0.288266e-30, 0.299105e-34] # cm^j · %^-1 · Pa^-1 28 | σref = 1e4/2.25 # cm^−1 29 | Tref = 273.15+17.5 # K 30 | pref = 75000 # Pa 31 | Href = 10 #% 32 | 33 | # model 34 | def n(λ): 35 | σ = 1e4/λ # cm^-1 36 | n = 1 37 | for j in range(0, 6): 38 | n += ( cref[j] + cT[j]*(1/T-1/Tref) + cTT[j]*(1/T-1/Tref)**2 39 | + cH[j]*(H-Href) + cHH[j]*(H-Href)**2 40 | + cp[j]*(p-pref) + cpp[j]*(p-pref)**2 41 | + cTH[j]*(1/T-1/Tref)*(H-Href) 42 | + cTp[j]*(1/T-1/Tref)*(p-pref) 43 | + cHp[j]*(H-Href)*(p-pref) ) * (σ-σref)**j 44 | return n 45 | 46 | 47 | # output - modify code below the line to match your needs 48 | ############################################################################### 49 | 50 | λ = np.arange(1.30, 2.501, 0.01) 51 | n = n(λ) 52 | 53 | # write data file 54 | file = open('out.txt', 'w') 55 | for i in range(0, len(λ)): 56 | file.write('\n {:.2f} {:.12f}'.format(λ[i],n[i])) 57 | file.close() 58 | 59 | #plot n vs μm 60 | plt.rc('font', family='Arial', size='14') 61 | plt.figure() 62 | plt.plot(λ, n-1) 63 | plt.xlabel('Wavelength (μm)') 64 | plt.ylabel('n-1') 65 | -------------------------------------------------------------------------------- /scripts/Mathar 2007 - Air 16-24um.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-11-18 4 | # Original data: Mathar 2007, https://doi.org/10.1088/1464-4258/9/5/008 5 | 6 | ################################ 16-24 μm ##################################### 7 | 8 | import numpy as np 9 | import matplotlib.pyplot as plt 10 | π = np.pi 11 | 12 | # adjustable parameters 13 | T = 273.15+17.5 # Temperature: K 14 | p = 101325 # Pressure: Pa 15 | H = 0 # Humidity: 0-100% 16 | 17 | # model parameters 18 | cref = [ 0.199436e-3, 0.299123e-8, -0.214862e-10, 0.143338e-12, 0.122398e-14, -0.114628e-16] # cm^j 19 | # something seems to be wrong with cT... 20 | cT = [ 0.621723e-1, -0.177074e-4, 0.152213e-6, -0.954584-9, -0.996706e-11, 0.921476e-13] # cm^j · K 21 | cTT = [-23.2409, 0.108557, -0.102439e-2, 0.634072e-5, 0.762517e-7, -0.675587e-9 ] # cm^j · K^2 22 | cH = [-0.772707e-7, 0.347237e-9, -0.272675e-11, 0.170858e-13, 0.156889e-15, -0.150004e-17] # cm^j · %^-1 23 | cHH = [-0.326604e-12, 0.463606e-14, -0.364272e-16, 0.228756e-18, 0.209502e-20, -0.200547e-22] # cm^j · %^-2 24 | cp = [ 0.266827e-8, 0.120788e-14, 0.522646e-17, 0.783027e-19, 0.753235e-21, -0.228819e-24] # cm^j · Pa^-1 25 | cpp = [ 0.613675e-17, 0.585494e-22, 0.286055e-24, 0.425193e-26, 0.413455e-28, -0.812941e-32] # cm^j · Pa^-2 26 | cTH = [ 0.375974e-3, -0.171849e-5, 0.146704e-7, -0.917231e-10, -0.955922e-12, 0.880502e-14] # cm^j · K · %^-1 27 | cTp = [ 0.778436e-6, 0.461840e-12, 0.306229e-14, -0.623183e-16, -0.161119e-18, 0.800756e-20] # cm^j · K · Pa^-1 28 | cHp = [-0.272614e-15, 0.304662e-18, -0.239590e-20, 0.149285e-22, 0.136086e-24, -0.130999e-26] # cm^j · %^-1 · Pa^-1 29 | σref = 1e4/20 # cm^−1 30 | Tref = 273.15+17.5 # K 31 | pref = 75000 # Pa 32 | Href = 10 #% 33 | 34 | # model 35 | def n(λ): 36 | σ = 1e4/λ # cm^-1 37 | n = 1 38 | for j in range(0, 6): 39 | n += ( cref[j] + cT[j]*(1/T-1/Tref) + cTT[j]*(1/T-1/Tref)**2 40 | + cH[j]*(H-Href) + cHH[j]*(H-Href)**2 41 | + cp[j]*(p-pref) + cpp[j]*(p-pref)**2 42 | + cTH[j]*(1/T-1/Tref)*(H-Href) 43 | + cTp[j]*(1/T-1/Tref)*(p-pref) 44 | + cHp[j]*(H-Href)*(p-pref) ) * (σ-σref)**j 45 | return n 46 | 47 | 48 | # output - modify code below the line to match your needs 49 | ############################################################################### 50 | 51 | λ = np.arange(16, 24.01, 0.05) 52 | n = n(λ) 53 | 54 | # write data file 55 | file = open('out.txt', 'w') 56 | for i in range(0, len(λ)): 57 | file.write('\n {:.2f} {:.12f}'.format(λ[i],n[i])) 58 | file.close() 59 | 60 | #plot n vs μm 61 | plt.rc('font', family='Arial', size='14') 62 | plt.figure() 63 | plt.plot(λ, n-1) 64 | plt.xlabel('Wavelength (μm)') 65 | plt.ylabel('n-1') 66 | -------------------------------------------------------------------------------- /scripts/Mathar 2007 - Air 2.8-4.2um.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-11-15 4 | # Original data: Mathar 2007, https://doi.org/10.1088/1464-4258/9/5/008 5 | 6 | ############################### 2.8-4.2 μm #################################### 7 | 8 | import numpy as np 9 | import matplotlib.pyplot as plt 10 | π = np.pi 11 | 12 | # adjustable parameters 13 | T = 273.15+15 # Temperature: K 14 | p = 101325 # Pressure: Pa 15 | H = 0 # Humidity: 0-100% 16 | 17 | # model parameters 18 | cref = [ 0.200049e-3, 0.145221e-9, 0.250951e-12, -0.745834e-15, -0.161432e-17, 0.352780e-20] # cm^j 19 | cT = [ 0.588432e-1, -0.825182e-7, 0.137982e-9, 0.352420e-13, -0.730651e-15, -0.167911e-18] # cm^j · K 20 | cTT = [-3.13579, 0.694124e-3, -0.500604e-6, -0.116668e-8, 0.209644e-11, 0.591037e-14] # cm^j · K^2 21 | cH = [-0.108142e-7, 0.230102e-11, -0.154652e-14, -0.323014e-17, 0.630616e-20, 0.173880e-22] # cm^j · %^-1 22 | cHH = [ 0.586812e-12, 0.312198e-16, -0.197792e-19, -0.461945e-22, 0.788398e-25, 0.245580e-27] # cm^j · %^-2 23 | cp = [ 0.266900e-8, 0.168162e-14, 0.353075e-17, -0.963455e-20, -0.223079e-22, 0.453166e-25] # cm^j · Pa^-1 24 | cpp = [ 0.608860e-17, 0.461560e-22, 0.184282e-24, -0.524471e-27, -0.121299e-29, 0.246512e-32] # cm^j · Pa^-2 25 | cTH = [ 0.517962e-4, -0.112149e-7, 0.776507e-11, 0.172569e-13, -0.320582e-16, -0.899435e-19] # cm^j · K · %^-1 26 | cTp = [ 0.778638e-6, 0.446396e-12, 0.784600e-15, -0.195151e-17, -0.542083e-20, 0.103530e-22] # cm^j · K · Pa^-1 27 | cHp = [-0.217243e-15, 0.104747e-20, -0.523689e-23, 0.817386e-26, 0.309913e-28, -0.363491e-31] # cm^j · %^-1 · Pa^-1 28 | σref = 1e4/3.4 # cm^−1 29 | Tref = 273.15+17.5 # K 30 | pref = 75000 # Pa 31 | Href = 10 #% 32 | 33 | # model 34 | def n(λ): 35 | σ = 1e4/λ # cm^-1 36 | n = 1 37 | for j in range(0, 6): 38 | n += ( cref[j] + cT[j]*(1/T-1/Tref) + cTT[j]*(1/T-1/Tref)**2 39 | + cH[j]*(H-Href) + cHH[j]*(H-Href)**2 40 | + cp[j]*(p-pref) + cpp[j]*(p-pref)**2 41 | + cTH[j]*(1/T-1/Tref)*(H-Href) 42 | + cTp[j]*(1/T-1/Tref)*(p-pref) 43 | + cHp[j]*(H-Href)*(p-pref) ) * (σ-σref)**j 44 | return n 45 | 46 | 47 | # output - modify code below the line to match your needs 48 | ############################################################################### 49 | 50 | λ = np.arange(2.8, 4.2, 0.01) 51 | n = n(λ) 52 | 53 | # write data file 54 | file = open('out.txt', 'w') 55 | for i in range(0, len(λ)): 56 | file.write('\n {:.2f} {:.12f}'.format(λ[i],n[i])) 57 | file.close() 58 | 59 | #plot n vs μm 60 | plt.rc('font', family='Arial', size='14') 61 | plt.figure() 62 | plt.plot(λ, n-1) 63 | plt.xlabel('Wavelength (μm)') 64 | plt.ylabel('n-1') 65 | -------------------------------------------------------------------------------- /scripts/Mathar 2007 - Air 4.35-5.2um.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-11-17 4 | # Original data: Mathar 2007, https://doi.org/10.1088/1464-4258/9/5/008 5 | 6 | ############################### 4.35-5.2 μm ################################### 7 | 8 | import numpy as np 9 | import matplotlib.pyplot as plt 10 | π = np.pi 11 | 12 | # adjustable parameters 13 | T = 273.15+15 # Temperature: K 14 | p = 101325 # Pressure: Pa 15 | H = 0 # Humidity: 0-100% 16 | 17 | # model parameters 18 | cref = [ 0.200020e-3, 0.275346e-9, 0.325702e-12, -0.693603e-14, 0.285610e-17, 0.338758e-18] # cm^j 19 | cT = [ 0.590035e-1, -0.375764e-6, 0.134585e-9, 0.124316e-11, 0.508510e-13, -0.189245e-15] # cm^j · K 20 | cTT = [-4.09830, 0.250037e-2, 0.275187e-6, -0.653398e-8, -0.310589e-9, 0.127747e-11] # cm^j · K^2 21 | cH = [-0.140463e-7, 0.839350e-11, -0.190929e-14, -0.121399e-16, -0.898863e-18, 0.364662e-20] # cm^j · %^-1 22 | cHH = [ 0.543605e-12, 0.112802e-15, -0.229979e-19, -0.191450e-21, -0.120352e-22, 0.500955e-25] # cm^j · %^-2 23 | cp = [ 0.266898e-8, 0.273629e-14, 0.463466e-17, -0.916894e-23, 0.136685e-21, 0.413687e-23] # cm^j · Pa^-1 24 | cpp = [ 0.610706e-17, 0.116620e-21, 0.244736e-24, -0.497682e-26, 0.742024e-29, 0.224625e-30] # cm^j · Pa^-2 25 | cTH = [ 0.674488e-4, -0.406775e-7, 0.289063e-11, 0.819898e-13, 0.468386e-14, -0.191182e-16] # cm^j · K · %^-1 26 | cTp = [ 0.778627e-6, 0.593296e-12, 0.145042e-14, 0.489815e-17, 0.327941e-19, 0.128020e-21] # cm^j · K · Pa^-1 27 | cHp = [-0.211676e-15, 0.487921e-20, -0.682545e-23, 0.942802e-25, -0.946422e-27, -0.153682e-29] # cm^j · %^-1 · Pa^-1 28 | σref = 1e4/4.8 # cm^−1 29 | Tref = 273.15+17.5 # K 30 | pref = 75000 # Pa 31 | Href = 10 #% 32 | 33 | # model 34 | def n(λ): 35 | σ = 1e4/λ # cm^-1 36 | n = 1 37 | for j in range(0, 6): 38 | n += ( cref[j] + cT[j]*(1/T-1/Tref) + cTT[j]*(1/T-1/Tref)**2 39 | + cH[j]*(H-Href) + cHH[j]*(H-Href)**2 40 | + cp[j]*(p-pref) + cpp[j]*(p-pref)**2 41 | + cTH[j]*(1/T-1/Tref)*(H-Href) 42 | + cTp[j]*(1/T-1/Tref)*(p-pref) 43 | + cHp[j]*(H-Href)*(p-pref) ) * (σ-σref)**j 44 | return n 45 | 46 | 47 | # output - modify code below the line to match your needs 48 | ############################################################################### 49 | 50 | λ = np.arange(4.35, 5.201, 0.01) 51 | n = n(λ) 52 | 53 | # write data file 54 | file = open('out.txt', 'w') 55 | for i in range(0, len(λ)): 56 | file.write('\n {:.2f} {:.12f}'.format(λ[i],n[i])) 57 | file.close() 58 | 59 | #plot n vs μm 60 | plt.rc('font', family='Arial', size='14') 61 | plt.figure() 62 | plt.plot(λ, n-1) 63 | plt.xlabel('Wavelength (μm)') 64 | plt.ylabel('n-1') 65 | -------------------------------------------------------------------------------- /scripts/Mathar 2007 - Air 7.5-14.1um.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-11-15 4 | # Original data: Mathar 2007, https://doi.org/10.1088/1464-4258/9/5/008 5 | 6 | ############################### 7.5-14.1 μm ################################### 7 | 8 | import numpy as np 9 | import matplotlib.pyplot as plt 10 | π = np.pi 11 | 12 | # adjustable parameters 13 | T = 273.15+15 # Temperature: K 14 | p = 101325 # Pressure: Pa 15 | H = 0 # Humidity: 0-100% 16 | 17 | # model parameters 18 | cref = [ 0.199885e-3, 0.344739e-9, -0.273714e-12, 0.393383e-15, -0.569488e-17, 0.164556e-19] # cm^j 19 | cT = [ 0.593900e-1, -0.172226e-5, 0.237654e-8, -0.381812e-11, 0.305050e-14, -0.157464e-16] # cm^j · K 20 | cTT = [-6.50355, 0.103830e-1, -0.139464e-4, 0.220077e-7, -0.272412e-10, 0.126364e-12] # cm^j · K^2 21 | cH = [-0.221938e-7, 0.347377e-10, -0.465991e-13, 0.735848e-16, -0.897119e-19, 0.380817e-21] # cm^j · %^-1 22 | cHH = [ 0.393524e-12, 0.464083e-15, -0.621764e-18, 0.981126e-21, -0.121384e-23, 0.515111e-26] # cm^j · %^-2 23 | cp = [ 0.266809e-8, 0.695247e-15, 0.159070e-17, -0.303451e-20, -0.661489e-22, 0.178226e-24] # cm^j · Pa^-1 24 | cpp = [ 0.610508e-17, 0.227694e-22, 0.786323e-25, -0.174448e-27, -0.359791e-29, 0.978307e-32] # cm^j · Pa^-2 25 | cTH = [ 0.106776e-3, -0.168516e-6, 0.226201e-9, -0.356457e-12, 0.437980e-15, -0.194545e-17] # cm^j · K · %^-1 26 | cTp = [ 0.77368e-6, 0.216404e-12, 0.581805e-15, -0.189618e-17, -0.198869e-19, 0.589381e-22] # cm^j · K · Pa^-1 27 | cHp = [-0.206365e-15, 0.300234e-19, -0.426519e-22, 0.684306e-25, -0.467320e-29, 0.126117e-30] # cm^j · %^-1 · Pa^-1 28 | σref = 1e4/10.1 # cm^−1 29 | Tref = 273.15+17.5 # K 30 | pref = 75000 # Pa 31 | Href = 10 #% 32 | 33 | # model 34 | def n(λ): 35 | σ = 1e4/λ # cm^-1 36 | n = 1 37 | for j in range(0, 6): 38 | n += ( cref[j] + cT[j]*(1/T-1/Tref) + cTT[j]*(1/T-1/Tref)**2 39 | + cH[j]*(H-Href) + cHH[j]*(H-Href)**2 40 | + cp[j]*(p-pref) + cpp[j]*(p-pref)**2 41 | + cTH[j]*(1/T-1/Tref)*(H-Href) 42 | + cTp[j]*(1/T-1/Tref)*(p-pref) 43 | + cHp[j]*(H-Href)*(p-pref) ) * (σ-σref)**j 44 | return n 45 | 46 | 47 | # output - modify code below the line to match your needs 48 | ############################################################################### 49 | 50 | λ = np.arange(7.5, 14.101, 0.05) 51 | n = n(λ) 52 | 53 | # write data file 54 | file = open('out.txt', 'w') 55 | for i in range(0, len(λ)): 56 | file.write('\n {:.2f} {:.12f}'.format(λ[i],n[i])) 57 | file.close() 58 | 59 | #plot n vs μm 60 | plt.rc('font', family='Arial', size='14') 61 | plt.figure() 62 | plt.plot(λ, n-1) 63 | plt.xlabel('Wavelength (μm)') 64 | plt.ylabel('n-1') 65 | -------------------------------------------------------------------------------- /scripts/Ninomiya 1995 - CdS-e.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-22 4 | # Original data: Ninomiya and Adachi 1995, https://doi.org/10.1063/1.360355 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | π = np.pi 9 | 10 | # model parameters 11 | 12 | E0B = 2.496 #eV 13 | E0C = 2.555 #eV 14 | G0 = 0.03 #eV 15 | 16 | A0B = 12.1 #eV**1.5 17 | A0C = 13.9 #eV**1.5 18 | 19 | A0xB= 0.042 #eV 20 | A0xC= 0.048 #eV 21 | 22 | Γ0B = 0.055 #eV 23 | Γ0C = 0.055 #eV 24 | 25 | E1xB= 5.40 #eV 26 | 27 | B1xB= 4.80 #eV 28 | 29 | Γ1B = 0.67 #eV 30 | 31 | E0pr= 6.3 #eV 32 | C = 0.10 33 | γ = 0.10 34 | 35 | εinf= 1.50 36 | 37 | def Epsilon_0(ħω): 38 | χ0 = (ħω+1j*Γ0B) / E0B 39 | fχ0 = χ0**-2 * ( 2-(1+χ0)**0.5-(1-χ0)**0.5 ) 40 | ε = A0B*E0B**-1.5 * fχ0 41 | χ0 = (ħω+1j*Γ0C) / E0C 42 | fχ0 = χ0**-2 * ( 2-(1+χ0)**0.5-(1-χ0)**0.5 ) 43 | ε += A0C*E0C**-1.5 * fχ0 44 | return ε 45 | 46 | def Epsilon_0x(ħω): 47 | ε = A0xB*(E0B-G0-ħω-1j*Γ0B)**-1 48 | ε += A0xC*(E0C-G0-ħω-1j*Γ0C)**-1 49 | return ε 50 | 51 | def Epsilon_1(ħω): 52 | ε = B1xB*(E1xB-ħω-1j*Γ1B)**-1 53 | return ε 54 | 55 | def Epsilon_0pr(ħω): 56 | χ = ħω/E0pr 57 | return C / (1 - χ**2 - 1j*χ*γ) 58 | 59 | 60 | ev_min=1.2 61 | ev_max=5.7 62 | npoints=500 63 | 64 | eV = np.linspace(ev_min, ev_max, npoints) 65 | μm = 4.13566733e-1*2.99792458/eV 66 | ε0 = Epsilon_0(eV) 67 | ε0x = Epsilon_0x(eV) 68 | ε1 = Epsilon_1(eV) 69 | ε0pr = Epsilon_0pr(eV) 70 | ε = ε0 + ε0x + ε1 + ε0pr + εinf 71 | n = (ε**.5).real 72 | k = (ε**.5).imag 73 | α = 4*π*k/μm*1e4 #1/cm 74 | 75 | 76 | #============================ DATA OUTPUT ================================= 77 | file = open('out.txt', 'w') 78 | for i in range(npoints-1, -1, -1): 79 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 80 | file.close() 81 | 82 | 83 | #=============================== PLOT ===================================== 84 | plt.rc('font', family='Arial', size='14') 85 | 86 | #plot ε vs eV 87 | plt.figure(1) 88 | plt.plot(eV, ε.real, label="ε1") 89 | plt.plot(eV, ε.imag, label="ε2") 90 | plt.xlabel('Photon energy (eV)') 91 | plt.ylabel('ε') 92 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 93 | 94 | #plot intermediate data (for debugging) 95 | plt.figure(2) 96 | plt.plot(eV, ε0.real, label="Re(ε0)") 97 | plt.plot(eV, ε0x.real, label="Re(ε0x)") 98 | plt.plot(eV, ε1.real, label="Re(ε1)") 99 | plt.plot(eV, ε0pr.real, label="Re(ε0')") 100 | plt.xlabel('Photon energy (eV)') 101 | plt.ylabel('ε') 102 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 103 | 104 | plt.figure(3) 105 | plt.plot(eV, ε0.imag, label="Im(ε0)") 106 | plt.plot(eV, ε0x.imag, label="Im(ε0x)") 107 | plt.plot(eV, ε1.imag, label="Im(ε1)") 108 | plt.plot(eV, ε0pr.imag, label="Im(ε0')") 109 | plt.xlabel('Photon energy (eV)') 110 | plt.ylabel('ε') 111 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 112 | 113 | #plot n,k vs eV 114 | plt.figure(4) 115 | plt.plot(eV, n, label="n") 116 | plt.plot(eV, k, label="k") 117 | plt.xlabel('Photon energy (eV)') 118 | plt.ylabel('n, k') 119 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 120 | 121 | #plot n,k vs μm 122 | plt.figure(5) 123 | plt.plot(μm, n, label="n") 124 | plt.plot(μm, k, label="k") 125 | plt.xlabel('Wavelength (μm)') 126 | plt.ylabel('n, k') 127 | plt.yscale('log') 128 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 129 | 130 | #plot α vs eV 131 | plt.figure(6) 132 | plt.plot(eV,α) 133 | plt.yscale('log') 134 | plt.ylim([1e3,1e7]) 135 | plt.xlabel('Photon energy (eV)') 136 | plt.ylabel('α (1/cm)') -------------------------------------------------------------------------------- /scripts/Ninomiya 1995 - CdS-o.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-22 4 | # Original data: Ninomiya and Adachi 1995, https://doi.org/10.1063/1.360355 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | π = np.pi 9 | 10 | # model parameters 11 | E0A = 2.482 #eV 12 | E0B = 2.496 #eV 13 | E0C = 2.555 #eV 14 | G0 = 0.03 #eV 15 | A0A = 13.0 #eV**1.5 16 | A0B = 6.6 #eV**1.5 17 | A0C = 6.4 #eV**1.5 18 | A0xA= 0.045 #eV 19 | A0xB= 0.023 #eV 20 | A0xC= 0.022 #eV 21 | Γ0A = 0.055 #eV 22 | Γ0B = 0.055 #eV 23 | Γ0C = 0.055 #eV 24 | 25 | E1xA= 4.84 #eV 26 | E1xB= 5.45 #eV 27 | B1xA= 1.60 #eV 28 | B1xB= 1.25 #eV 29 | Γ1A = 0.42 #eV 30 | Γ1B = 0.38 #eV 31 | 32 | E0pr= 6.2 #eV 33 | C = 0.30 34 | γ = 0.12 35 | 36 | εinf= 1.58 37 | 38 | def Epsilon_0(ħω): 39 | χ0 = (ħω+1j*Γ0A) / E0A 40 | fχ0 = χ0**-2 * ( 2-(1+χ0)**0.5-(1-χ0)**0.5 ) 41 | ε = A0A*E0A**-1.5 * fχ0 42 | χ0 = (ħω+1j*Γ0B) / E0B 43 | fχ0 = χ0**-2 * ( 2-(1+χ0)**0.5-(1-χ0)**0.5 ) 44 | ε += A0B*E0B**-1.5 * fχ0 45 | χ0 = (ħω+1j*Γ0C) / E0C 46 | fχ0 = χ0**-2 * ( 2-(1+χ0)**0.5-(1-χ0)**0.5 ) 47 | ε += A0C*E0C**-1.5 * fχ0 48 | return ε 49 | 50 | def Epsilon_0x(ħω): 51 | ε = A0xA*(E0A-G0-ħω-1j*Γ0A)**-1 52 | ε += A0xB*(E0B-G0-ħω-1j*Γ0B)**-1 53 | ε += A0xC*(E0C-G0-ħω-1j*Γ0C)**-1 54 | return ε 55 | 56 | def Epsilon_1(ħω): 57 | ε = B1xA*(E1xA-ħω-1j*Γ1A)**-1 58 | ε += B1xB*(E1xB-ħω-1j*Γ1B)**-1 59 | return ε 60 | 61 | def Epsilon_0pr(ħω): 62 | χ = ħω/E0pr 63 | return C / (1 - χ**2 - 1j*χ*γ) 64 | 65 | 66 | ev_min=1.2 67 | ev_max=5.7 68 | npoints=500 69 | 70 | eV = np.linspace(ev_min, ev_max, npoints) 71 | μm = 4.13566733e-1*2.99792458/eV 72 | ε0 = Epsilon_0(eV) 73 | ε0x = Epsilon_0x(eV) 74 | ε1 = Epsilon_1(eV) 75 | ε0pr = Epsilon_0pr(eV) 76 | ε = ε0 + ε0x + ε1 + ε0pr + εinf 77 | n = (ε**.5).real 78 | k = (ε**.5).imag 79 | α = 4*π*k/μm*1e4 #1/cm 80 | 81 | 82 | #============================ DATA OUTPUT ================================= 83 | file = open('out.txt', 'w') 84 | for i in range(npoints-1, -1, -1): 85 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 86 | file.close() 87 | 88 | 89 | #=============================== PLOT ===================================== 90 | plt.rc('font', family='Arial', size='14') 91 | 92 | #plot ε vs eV 93 | plt.figure(1) 94 | plt.plot(eV, ε.real, label="ε1") 95 | plt.plot(eV, ε.imag, label="ε2") 96 | plt.xlabel('Photon energy (eV)') 97 | plt.ylabel('ε') 98 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 99 | 100 | #plot intermediate data (for debugging) 101 | plt.figure(2) 102 | plt.plot(eV, ε0.real, label="Re(ε0)") 103 | plt.plot(eV, ε0x.real, label="Re(ε0x)") 104 | plt.plot(eV, ε1.real, label="Re(ε1)") 105 | plt.plot(eV, ε0pr.real, label="Re(ε0')") 106 | plt.xlabel('Photon energy (eV)') 107 | plt.ylabel('ε') 108 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 109 | 110 | plt.figure(3) 111 | plt.plot(eV, ε0.imag, label="Im(ε0)") 112 | plt.plot(eV, ε0x.imag, label="Im(ε0x)") 113 | plt.plot(eV, ε1.imag, label="Im(ε1)") 114 | plt.plot(eV, ε0pr.imag, label="Im(ε0')") 115 | plt.xlabel('Photon energy (eV)') 116 | plt.ylabel('ε') 117 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 118 | 119 | #plot n,k vs eV 120 | plt.figure(4) 121 | plt.plot(eV, n, label="n") 122 | plt.plot(eV, k, label="k") 123 | plt.xlabel('Photon energy (eV)') 124 | plt.ylabel('n, k') 125 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 126 | 127 | #plot n,k vs μm 128 | plt.figure(5) 129 | plt.plot(μm, n, label="n") 130 | plt.plot(μm, k, label="k") 131 | plt.xlabel('Wavelength (μm)') 132 | plt.ylabel('n, k') 133 | plt.yscale('log') 134 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 135 | 136 | #plot α vs eV 137 | plt.figure(6) 138 | plt.plot(eV,α) 139 | plt.yscale('log') 140 | plt.ylim([1e3,1e7]) 141 | plt.xlabel('Photon energy (eV)') 142 | plt.ylabel('α (1/cm)') -------------------------------------------------------------------------------- /scripts/Ninomiya 1995 - cubic CdSe.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-05-03 4 | # Original data: Ninomiya and Adachi 1995, https://doi.org/10.1063/1.359815 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | π = np.pi 9 | 10 | # model parameters from table III 11 | E0 = 1.74 #eV 12 | Δ0 = 2.15-E0 #eV 13 | G0 = 0.015 #eV 14 | A0 = 4.7 #eV**1.5 15 | A0x = 0.01 #eV 16 | Γ0 = 0.03 #eV 17 | 18 | E1 = 4.28 #eV 19 | Δ1 = 4.48-E1 #eV 20 | B1 = 3.0 #eV 21 | B1d = 1.5 #eV 22 | Γ1 = 0.50 #eV 23 | Γ1Δ = 0.90 #eV 24 | 25 | E2 = 6.08 #eV 26 | C = 1.4 27 | γ = 0.21 28 | 29 | εinf= 1.40 30 | 31 | def Epsilon_A(ħω): 32 | χ0 = (ħω+1j*Γ0) / E0 33 | χs0 = (ħω+1j*Γ0) / (E0+Δ0) 34 | fχ0 = χ0**-2 * ( 2-(1+χ0)**0.5-(1-χ0)**0.5 ) 35 | fχs0 = χs0**-2 * ( 2-(1+χs0)**0.5-(1-χs0)**0.5 ) 36 | return A0*E0**-1.5 * (2*fχ0+(E0/(E0+Δ0))**1.5*fχs0) 37 | 38 | def Epsilon_Ax(ħω): 39 | y=0 40 | for n in range(1,1000): 41 | y += A0x/n**3 * ( 2/(E0-G0/n**2-ħω-1j*Γ0) + 1/(E0+Δ0-G0/n**2-ħω-1j*Γ0) ) 42 | return y 43 | 44 | def Epsilon_B(ħω): 45 | return B1/(E1-ħω-1j*Γ1) + B1d/(E1+Δ1-ħω-1j*Γ1Δ) 46 | 47 | def Epsilon_C(ħω): 48 | χ2 = ħω/E2 49 | return C/((1-χ2**2)-1j*χ2*γ) 50 | 51 | ev_min=1.5 52 | ev_max=6 53 | npoints=500 54 | 55 | eV = np.linspace(ev_min, ev_max, npoints) 56 | μm = 4.13566733e-1*2.99792458/eV 57 | εA = Epsilon_A(eV) 58 | εAx = Epsilon_Ax(eV) 59 | εB = Epsilon_B(eV) 60 | εC = Epsilon_C(eV) 61 | ε = εA + εAx + εB + εC + εinf 62 | n = (ε**.5).real 63 | k = (ε**.5).imag 64 | α = 4*π*k/μm*1e4 #1/cm 65 | 66 | 67 | #============================ DATA OUTPUT ================================= 68 | file = open('out.txt', 'w') 69 | for i in range(npoints-1, -1, -1): 70 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 71 | file.close() 72 | 73 | 74 | #=============================== PLOT ===================================== 75 | plt.rc('font', family='Arial', size='14') 76 | 77 | #plot ε vs eV 78 | plt.figure(1) 79 | plt.plot(eV, ε.real, label="ε1") 80 | plt.plot(eV, ε.imag, label="ε2") 81 | plt.xlabel('Photon energy (eV)') 82 | plt.ylabel('ε') 83 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 84 | 85 | #plot intermediate data (for debugging) 86 | plt.figure(2) 87 | plt.plot(eV, εA.real, label="Re(εA)") 88 | plt.plot(eV, εAx.real, label="Re(εAx)") 89 | plt.plot(eV, εB.real, label="Re(εB)") 90 | plt.plot(eV, εC.real, label="Re(εC)") 91 | plt.xlabel('Photon energy (eV)') 92 | plt.ylabel('ε') 93 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 94 | 95 | plt.figure(3) 96 | plt.plot(eV, εA.imag, label="Im(εA)") 97 | plt.plot(eV, εAx.imag, label="Im(εAx)") 98 | plt.plot(eV, εB.imag, label="Im(εB)") 99 | plt.plot(eV, εC.imag, label="Im(εC)") 100 | plt.xlabel('Photon energy (eV)') 101 | plt.ylabel('ε') 102 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 103 | 104 | #plot n,k vs eV 105 | plt.figure(4) 106 | plt.plot(eV, n, label="n") 107 | plt.plot(eV, k, label="k") 108 | plt.xlabel('Photon energy (eV)') 109 | plt.ylabel('n, k') 110 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 111 | 112 | #plot n,k vs μm 113 | plt.figure(5) 114 | plt.plot(μm, n, label="n") 115 | plt.plot(μm, k, label="k") 116 | plt.xlabel('Wavelength (μm)') 117 | plt.ylabel('n, k') 118 | plt.yscale('log') 119 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 120 | 121 | #plot α vs eV 122 | plt.figure(6) 123 | plt.plot(eV,α) 124 | plt.yscale('log') 125 | plt.ylim([1e3,1e7]) 126 | plt.xlabel('Photon energy (eV)') 127 | plt.ylabel('α (1/cm)') -------------------------------------------------------------------------------- /scripts/Ninomiya 1995 - hexagonal CdSe-e.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-29 4 | # Original data: Ninomiya and Adachi 1995, https://doi.org/10.1063/1.359815 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | π = np.pi 9 | 10 | # model parameters 11 | 12 | E0B = 1.761 #eV 13 | E0C = 2.161 #eV 14 | G0 = 0.015 #eV 15 | A0B = 8.6 #eV**1.5 16 | A0C = 5.4 #eV**1.5 17 | A0xB= 0.020 #eV 18 | A0xC= 0.012 #eV 19 | Γ0B = 0.03 #eV 20 | Γ0C = 0.05 #eV 21 | 22 | E1C = 4.78 #eV 23 | B1C = 6.5 #eV 24 | Γ1C = 0.70 #eV 25 | 26 | E0pr= 6.0 #eV 27 | C = 0.10 28 | γ = 0.12 29 | 30 | εinf= 2.20 31 | 32 | def Epsilon_0(ħω): 33 | χ0 = (ħω+1j*Γ0B) / E0B 34 | fχ0 = χ0**-2 * ( 2-(1+χ0)**0.5-(1-χ0)**0.5 ) 35 | ε = A0B*E0B**-1.5 * fχ0 36 | χ0 = (ħω+1j*Γ0C) / E0C 37 | fχ0 = χ0**-2 * ( 2-(1+χ0)**0.5-(1-χ0)**0.5 ) 38 | ε += A0C*E0C**-1.5 * fχ0 39 | return ε 40 | 41 | def Epsilon_0x(ħω): 42 | ε = A0xB/(E0B-G0-ħω-1j*Γ0B) 43 | ε += A0xC/(E0C-G0-ħω-1j*Γ0C) 44 | return ε 45 | 46 | def Epsilon_1(ħω): 47 | ε = B1C/(E1C-ħω-1j*Γ1C) 48 | return ε 49 | 50 | def Epsilon_0pr(ħω): 51 | χ = ħω/E0pr 52 | return C / (1 - χ**2 - 1j*χ*γ) 53 | 54 | 55 | ev_min=1.2 56 | ev_max=5.3 57 | npoints=500 58 | 59 | eV = np.linspace(ev_min, ev_max, npoints) 60 | μm = 4.13566733e-1*2.99792458/eV 61 | ε0 = Epsilon_0(eV) 62 | ε0x = Epsilon_0x(eV) 63 | ε1 = Epsilon_1(eV) 64 | ε0pr = Epsilon_0pr(eV) 65 | ε = ε0 + ε0x + ε1 + ε0pr + εinf 66 | n = (ε**.5).real 67 | k = (ε**.5).imag 68 | α = 4*π*k/μm*1e4 #1/cm 69 | 70 | 71 | #============================ DATA OUTPUT ================================= 72 | file = open('out.txt', 'w') 73 | for i in range(npoints-1, -1, -1): 74 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 75 | file.close() 76 | 77 | 78 | #=============================== PLOT ===================================== 79 | plt.rc('font', family='Arial', size='14') 80 | 81 | #plot ε vs eV 82 | plt.figure(1) 83 | plt.plot(eV, ε.real, label="ε1") 84 | plt.plot(eV, ε.imag, label="ε2") 85 | plt.xlabel('Photon energy (eV)') 86 | plt.ylabel('ε') 87 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 88 | 89 | #plot intermediate data (for debugging) 90 | plt.figure(2) 91 | plt.plot(eV, ε0.real, label="Re(ε0)") 92 | plt.plot(eV, ε0x.real, label="Re(ε0x)") 93 | plt.plot(eV, ε1.real, label="Re(ε1)") 94 | plt.plot(eV, ε0pr.real, label="Re(ε0')") 95 | plt.xlabel('Photon energy (eV)') 96 | plt.ylabel('ε') 97 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 98 | 99 | plt.figure(3) 100 | plt.plot(eV, ε0.imag, label="Im(ε0)") 101 | plt.plot(eV, ε0x.imag, label="Im(ε0x)") 102 | plt.plot(eV, ε1.imag, label="Im(ε1)") 103 | plt.plot(eV, ε0pr.imag, label="Im(ε0')") 104 | plt.xlabel('Photon energy (eV)') 105 | plt.ylabel('ε') 106 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 107 | 108 | #plot n,k vs eV 109 | plt.figure(4) 110 | plt.plot(eV, n, label="n") 111 | plt.plot(eV, k, label="k") 112 | plt.xlabel('Photon energy (eV)') 113 | plt.ylabel('n, k') 114 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 115 | 116 | #plot n,k vs μm 117 | plt.figure(5) 118 | plt.plot(μm, n, label="n") 119 | plt.plot(μm, k, label="k") 120 | plt.xlabel('Wavelength (μm)') 121 | plt.ylabel('n, k') 122 | plt.yscale('log') 123 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 124 | 125 | #plot α vs eV 126 | plt.figure(6) 127 | plt.plot(eV,α) 128 | plt.yscale('log') 129 | plt.ylim([1e3,1e7]) 130 | plt.xlabel('Photon energy (eV)') 131 | plt.ylabel('α (1/cm)') -------------------------------------------------------------------------------- /scripts/Ninomiya 1995 - hexagonal CdSe-o.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-29 4 | # Original data: Ninomiya and Adachi 1995, https://doi.org/10.1063/1.359815 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | π = np.pi 9 | 10 | # model parameters 11 | E0A = 1.732 #eV 12 | E0B = 1.761 #eV 13 | E0C = 2.161 #eV 14 | G0 = 0.015 #eV 15 | A0A = 7.0 #eV**1.5 16 | A0B = 2.7 #eV**1.5 17 | A0C = 4.3 #eV**1.5 18 | A0xA= 0.016 #eV 19 | A0xB= 0.006 #eV 20 | A0xC= 0.010 #eV 21 | Γ0A = 0.03 #eV 22 | Γ0B = 0.03 #eV 23 | Γ0C = 0.06 #eV 24 | 25 | E1A = 4.10 #eV 26 | E1B = 4.55 #eV 27 | E1C = 4.85 #eV 28 | B1A = 0.36 #eV 29 | B1B = 3.6 #eV 30 | B1C = 0.90 #eV 31 | Γ1A = 0.18 #eV 32 | Γ1B = 0.80 #eV 33 | Γ1C = 0.40 #eV 34 | 35 | E0pr= 5.6 #eV 36 | C = 0.38 37 | γ = 0.12 38 | 39 | εinf= 2.20 40 | 41 | def Epsilon_0(ħω): 42 | χ0 = (ħω+1j*Γ0A) / E0A 43 | fχ0 = χ0**-2 * ( 2-(1+χ0)**0.5-(1-χ0)**0.5 ) 44 | ε = A0A*E0A**-1.5 * fχ0 45 | χ0 = (ħω+1j*Γ0B) / E0B 46 | fχ0 = χ0**-2 * ( 2-(1+χ0)**0.5-(1-χ0)**0.5 ) 47 | ε += A0B*E0B**-1.5 * fχ0 48 | χ0 = (ħω+1j*Γ0C) / E0C 49 | fχ0 = χ0**-2 * ( 2-(1+χ0)**0.5-(1-χ0)**0.5 ) 50 | ε += A0C*E0C**-1.5 * fχ0 51 | return ε 52 | 53 | def Epsilon_0x(ħω): 54 | ε = A0xA/(E0A-G0-ħω-1j*Γ0A) 55 | ε += A0xB/(E0B-G0-ħω-1j*Γ0B) 56 | ε += A0xC/(E0C-G0-ħω-1j*Γ0C) 57 | return ε 58 | 59 | def Epsilon_1(ħω): 60 | ε = B1A/(E1A-ħω-1j*Γ1A) 61 | ε += B1B/(E1B-ħω-1j*Γ1B) 62 | ε += B1C/(E1C-ħω-1j*Γ1C) 63 | return ε 64 | 65 | def Epsilon_0pr(ħω): 66 | χ = ħω/E0pr 67 | return C / (1 - χ**2 - 1j*χ*γ) 68 | 69 | 70 | ev_min=1.2 71 | ev_max=5.3 72 | npoints=500 73 | 74 | eV = np.linspace(ev_min, ev_max, npoints) 75 | μm = 4.13566733e-1*2.99792458/eV 76 | ε0 = Epsilon_0(eV) 77 | ε0x = Epsilon_0x(eV) 78 | ε1 = Epsilon_1(eV) 79 | ε0pr = Epsilon_0pr(eV) 80 | ε = ε0 + ε0x + ε1 + ε0pr + εinf 81 | n = (ε**.5).real 82 | k = (ε**.5).imag 83 | α = 4*π*k/μm*1e4 #1/cm 84 | 85 | 86 | #============================ DATA OUTPUT ================================= 87 | file = open('out.txt', 'w') 88 | for i in range(npoints-1, -1, -1): 89 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 90 | file.close() 91 | 92 | 93 | #=============================== PLOT ===================================== 94 | plt.rc('font', family='Arial', size='14') 95 | 96 | #plot ε vs eV 97 | plt.figure(1) 98 | plt.plot(eV, ε.real, label="ε1") 99 | plt.plot(eV, ε.imag, label="ε2") 100 | plt.xlabel('Photon energy (eV)') 101 | plt.ylabel('ε') 102 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 103 | 104 | #plot intermediate data (for debugging) 105 | plt.figure(2) 106 | plt.plot(eV, ε0.real, label="Re(ε0)") 107 | plt.plot(eV, ε0x.real, label="Re(ε0x)") 108 | plt.plot(eV, ε1.real, label="Re(ε1)") 109 | plt.plot(eV, ε0pr.real, label="Re(ε0')") 110 | plt.xlabel('Photon energy (eV)') 111 | plt.ylabel('ε') 112 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 113 | 114 | plt.figure(3) 115 | plt.plot(eV, ε0.imag, label="Im(ε0)") 116 | plt.plot(eV, ε0x.imag, label="Im(ε0x)") 117 | plt.plot(eV, ε1.imag, label="Im(ε1)") 118 | plt.plot(eV, ε0pr.imag, label="Im(ε0')") 119 | plt.xlabel('Photon energy (eV)') 120 | plt.ylabel('ε') 121 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 122 | 123 | #plot n,k vs eV 124 | plt.figure(4) 125 | plt.plot(eV, n, label="n") 126 | plt.plot(eV, k, label="k") 127 | plt.xlabel('Photon energy (eV)') 128 | plt.ylabel('n, k') 129 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 130 | 131 | #plot n,k vs μm 132 | plt.figure(5) 133 | plt.plot(μm, n, label="n") 134 | plt.plot(μm, k, label="k") 135 | plt.xlabel('Wavelength (μm)') 136 | plt.ylabel('n, k') 137 | plt.yscale('log') 138 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 139 | 140 | #plot α vs eV 141 | plt.figure(6) 142 | plt.plot(eV,α) 143 | plt.yscale('log') 144 | plt.ylim([1e3,1e7]) 145 | plt.xlabel('Photon energy (eV)') 146 | plt.ylabel('α (1/cm)') -------------------------------------------------------------------------------- /scripts/Ozaki 1993 - ZnS.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-12 4 | # Original data: Ozaki and Adachi 1993, https://doi.org/10.1143/JJAP.32.5008 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | π = np.pi 9 | 10 | # model parameters from table I 11 | E0 = 3.75 #eV 12 | Δ0 = 3.82-E0 #eV 13 | A = 32.0 #eV**1.5 14 | A0x = 0.07 #eV**-1 15 | G0 = 0.040 #eV 16 | Γ0 = 0.07 #eV 17 | 18 | E1minusG1=5.74 #eV 19 | B1x = 4.3 #eV 20 | Γ1 = 0.48 #eV 21 | 22 | E2 = 7.0 #eV 23 | C = 0.25 24 | γ = 0.06 25 | 26 | εinf = 2.35 27 | 28 | 29 | def Epsilon_A(ħω): 30 | χ0 = (ħω + 1j*Γ0) / E0 31 | χs0 = (ħω + 1j*Γ0) / (E0+Δ0) 32 | fχ0 = χ0**-2 * ( 2 -(1+χ0)**0.5 - (1-χ0)**0.5 ) 33 | fχs0 = χs0**-2 * ( 2 - (1+χs0)**0.5 - (1-χs0)**0.5 ) 34 | return A*E0**-1.5 * (fχ0+0.5*(E0/(E0+Δ0))**1.5*fχs0) 35 | 36 | def Epsilon_Ax(ħω): 37 | y=0 38 | for n in range(1,1000): 39 | y += A0x/n**3 * ( 1/(E0-G0/n**2-ħω-1j*Γ0) + 0.5/(E0+Δ0-G0/n**2-ħω-1j*Γ0) ) 40 | return y 41 | 42 | def Epsilon_Bx(ħω): 43 | return B1x/(E1minusG1-ħω-1j*Γ1) 44 | 45 | def Epsilon_C(ħω): 46 | χ2 = ħω/E2 47 | return C/((1-χ2**2)-1j*χ2*γ) 48 | 49 | 50 | ev_min = 1.2 51 | ev_max = 5.6 52 | npoints = 500 53 | eV = np.linspace(ev_min, ev_max, npoints) 54 | μm = 4.13566733e-1*2.99792458/eV 55 | εA = Epsilon_A(eV) 56 | εAx = Epsilon_Ax(eV) 57 | εBx = Epsilon_Bx(eV) 58 | εC = Epsilon_C(eV) 59 | ε = εA + εAx + εBx + εC + εinf 60 | n = (ε**.5).real 61 | k = (ε**.5).imag 62 | α = 4*π*k/μm*1e4 #1/cm 63 | 64 | 65 | #============================ DATA OUTPUT ================================= 66 | file = open('out.txt', 'w') 67 | for i in range(npoints-1, -1, -1): 68 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 69 | file.close() 70 | 71 | 72 | #=============================== PLOT ===================================== 73 | plt.rc('font', family='Arial', size='14') 74 | 75 | #plot ε vs eV 76 | plt.figure(1) 77 | plt.plot(eV, ε.real, label="ε1") 78 | plt.plot(eV, ε.imag, label="ε2") 79 | plt.xlabel('Photon energy (eV)') 80 | plt.ylabel('ε') 81 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 82 | 83 | #plot intermediate data (for debugging) 84 | plt.figure(2) 85 | plt.plot(eV, εA.real, label="Re(εA)") 86 | plt.plot(eV, εAx.real, label="Re(εAx)") 87 | plt.plot(eV, εBx.real, label="Re(εBx)") 88 | plt.plot(eV, εC.real, label="Re(εC)") 89 | plt.xlabel('Photon energy (eV)') 90 | plt.ylabel('ε') 91 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 92 | 93 | plt.figure(3) 94 | plt.plot(eV, εA.imag, label="Im(εA)") 95 | plt.plot(eV, εAx.imag, label="Im(εAx)") 96 | plt.plot(eV, εBx.imag, label="Im(εBx)") 97 | plt.plot(eV, εC.imag, label="Re(εC)") 98 | plt.xlabel('Photon energy (eV)') 99 | plt.ylabel('ε') 100 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 101 | 102 | #plot n,k vs eV 103 | plt.figure(4) 104 | plt.plot(eV, n, label="n") 105 | plt.plot(eV, k, label="k") 106 | plt.xlabel('Photon energy (eV)') 107 | plt.ylabel('n, k') 108 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 109 | 110 | #plot n,k vs μm 111 | plt.figure(5) 112 | plt.plot(μm, n, label="n") 113 | plt.plot(μm, k, label="k") 114 | plt.xlabel('Wavelength (μm)') 115 | plt.ylabel('n, k') 116 | plt.xscale('log') 117 | plt.yscale('log') 118 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 119 | 120 | #plot α vs eV 121 | plt.figure(6) 122 | plt.plot(eV,α) 123 | plt.yscale('log') 124 | plt.ylim([1e3,1e7]) 125 | plt.xlabel('Photon energy (eV)') 126 | plt.ylabel('α (1/cm)') -------------------------------------------------------------------------------- /scripts/Rakic 1996 - AlAs.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-10 4 | # Original data: Rakić and Majewski 1996, https://doi.org/10.1063/1.363586 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # model parameters 10 | E0 = 2.993 #eV 11 | Δ0 = 3.201-E0#eV 12 | E1 = 3.888 #eV 13 | Δ1 = 4.087-E1#eV 14 | 15 | εinf = 0.002 16 | 17 | A = 18.0 #eV**1.5 18 | Γ0 = 0.046 #eV 19 | α0 = 1.11 20 | 21 | B1 = 3.50 22 | B1s = 0.11 23 | B1x = 0.69 24 | B2x = 0.82 25 | Γ1 = 0.11 #eV 26 | α1 = 0.01 27 | 28 | f0pr = 2.78 #eV (not eV**2!!!) 29 | Γ0pr = 0.35 #eV 30 | E0pr = 4.64 #eV 31 | 32 | f2x = 2.88 #eV (not eV**2!!!) 33 | Γ2x = 0.53 #eV 34 | E2x = 4.73 #eV 35 | 36 | f2Σ = 7.04 #eV (not eV**2!!!) 37 | Γ2Σ = 0.65 #eV 38 | E2Σ = 4.89 #eV 39 | 40 | α2 = 0.27 41 | 42 | 43 | def Epsilon_I(ħω): 44 | Γ = Γ0*np.exp(-α0*((ħω-E0)/Γ0)**2) 45 | χ0 = (ħω + 1j*Γ) / E0 + 1e-100j #1e-100j: to avoid ambiguity in (1-χ)**0.5 46 | χ0s = (ħω + 1j*Γ) / (E0+Δ0) + 1e-100j #1e-100j: --"-- 47 | fχ0 = χ0**-2 * ( 2 - (1+χ0)**0.5 - (1-χ0)**0.5 ) 48 | fχ0s = χ0s**-2 * ( 2 - (1+χ0s)**0.5 - (1-χ0s)**0.5 ) 49 | return A*E0**-1.5 * (fχ0+0.5*(E0/(E0+Δ0))**1.5*fχ0s) 50 | 51 | def Epsilon_II(ħω): 52 | Γ = Γ1*np.exp(-α1*((ħω-E1)/Γ1)**2) 53 | χ1 = (ħω + 1j*Γ) / E1 54 | χ1s = (ħω + 1j*Γ) / (E1+Δ1) 55 | return -B1*χ1**-2*np.log(1-χ1**2) - B1s*χ1s**-2*np.log(1-χ1s**2) 56 | 57 | def Epsilon_III(ħω): 58 | Γ = Γ1*np.exp(-α1*((ħω-E1)/Γ1)**2) 59 | y=0 60 | for n in range(1,1000): 61 | y += 1/(2*n-1)**3 * ( B1x/(E1-ħω-1j*Γ) + B2x/(E1+Δ1-ħω-1j*Γ) ) 62 | return y 63 | 64 | def Epsilon_IV(ħω): 65 | Γ = Γ0pr*np.exp(-α2*((ħω-E0pr)/Γ0pr)**2) 66 | ε0pr = f0pr**2 / (E0pr**2 - ħω**2 - 1j*ħω*Γ) 67 | Γ = Γ2x*np.exp(-α2*((ħω-E2x)/Γ2x)**2) 68 | ε2x = f2x**2 / (E2x**2 - ħω**2 - 1j*ħω*Γ) 69 | Γ = Γ2Σ*np.exp(-α2*((ħω-E2Σ)/Γ2Σ)**2) 70 | ε2Σ = f2Σ**2 / (E2Σ**2 - ħω**2 - 1j*ħω*Γ) 71 | return εinf + ε0pr + ε2x + ε2Σ 72 | 73 | 74 | ev_min=0.5 75 | ev_max=5.6 76 | npoints=200 77 | eV = np.linspace(ev_min, ev_max, npoints) 78 | μm = 4.13566733e-1*2.99792458/eV 79 | ε = Epsilon_I(eV) + Epsilon_II(eV) + Epsilon_III(eV) + Epsilon_IV(eV) 80 | n = (ε**.5).real 81 | k = (ε**.5).imag 82 | 83 | 84 | #============================ DATA OUTPUT ================================= 85 | file = open('out.txt', 'w') 86 | for i in range(npoints-1, -1, -1): 87 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 88 | file.close() 89 | 90 | 91 | #=============================== PLOT ===================================== 92 | plt.rc('font', family='Arial', size='14') 93 | 94 | #plot ε vs eV 95 | plt.figure(1) 96 | plt.plot(eV, ε.real, label="ε1") 97 | plt.plot(eV, ε.imag, label="ε2") 98 | plt.xlabel('Photon energy (eV)') 99 | plt.ylabel('ε') 100 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 101 | 102 | #plot n,k vs eV 103 | plt.figure(2) 104 | plt.plot(eV, n, label="n") 105 | plt.plot(eV, k, label="k") 106 | plt.xlabel('Photon energy (eV)') 107 | plt.ylabel('n, k') 108 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 109 | 110 | #plot n,k vs μm 111 | plt.figure(3) 112 | plt.plot(μm, n, label="n") 113 | plt.plot(μm, k, label="k") 114 | plt.xlabel('Wavelength (μm)') 115 | plt.ylabel('n, k') 116 | plt.xscale('log') 117 | plt.yscale('log') 118 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1996 - GaAs.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-09 4 | # Original data: Rakić and Majewski 1996, https://doi.org/10.1063/1.363586 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # model parameters 10 | E0 = 1.410 #eV 11 | Δ0 = 1.746-E0#eV 12 | E1 = 2.926 #eV 13 | Δ1 = 3.170-E1#eV 14 | 15 | εinf = 0.77 16 | 17 | A = 3.97 #eV**1.5 18 | Γ0 = 0.039 #eV 19 | α0 = 1.65 20 | 21 | B1 = 4.15 22 | B1s = 1.54 23 | B1x = 1.39 24 | B2x = 0.56 25 | Γ1 = 0.15 #eV 26 | α1 = 0.01 27 | 28 | f0pr = 3.89 #eV (not eV**2!!!) 29 | Γ0pr = 0.55 #eV 30 | E0pr = 4.49 #eV 31 | 32 | f2x = 6.05 #eV (not eV**2!!!) 33 | Γ2x = 0.68 #eV 34 | E2x = 4.74 #eV 35 | 36 | f2Σ = 2.62 #eV (not eV**2!!!) 37 | Γ2Σ = 0.26 #eV 38 | E2Σ = 4.88 #eV 39 | 40 | α2 = 0.060 41 | 42 | 43 | def Epsilon_I(ħω): 44 | Γ = Γ0*np.exp(-α0*((ħω-E0)/Γ0)**2) 45 | χ0 = (ħω + 1j*Γ) / E0 + 1e-100j #1e-100j: to avoid ambiguity in (1-χ)**0.5 46 | χ0s = (ħω + 1j*Γ) / (E0+Δ0) + 1e-100j #1e-100j: --"-- 47 | fχ0 = χ0**-2 * ( 2 - (1+χ0)**0.5 - (1-χ0)**0.5 ) 48 | fχ0s = χ0s**-2 * ( 2 - (1+χ0s)**0.5 - (1-χ0s)**0.5 ) 49 | return A*E0**-1.5 * (fχ0+0.5*(E0/(E0+Δ0))**1.5*fχ0s) 50 | 51 | def Epsilon_II(ħω): 52 | Γ = Γ1*np.exp(-α1*((ħω-E1)/Γ1)**2) 53 | χ1 = (ħω + 1j*Γ) / E1 54 | χ1s = (ħω + 1j*Γ) / (E1+Δ1) 55 | return -B1*χ1**-2*np.log(1-χ1**2) - B1s*χ1s**-2*np.log(1-χ1s**2) 56 | 57 | def Epsilon_III(ħω): 58 | Γ = Γ1*np.exp(-α1*((ħω-E1)/Γ1)**2) 59 | y=0 60 | for n in range(1,1000): 61 | y += 1/(2*n-1)**3 * ( B1x/(E1-ħω-1j*Γ) + B2x/(E1+Δ1-ħω-1j*Γ) ) 62 | return y 63 | 64 | def Epsilon_IV(ħω): 65 | Γ = Γ0pr*np.exp(-α2*((ħω-E0pr)/Γ0pr)**2) 66 | ε0pr = f0pr**2 / (E0pr**2 - ħω**2 - 1j*ħω*Γ) 67 | Γ = Γ2x*np.exp(-α2*((ħω-E2x)/Γ2x)**2) 68 | ε2x = f2x**2 / (E2x**2 - ħω**2 - 1j*ħω*Γ) 69 | Γ = Γ2Σ*np.exp(-α2*((ħω-E2Σ)/Γ2Σ)**2) 70 | ε2Σ = f2Σ**2 / (E2Σ**2 - ħω**2 - 1j*ħω*Γ) 71 | return εinf + ε0pr + ε2x + ε2Σ 72 | 73 | 74 | ev_min=0.1 75 | ev_max=6 76 | npoints=200 77 | eV = np.linspace(ev_min, ev_max, npoints) 78 | μm = 4.13566733e-1*2.99792458/eV 79 | ε = Epsilon_I(eV) + Epsilon_II(eV) + Epsilon_III(eV) + Epsilon_IV(eV) 80 | n = (ε**.5).real 81 | k = (ε**.5).imag 82 | 83 | 84 | #============================ DATA OUTPUT ================================= 85 | file = open('out.txt', 'w') 86 | for i in range(npoints-1, -1, -1): 87 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 88 | file.close() 89 | 90 | 91 | #=============================== PLOT ===================================== 92 | plt.rc('font', family='Arial', size='14') 93 | 94 | #plot ε vs eV 95 | plt.figure(1) 96 | plt.plot(eV, ε.real, label="ε1") 97 | plt.plot(eV, ε.imag, label="ε2") 98 | plt.xlabel('Photon energy (eV)') 99 | plt.ylabel('ε') 100 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 101 | 102 | #plot n,k vs eV 103 | plt.figure(2) 104 | plt.plot(eV, n, label="n") 105 | plt.plot(eV, k, label="k") 106 | plt.xlabel('Photon energy (eV)') 107 | plt.ylabel('n, k') 108 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 109 | 110 | #plot n,k vs μm 111 | plt.figure(3) 112 | plt.plot(μm, n, label="n") 113 | plt.plot(μm, k, label="k") 114 | plt.xlabel('Wavelength (μm)') 115 | plt.ylabel('n, k') 116 | plt.xscale('log') 117 | plt.yscale('log') 118 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Ag (BB model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | from scipy.special import wofz as w 9 | π = np.pi 10 | 11 | # Brendel-Bormann (BB) model parameters 12 | ωp = 9.01 #eV 13 | f0 = 0.821 14 | Γ0 = 0.049 #eV 15 | 16 | f1 = 0.050 17 | Γ1 = 0.189 #eV 18 | ω1 = 2.025 #eV 19 | σ1 = 1.894 #eV 20 | 21 | f2 = 0.133 22 | Γ2 = 0.067 #eV 23 | ω2 = 5.185 #eV 24 | σ2 = 0.665 #eV 25 | 26 | f3 = 0.051 27 | Γ3 = 0.019 #eV 28 | ω3 = 4.343 #eV 29 | σ3 = 0.189 #eV 30 | 31 | f4 = 0.467 32 | Γ4 = 0.117 #eV 33 | ω4 = 9.809 #eV 34 | σ4 = 1.170 #eV 35 | 36 | f5 = 4.000 37 | Γ5 = 0.052 #eV 38 | ω5 = 18.56 #eV 39 | σ5 = 0.516 #eV 40 | 41 | Ωp = f0**.5 * ωp #eV 42 | 43 | def BB(ω): #ω: eV 44 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 45 | 46 | α = (ω**2+1j*ω*Γ1)**.5 47 | za = (α-ω1)/(2**.5*σ1) 48 | zb = (α+ω1)/(2**.5*σ1) 49 | ε += 1j*π**.5*f1*ωp**2 / (2**1.5*α*σ1) * (w(za)+w(zb)) #χ1 50 | 51 | α = (ω**2+1j*ω*Γ2)**.5 52 | za = (α-ω2)/(2**.5*σ2) 53 | zb = (α+ω2)/(2**.5*σ2) 54 | ε += 1j*π**.5*f2*ωp**2 / (2**1.5*α*σ2) * (w(za)+w(zb)) #χ2 55 | 56 | α = (ω**2+1j*ω*Γ3)**.5 57 | za = (α-ω3)/(2**.5*σ3) 58 | zb = (α+ω3)/(2**.5*σ3) 59 | ε += 1j*π**.5*f3*ωp**2 / (2**1.5*α*σ3) * (w(za)+w(zb)) #χ3 60 | 61 | α = (ω**2+1j*ω*Γ4)**.5 62 | za = (α-ω4)/(2**.5*σ4) 63 | zb = (α+ω4)/(2**.5*σ4) 64 | ε += 1j*π**.5*f4*ωp**2 / (2**1.5*α*σ4) * (w(za)+w(zb)) #χ4 65 | 66 | α = (ω**2+1j*ω*Γ5)**.5 67 | za = (α-ω5)/(2**.5*σ5) 68 | zb = (α+ω5)/(2**.5*σ5) 69 | ε += 1j*π**.5*f5*ωp**2 / (2**1.5*α*σ5) * (w(za)+w(zb)) #χ5 70 | 71 | return ε 72 | 73 | ev_min=0.1 74 | ev_max=5 75 | npoints=200 76 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 77 | μm = 4.13566733e-1*2.99792458/eV 78 | ε = BB(eV) 79 | n = (ε**.5).real 80 | k = (ε**.5).imag 81 | 82 | 83 | #============================ DATA OUTPUT ================================= 84 | file = open('out.txt', 'w') 85 | for i in range(npoints-1, -1, -1): 86 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 87 | file.close() 88 | 89 | 90 | #=============================== PLOT ===================================== 91 | plt.rc('font', family='Arial', size='14') 92 | 93 | plt.figure(1) 94 | plt.plot(eV, -ε.real, label="ε1") 95 | plt.plot(eV, ε.imag, label="ε2") 96 | plt.xlabel('Photon energy (eV)') 97 | plt.ylabel('ε') 98 | plt.xscale('log') 99 | plt.yscale('log') 100 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 101 | 102 | #plot n,k vs eV 103 | plt.figure(2) 104 | plt.plot(eV, n, label="n") 105 | plt.plot(eV, k, label="k") 106 | plt.xlabel('Photon energy (eV)') 107 | plt.ylabel('n, k') 108 | plt.yscale('log') 109 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 110 | 111 | #plot n,k vs μm 112 | plt.figure(3) 113 | plt.plot(μm, n, label="n") 114 | plt.plot(μm, k, label="k") 115 | plt.xlabel('Wavelength (μm)') 116 | plt.ylabel('n, k') 117 | plt.xscale('log') 118 | plt.yscale('log') 119 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Ag (LD model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # Lorentz-Drude (LD) model parameters 10 | ωp = 9.01 #eV 11 | f0 = 0.845 12 | Γ0 = 0.048 #eV 13 | 14 | f1 = 0.065 15 | Γ1 = 3.886 #eV 16 | ω1 = 0.816 #eV 17 | 18 | f2 = 0.124 19 | Γ2 = 0.452 #eV 20 | ω2 = 4.481 #eV 21 | 22 | f3 = 0.011 23 | Γ3 = 0.065 #eV 24 | ω3 = 8.185 #eV 25 | 26 | f4 = 0.840 27 | Γ4 = 0.916 #eV 28 | ω4 = 9.083 #eV 29 | 30 | f5 = 5.646 31 | Γ5 = 2.419 #eV 32 | ω5 = 20.29 #eV 33 | 34 | Ωp = f0**.5 * ωp #eV 35 | 36 | def LD(ω): #ω: eV 37 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 38 | ε += f1*ωp**2 / ((ω1**2-ω**2)-1j*ω*Γ1) 39 | ε += f2*ωp**2 / ((ω2**2-ω**2)-1j*ω*Γ2) 40 | ε += f3*ωp**2 / ((ω3**2-ω**2)-1j*ω*Γ3) 41 | ε += f4*ωp**2 / ((ω4**2-ω**2)-1j*ω*Γ4) 42 | ε += f5*ωp**2 / ((ω5**2-ω**2)-1j*ω*Γ5) 43 | return ε 44 | 45 | ev_min=0.1 46 | ev_max=5 47 | npoints=200 48 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 49 | μm = 4.13566733e-1*2.99792458/eV 50 | ε = LD(eV) 51 | n = (ε**.5).real 52 | k = (ε**.5).imag 53 | 54 | #============================ DATA OUTPUT ================================= 55 | file = open('out.txt', 'w') 56 | for i in range(npoints-1, -1, -1): 57 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 58 | file.close() 59 | 60 | 61 | #=============================== PLOT ===================================== 62 | plt.rc('font', family='Arial', size='14') 63 | 64 | plt.figure(1) 65 | plt.plot(eV, -ε.real, label="-ε1") 66 | plt.plot(eV, ε.imag, label="ε2") 67 | plt.xlabel('Photon energy (eV)') 68 | plt.ylabel('ε') 69 | plt.xscale('log') 70 | plt.yscale('log') 71 | plt.xlim([0.1,5]) 72 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 73 | 74 | #plot n,k vs eV 75 | plt.figure(2) 76 | plt.plot(eV, n, label="n") 77 | plt.plot(eV, k, label="k") 78 | plt.xlabel('Photon energy (eV)') 79 | plt.ylabel('n, k') 80 | plt.yscale('log') 81 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 82 | 83 | #plot n,k vs μm 84 | plt.figure(3) 85 | plt.plot(μm, n, label="n") 86 | plt.plot(μm, k, label="k") 87 | plt.xlabel('Wavelength (μm)') 88 | plt.ylabel('n, k') 89 | plt.xscale('log') 90 | plt.yscale('log') 91 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Al (BB model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | from scipy.special import wofz as w 9 | π = np.pi 10 | 11 | # Brendel-Bormann (BB) model parameters 12 | ωp = 14.98 #eV 13 | f0 = 0.526 14 | Γ0 = 0.047 #eV 15 | 16 | f1 = 0.213 17 | Γ1 = 0.312 #eV 18 | ω1 = 0.163 #eV 19 | σ1 = 0.013 #eV 20 | 21 | f2 = 0.060 22 | Γ2 = 0.315 #eV 23 | ω2 = 1.561 #eV 24 | σ2 = 0.042 #eV 25 | 26 | f3 = 0.182 27 | Γ3 = 1.587 #eV 28 | ω3 = 1.827 #eV 29 | σ3 = 0.256 #eV 30 | 31 | f4 = 0.014 32 | Γ4 = 2.145 #eV 33 | ω4 = 4.495 #eV 34 | σ4 = 1.735 #eV 35 | 36 | Ωp = f0**.5 * ωp #eV 37 | 38 | def BB(ω): #ω: eV 39 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 40 | 41 | α = (ω**2+1j*ω*Γ1)**.5 42 | za = (α-ω1)/(2**.5*σ1) 43 | zb = (α+ω1)/(2**.5*σ1) 44 | ε += 1j*π**.5*f1*ωp**2 / (2**1.5*α*σ1) * (w(za)+w(zb)) #χ1 45 | 46 | α = (ω**2+1j*ω*Γ2)**.5 47 | za = (α-ω2)/(2**.5*σ2) 48 | zb = (α+ω2)/(2**.5*σ2) 49 | ε += 1j*π**.5*f2*ωp**2 / (2**1.5*α*σ2) * (w(za)+w(zb)) #χ2 50 | 51 | α = (ω**2+1j*ω*Γ3)**.5 52 | za = (α-ω3)/(2**.5*σ3) 53 | zb = (α+ω3)/(2**.5*σ3) 54 | ε += 1j*π**.5*f3*ωp**2 / (2**1.5*α*σ3) * (w(za)+w(zb)) #χ3 55 | 56 | α = (ω**2+1j*ω*Γ4)**.5 57 | za = (α-ω4)/(2**.5*σ4) 58 | zb = (α+ω4)/(2**.5*σ4) 59 | ε += 1j*π**.5*f4*ωp**2 / (2**1.5*α*σ4) * (w(za)+w(zb)) #χ4 60 | 61 | return ε 62 | 63 | ev_min=0.005 64 | ev_max=20 65 | npoints=200 66 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 67 | μm = 4.13566733e-1*2.99792458/eV 68 | ε = BB(eV) 69 | n = (ε**.5).real 70 | k = (ε**.5).imag 71 | 72 | 73 | #============================ DATA OUTPUT ================================= 74 | file = open('out.txt', 'w') 75 | for i in range(npoints-1, -1, -1): 76 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 77 | file.close() 78 | 79 | 80 | #=============================== PLOT ===================================== 81 | plt.rc('font', family='Arial', size='14') 82 | 83 | plt.figure(1) 84 | plt.plot(eV, -ε.real, label="-ε1") 85 | plt.plot(eV, ε.imag, label="ε2") 86 | plt.xlabel('Photon energy (eV)') 87 | plt.ylabel('ε') 88 | plt.xscale('log') 89 | plt.yscale('log') 90 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 91 | 92 | #plot n,k vs eV 93 | plt.figure(2) 94 | plt.plot(eV, n, label="n") 95 | plt.plot(eV, k, label="k") 96 | plt.xlabel('Photon energy (eV)') 97 | plt.ylabel('n, k') 98 | plt.yscale('log') 99 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 100 | 101 | #plot n,k vs μm 102 | plt.figure(3) 103 | plt.plot(μm, n, label="n") 104 | plt.plot(μm, k, label="k") 105 | plt.xlabel('Wavelength (μm)') 106 | plt.ylabel('n, k') 107 | plt.xscale('log') 108 | plt.yscale('log') 109 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Al (LD model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # Lorentz-Drude (LD) model parameters 10 | ωp = 14.98 #eV 11 | f0 = 0.523 12 | Γ0 = 0.047 #eV 13 | 14 | f1 = 0.227 15 | Γ1 = 0.333 #eV 16 | ω1 = 0.162 #eV 17 | 18 | f2 = 0.050 19 | Γ2 = 0.312 #eV 20 | ω2 = 1.544 #eV 21 | 22 | f3 = 0.166 23 | Γ3 = 1.351 #eV 24 | ω3 = 1.808 #eV 25 | 26 | f4 = 0.030 27 | Γ4 = 3.382 #eV 28 | ω4 = 3.473 #eV 29 | 30 | Ωp = f0**.5 * ωp #eV 31 | 32 | def LD(ω): #ω: eV 33 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 34 | ε += f1*ωp**2 / ((ω1**2-ω**2)-1j*ω*Γ1) 35 | ε += f2*ωp**2 / ((ω2**2-ω**2)-1j*ω*Γ2) 36 | ε += f3*ωp**2 / ((ω3**2-ω**2)-1j*ω*Γ3) 37 | ε += f4*ωp**2 / ((ω4**2-ω**2)-1j*ω*Γ4) 38 | return ε 39 | 40 | ev_min=0.005 41 | ev_max=20 42 | npoints=1000 43 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 44 | μm = 4.13566733e-1*2.99792458/eV 45 | ε = LD(eV) 46 | n = (ε**.5).real 47 | k = (ε**.5).imag 48 | 49 | #============================ DATA OUTPUT ================================= 50 | file = open('out.txt', 'w') 51 | for i in range(npoints-1, -1, -1): 52 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 53 | file.close() 54 | 55 | 56 | #=============================== PLOT ===================================== 57 | plt.rc('font', family='Arial', size='14') 58 | 59 | plt.figure(1) 60 | plt.plot(eV, -ε.real, label="-ε1") 61 | plt.plot(eV, ε.imag, label="ε2") 62 | plt.xlabel('Photon energy (eV)') 63 | plt.ylabel('ε') 64 | plt.xscale('log') 65 | plt.yscale('log') 66 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 67 | 68 | #plot n,k vs eV 69 | plt.figure(2) 70 | plt.plot(eV, n, label="n") 71 | plt.plot(eV, k, label="k") 72 | plt.xlabel('Photon energy (eV)') 73 | plt.ylabel('n, k') 74 | plt.yscale('log') 75 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 76 | 77 | #plot n,k vs μm 78 | plt.figure(3) 79 | plt.plot(μm, n, label="n") 80 | plt.plot(μm, k, label="k") 81 | plt.xlabel('Wavelength (μm)') 82 | plt.ylabel('n, k') 83 | plt.xscale('log') 84 | plt.yscale('log') 85 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Au (BB model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | from scipy.special import wofz as w 9 | π = np.pi 10 | 11 | # Brendel-Bormann (BB) model parameters 12 | ωp = 9.03 #eV 13 | f0 = 0.770 14 | Γ0 = 0.050 #eV 15 | 16 | f1 = 0.054 17 | Γ1 = 0.074 #eV 18 | ω1 = 0.218 #eV 19 | σ1 = 0.742 #eV 20 | 21 | f2 = 0.050 22 | Γ2 = 0.035 #eV 23 | ω2 = 2.885 #eV 24 | σ2 = 0.349 #eV 25 | 26 | f3 = 0.312 27 | Γ3 = 0.083 #eV 28 | ω3 = 4.069 #eV 29 | σ3 = 0.830 #eV 30 | 31 | f4 = 0.719 32 | Γ4 = 0.125 #eV 33 | ω4 = 6.137 #eV 34 | σ4 = 1.246 #eV 35 | 36 | f5 = 1.648 37 | Γ5 = 0.179 #eV 38 | ω5 = 27.97 #eV 39 | σ5 = 1.795 #eV 40 | 41 | Ωp = f0**.5 * ωp #eV 42 | 43 | def BB(ω): #ω: eV 44 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 45 | 46 | α = (ω**2+1j*ω*Γ1)**.5 47 | za = (α-ω1)/(2**.5*σ1) 48 | zb = (α+ω1)/(2**.5*σ1) 49 | ε += 1j*π**.5*f1*ωp**2 / (2**1.5*α*σ1) * (w(za)+w(zb)) #χ1 50 | 51 | α = (ω**2+1j*ω*Γ2)**.5 52 | za = (α-ω2)/(2**.5*σ2) 53 | zb = (α+ω2)/(2**.5*σ2) 54 | ε += 1j*π**.5*f2*ωp**2 / (2**1.5*α*σ2) * (w(za)+w(zb)) #χ2 55 | 56 | α = (ω**2+1j*ω*Γ3)**.5 57 | za = (α-ω3)/(2**.5*σ3) 58 | zb = (α+ω3)/(2**.5*σ3) 59 | ε += 1j*π**.5*f3*ωp**2 / (2**1.5*α*σ3) * (w(za)+w(zb)) #χ3 60 | 61 | α = (ω**2+1j*ω*Γ4)**.5 62 | za = (α-ω4)/(2**.5*σ4) 63 | zb = (α+ω4)/(2**.5*σ4) 64 | ε += 1j*π**.5*f4*ωp**2 / (2**1.5*α*σ4) * (w(za)+w(zb)) #χ4 65 | 66 | α = (ω**2+1j*ω*Γ5)**.5 67 | za = (α-ω5)/(2**.5*σ5) 68 | zb = (α+ω5)/(2**.5*σ5) 69 | ε += 1j*π**.5*f5*ωp**2 / (2**1.5*α*σ5) * (w(za)+w(zb)) #χ5 70 | 71 | return ε 72 | 73 | ev_min=0.2 74 | ev_max=5 75 | npoints=200 76 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 77 | μm = 4.13566733e-1*2.99792458/eV 78 | ε = BB(eV) 79 | n = (ε**.5).real 80 | k = (ε**.5).imag 81 | 82 | 83 | #============================ DATA OUTPUT ================================= 84 | file = open('out.txt', 'w') 85 | for i in range(npoints-1, -1, -1): 86 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 87 | file.close() 88 | 89 | 90 | #=============================== PLOT ===================================== 91 | plt.rc('font', family='Arial', size='14') 92 | 93 | plt.figure(1) 94 | plt.plot(eV, -ε.real, label="-ε1") 95 | plt.plot(eV, ε.imag, label="ε2") 96 | plt.xlabel('Photon energy (eV)') 97 | plt.ylabel('ε') 98 | plt.xscale('log') 99 | plt.yscale('log') 100 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 101 | 102 | #plot n,k vs eV 103 | plt.figure(2) 104 | plt.plot(eV, n, label="n") 105 | plt.plot(eV, k, label="k") 106 | plt.xlabel('Photon energy (eV)') 107 | plt.ylabel('n, k') 108 | plt.yscale('log') 109 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 110 | 111 | #plot n,k vs μm 112 | plt.figure(3) 113 | plt.plot(μm, n, label="n") 114 | plt.plot(μm, k, label="k") 115 | plt.xlabel('Wavelength (μm)') 116 | plt.ylabel('n, k') 117 | plt.xscale('log') 118 | plt.yscale('log') 119 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Au (LD model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # Lorentz-Drude (LD) model parameters 10 | ωp = 9.03 #eV 11 | f0 = 0.760 12 | Γ0 = 0.053 #eV 13 | 14 | f1 = 0.024 15 | Γ1 = 0.241 #eV 16 | ω1 = 0.415 #eV 17 | 18 | f2 = 0.010 19 | Γ2 = 0.345 #eV 20 | ω2 = 0.830 #eV 21 | 22 | f3 = 0.071 23 | Γ3 = 0.870 #eV 24 | ω3 = 2.969 #eV 25 | 26 | f4 = 0.601 27 | Γ4 = 2.494 #eV 28 | ω4 = 4.304 #eV 29 | 30 | f5 = 4.384 31 | Γ5 = 2.214 #eV 32 | ω5 = 13.32 #eV 33 | 34 | Ωp = f0**.5 * ωp #eV 35 | 36 | def LD(ω): #ω: eV 37 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 38 | ε += f1*ωp**2 / ((ω1**2-ω**2)-1j*ω*Γ1) 39 | ε += f2*ωp**2 / ((ω2**2-ω**2)-1j*ω*Γ2) 40 | ε += f3*ωp**2 / ((ω3**2-ω**2)-1j*ω*Γ3) 41 | ε += f4*ωp**2 / ((ω4**2-ω**2)-1j*ω*Γ4) 42 | ε += f5*ωp**2 / ((ω5**2-ω**2)-1j*ω*Γ5) 43 | return ε 44 | 45 | ev_min=0.2 46 | ev_max=5 47 | npoints=200 48 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 49 | μm = 4.13566733e-1*2.99792458/eV 50 | ε = LD(eV) 51 | n = (ε**.5).real 52 | k = (ε**.5).imag 53 | 54 | #============================ DATA OUTPUT ================================= 55 | file = open('out.txt', 'w') 56 | for i in range(npoints-1, -1, -1): 57 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 58 | file.close() 59 | 60 | 61 | #=============================== PLOT ===================================== 62 | plt.rc('font', family='Arial', size='14') 63 | 64 | plt.figure(1) 65 | plt.plot(eV, -ε.real, label="-ε1") 66 | plt.plot(eV, ε.imag, label="ε2") 67 | plt.xlabel('Photon energy (eV)') 68 | plt.ylabel('ε') 69 | plt.xscale('log') 70 | plt.yscale('log') 71 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 72 | 73 | #plot n,k vs eV 74 | plt.figure(2) 75 | plt.plot(eV, n, label="n") 76 | plt.plot(eV, k, label="k") 77 | plt.xlabel('Photon energy (eV)') 78 | plt.ylabel('n, k') 79 | plt.yscale('log') 80 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 81 | 82 | #plot n,k vs μm 83 | plt.figure(3) 84 | plt.plot(μm, n, label="n") 85 | plt.plot(μm, k, label="k") 86 | plt.xlabel('Wavelength (μm)') 87 | plt.ylabel('n, k') 88 | plt.xscale('log') 89 | plt.yscale('log') 90 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Be (BB model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | from scipy.special import wofz as w 9 | π = np.pi 10 | 11 | # Brendel-Bormann (BB) model parameters 12 | ωp = 18.51 #eV 13 | f0 = 0.081 14 | Γ0 = 0.035 #eV 15 | 16 | f1 = 0.066 17 | Γ1 = 2.956 #eV 18 | ω1 = 0.131 #eV 19 | σ1 = 0.277 #eV 20 | 21 | f2 = 0.067 22 | Γ2 = 3.962 #eV 23 | ω2 = 0.469 #eV 24 | σ2 = 3.167 #eV 25 | 26 | f3 = 0.346 27 | Γ3 = 2.398 #eV 28 | ω3 = 2.827 #eV 29 | σ3 = 1.446 #eV 30 | 31 | f4 = 0.311 32 | Γ4 = 3.904 #eV 33 | ω4 = 4.318 #eV 34 | σ4 = 0.893 #eV 35 | 36 | Ωp = f0**.5 * ωp #eV 37 | 38 | def BB(ω): #ω: eV 39 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 40 | 41 | α = (ω**2+1j*ω*Γ1)**.5 42 | za = (α-ω1)/(2**.5*σ1) 43 | zb = (α+ω1)/(2**.5*σ1) 44 | ε += 1j*π**.5*f1*ωp**2 / (2**1.5*α*σ1) * (w(za)+w(zb)) #χ1 45 | 46 | α = (ω**2+1j*ω*Γ2)**.5 47 | za = (α-ω2)/(2**.5*σ2) 48 | zb = (α+ω2)/(2**.5*σ2) 49 | ε += 1j*π**.5*f2*ωp**2 / (2**1.5*α*σ2) * (w(za)+w(zb)) #χ2 50 | 51 | α = (ω**2+1j*ω*Γ3)**.5 52 | za = (α-ω3)/(2**.5*σ3) 53 | zb = (α+ω3)/(2**.5*σ3) 54 | ε += 1j*π**.5*f3*ωp**2 / (2**1.5*α*σ3) * (w(za)+w(zb)) #χ3 55 | 56 | α = (ω**2+1j*ω*Γ4)**.5 57 | za = (α-ω4)/(2**.5*σ4) 58 | zb = (α+ω4)/(2**.5*σ4) 59 | ε += 1j*π**.5*f4*ωp**2 / (2**1.5*α*σ4) * (w(za)+w(zb)) #χ4 60 | 61 | return ε 62 | 63 | ev_min=0.02 64 | ev_max=5 65 | npoints=200 66 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 67 | μm = 4.13566733e-1*2.99792458/eV 68 | ε = BB(eV) 69 | n = (ε**.5).real 70 | k = (ε**.5).imag 71 | 72 | 73 | #============================ DATA OUTPUT ================================= 74 | file = open('out.txt', 'w') 75 | for i in range(npoints-1, -1, -1): 76 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 77 | file.close() 78 | 79 | 80 | #=============================== PLOT ===================================== 81 | plt.rc('font', family='Arial', size='14') 82 | 83 | plt.figure(1) 84 | plt.plot(eV, -ε.real, label="-ε1") 85 | plt.plot(eV, ε.imag, label="ε2") 86 | plt.xlabel('Photon energy (eV)') 87 | plt.ylabel('ε') 88 | plt.xscale('log') 89 | plt.yscale('log') 90 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 91 | 92 | #plot n,k vs eV 93 | plt.figure(2) 94 | plt.plot(eV, n, label="n") 95 | plt.plot(eV, k, label="k") 96 | plt.xlabel('Photon energy (eV)') 97 | plt.ylabel('n, k') 98 | plt.yscale('log') 99 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 100 | 101 | #plot n,k vs μm 102 | plt.figure(3) 103 | plt.plot(μm, n, label="n") 104 | plt.plot(μm, k, label="k") 105 | plt.xlabel('Wavelength (μm)') 106 | plt.ylabel('n, k') 107 | plt.xscale('log') 108 | plt.yscale('log') 109 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Be (LD model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # Lorentz-Drude (LD) model parameters 10 | ωp = 18.51 #eV 11 | f0 = 0.084 12 | Γ0 = 0.035 #eV 13 | 14 | f1 = 0.031 15 | Γ1 = 1.664 #eV 16 | ω1 = 0.100 #eV 17 | 18 | f2 = 0.140 19 | Γ2 = 3.395 #eV 20 | ω2 = 1.032 #eV 21 | 22 | f3 = 0.530 23 | Γ3 = 4.454 #eV 24 | ω3 = 3.183 #eV 25 | 26 | f4 = 0.130 27 | Γ4 = 1.802 #eV 28 | ω4 = 4.604 #eV 29 | 30 | Ωp = f0**.5 * ωp #eV 31 | 32 | def LD(ω): #ω: eV 33 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 34 | ε += f1*ωp**2 / ((ω1**2-ω**2)-1j*ω*Γ1) 35 | ε += f2*ωp**2 / ((ω2**2-ω**2)-1j*ω*Γ2) 36 | ε += f3*ωp**2 / ((ω3**2-ω**2)-1j*ω*Γ3) 37 | ε += f4*ωp**2 / ((ω4**2-ω**2)-1j*ω*Γ4) 38 | return ε 39 | 40 | ev_min=0.02 41 | ev_max=5 42 | npoints=1000 43 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 44 | μm = 4.13566733e-1*2.99792458/eV 45 | ε = LD(eV) 46 | n = (ε**.5).real 47 | k = (ε**.5).imag 48 | 49 | #============================ DATA OUTPUT ================================= 50 | file = open('out.txt', 'w') 51 | for i in range(npoints-1, -1, -1): 52 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 53 | file.close() 54 | 55 | 56 | #=============================== PLOT ===================================== 57 | plt.rc('font', family='Arial', size='14') 58 | 59 | plt.figure(1) 60 | plt.plot(eV, -ε.real, label="-ε1") 61 | plt.plot(eV, ε.imag, label="ε2") 62 | plt.xlabel('Photon energy (eV)') 63 | plt.ylabel('ε') 64 | plt.xscale('log') 65 | plt.yscale('log') 66 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 67 | 68 | #plot n,k vs eV 69 | plt.figure(2) 70 | plt.plot(eV, n, label="n") 71 | plt.plot(eV, k, label="k") 72 | plt.xlabel('Photon energy (eV)') 73 | plt.ylabel('n, k') 74 | plt.yscale('log') 75 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 76 | 77 | #plot n,k vs μm 78 | plt.figure(3) 79 | plt.plot(μm, n, label="n") 80 | plt.plot(μm, k, label="k") 81 | plt.xlabel('Wavelength (μm)') 82 | plt.ylabel('n, k') 83 | plt.xscale('log') 84 | plt.yscale('log') 85 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Cr (BB model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | from scipy.special import wofz as w 9 | π = np.pi 10 | 11 | # Brendel-Bormann (BB) model parameters 12 | ωp = 10.75 #eV 13 | f0 = 0.154 14 | Γ0 = 0.048 #eV 15 | 16 | f1 = 0.338 17 | Γ1 = 4.256 #eV 18 | ω1 = 0.281 #eV 19 | σ1 = 0.115 #eV 20 | 21 | f2 = 0.261 22 | Γ2 = 3.957 #eV 23 | ω2 = 0.584 #eV 24 | σ2 = 0.252 #eV 25 | 26 | f3 = 0.817 27 | Γ3 = 2.218 #eV 28 | ω3 = 1.919 #eV 29 | σ3 = 0.225 #eV 30 | 31 | f4 = 0.105 32 | Γ4 = 6.983 #eV 33 | ω4 = 6.997 #eV 34 | σ4 = 4.903 #eV 35 | 36 | Ωp = f0**.5 * ωp #eV 37 | 38 | def BB(ω): #ω: eV 39 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 40 | 41 | α = (ω**2+1j*ω*Γ1)**.5 42 | za = (α-ω1)/(2**.5*σ1) 43 | zb = (α+ω1)/(2**.5*σ1) 44 | ε += 1j*π**.5*f1*ωp**2 / (2**1.5*α*σ1) * (w(za)+w(zb)) #χ1 45 | 46 | α = (ω**2+1j*ω*Γ2)**.5 47 | za = (α-ω2)/(2**.5*σ2) 48 | zb = (α+ω2)/(2**.5*σ2) 49 | ε += 1j*π**.5*f2*ωp**2 / (2**1.5*α*σ2) * (w(za)+w(zb)) #χ2 50 | 51 | α = (ω**2+1j*ω*Γ3)**.5 52 | za = (α-ω3)/(2**.5*σ3) 53 | zb = (α+ω3)/(2**.5*σ3) 54 | ε += 1j*π**.5*f3*ωp**2 / (2**1.5*α*σ3) * (w(za)+w(zb)) #χ3 55 | 56 | α = (ω**2+1j*ω*Γ4)**.5 57 | za = (α-ω4)/(2**.5*σ4) 58 | zb = (α+ω4)/(2**.5*σ4) 59 | ε += 1j*π**.5*f4*ωp**2 / (2**1.5*α*σ4) * (w(za)+w(zb)) #χ4 60 | 61 | return ε 62 | 63 | ev_min=0.02 64 | ev_max=5 65 | npoints=200 66 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 67 | μm = 4.13566733e-1*2.99792458/eV 68 | ε = BB(eV) 69 | n = (ε**.5).real 70 | k = (ε**.5).imag 71 | 72 | 73 | #============================ DATA OUTPUT ================================= 74 | file = open('out.txt', 'w') 75 | for i in range(npoints-1, -1, -1): 76 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 77 | file.close() 78 | 79 | 80 | #=============================== PLOT ===================================== 81 | plt.rc('font', family='Arial', size='14') 82 | 83 | plt.figure(1) 84 | plt.plot(eV, -ε.real, label="-ε1") 85 | plt.plot(eV, ε.imag, label="ε2") 86 | plt.xlabel('Photon energy (eV)') 87 | plt.ylabel('ε') 88 | plt.xscale('log') 89 | plt.yscale('log') 90 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 91 | 92 | #plot n,k vs eV 93 | plt.figure(2) 94 | plt.plot(eV, n, label="n") 95 | plt.plot(eV, k, label="k") 96 | plt.xlabel('Photon energy (eV)') 97 | plt.ylabel('n, k') 98 | plt.yscale('log') 99 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 100 | 101 | #plot n,k vs μm 102 | plt.figure(3) 103 | plt.plot(μm, n, label="n") 104 | plt.plot(μm, k, label="k") 105 | plt.xlabel('Wavelength (μm)') 106 | plt.ylabel('n, k') 107 | plt.xscale('log') 108 | plt.yscale('log') 109 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Cr (LD model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # Lorentz-Drude (LD) model parameters 10 | ωp = 10.75 #eV 11 | f0 = 0.168 12 | Γ0 = 0.047 #eV 13 | 14 | f1 = 0.151 15 | Γ1 = 3.175 #eV 16 | ω1 = 0.121 #eV 17 | 18 | f2 = 0.150 19 | Γ2 = 1.305 #eV 20 | ω2 = 0.543 #eV 21 | 22 | f3 = 1.149 23 | Γ3 = 2.676 #eV 24 | ω3 = 1.970 #eV 25 | 26 | f4 = 0.825 27 | Γ4 = 1.335 #eV 28 | ω4 = 8.775 #eV 29 | 30 | Ωp = f0**.5 * ωp #eV 31 | 32 | def LD(ω): #ω: eV 33 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 34 | ε += f1*ωp**2 / ((ω1**2-ω**2)-1j*ω*Γ1) 35 | ε += f2*ωp**2 / ((ω2**2-ω**2)-1j*ω*Γ2) 36 | ε += f3*ωp**2 / ((ω3**2-ω**2)-1j*ω*Γ3) 37 | ε += f4*ωp**2 / ((ω4**2-ω**2)-1j*ω*Γ4) 38 | return ε 39 | 40 | ev_min=0.02 41 | ev_max=5 42 | npoints=1000 43 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 44 | μm = 4.13566733e-1*2.99792458/eV 45 | ε = LD(eV) 46 | n = (ε**.5).real 47 | k = (ε**.5).imag 48 | 49 | #============================ DATA OUTPUT ================================= 50 | file = open('out.txt', 'w') 51 | for i in range(npoints-1, -1, -1): 52 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 53 | file.close() 54 | 55 | 56 | #=============================== PLOT ===================================== 57 | plt.rc('font', family='Arial', size='14') 58 | 59 | plt.figure(1) 60 | plt.plot(eV, -ε.real, label="-ε1") 61 | plt.plot(eV, ε.imag, label="ε2") 62 | plt.xlabel('Photon energy (eV)') 63 | plt.ylabel('ε') 64 | plt.xscale('log') 65 | plt.yscale('log') 66 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 67 | 68 | #plot n,k vs eV 69 | plt.figure(2) 70 | plt.plot(eV, n, label="n") 71 | plt.plot(eV, k, label="k") 72 | plt.xlabel('Photon energy (eV)') 73 | plt.ylabel('n, k') 74 | plt.yscale('log') 75 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 76 | 77 | #plot n,k vs μm 78 | plt.figure(3) 79 | plt.plot(μm, n, label="n") 80 | plt.plot(μm, k, label="k") 81 | plt.xlabel('Wavelength (μm)') 82 | plt.ylabel('n, k') 83 | plt.xscale('log') 84 | plt.yscale('log') 85 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Cu (BB model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | from scipy.special import wofz as w 9 | π = np.pi 10 | 11 | # Brendel-Bormann (BB) model parameters 12 | ωp = 10.83 #eV 13 | f0 = 0.562 14 | Γ0 = 0.030 #eV 15 | 16 | f1 = 0.076 17 | Γ1 = 0.056 #eV 18 | ω1 = 0.416 #eV 19 | σ1 = 0.562 #eV 20 | 21 | f2 = 0.081 22 | Γ2 = 0.047 #eV 23 | ω2 = 2.849 #eV 24 | σ2 = 0.469 #eV 25 | 26 | f3 = 0.324 27 | Γ3 = 0.113 #eV 28 | ω3 = 4.819 #eV 29 | σ3 = 1.131 #eV 30 | 31 | f4 = 0.726 32 | Γ4 = 0.172 #eV 33 | ω4 = 8.136 #eV 34 | σ4 = 1.719 #eV 35 | 36 | Ωp = f0**.5 * ωp #eV 37 | 38 | def BB(ω): #ω: eV 39 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 40 | 41 | α = (ω**2+1j*ω*Γ1)**.5 42 | za = (α-ω1)/(2**.5*σ1) 43 | zb = (α+ω1)/(2**.5*σ1) 44 | ε += 1j*π**.5*f1*ωp**2 / (2**1.5*α*σ1) * (w(za)+w(zb)) #χ1 45 | 46 | α = (ω**2+1j*ω*Γ2)**.5 47 | za = (α-ω2)/(2**.5*σ2) 48 | zb = (α+ω2)/(2**.5*σ2) 49 | ε += 1j*π**.5*f2*ωp**2 / (2**1.5*α*σ2) * (w(za)+w(zb)) #χ2 50 | 51 | α = (ω**2+1j*ω*Γ3)**.5 52 | za = (α-ω3)/(2**.5*σ3) 53 | zb = (α+ω3)/(2**.5*σ3) 54 | ε += 1j*π**.5*f3*ωp**2 / (2**1.5*α*σ3) * (w(za)+w(zb)) #χ3 55 | 56 | α = (ω**2+1j*ω*Γ4)**.5 57 | za = (α-ω4)/(2**.5*σ4) 58 | zb = (α+ω4)/(2**.5*σ4) 59 | ε += 1j*π**.5*f4*ωp**2 / (2**1.5*α*σ4) * (w(za)+w(zb)) #χ4 60 | 61 | return ε 62 | 63 | ev_min=0.1 64 | ev_max=6 65 | npoints=200 66 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 67 | μm = 4.13566733e-1*2.99792458/eV 68 | ε = BB(eV) 69 | n = (ε**.5).real 70 | k = (ε**.5).imag 71 | 72 | 73 | #============================ DATA OUTPUT ================================= 74 | file = open('out.txt', 'w') 75 | for i in range(npoints-1, -1, -1): 76 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 77 | file.close() 78 | 79 | 80 | #=============================== PLOT ===================================== 81 | plt.rc('font', family='Arial', size='14') 82 | 83 | plt.figure(1) 84 | plt.plot(eV, -ε.real, label="-ε1") 85 | plt.plot(eV, ε.imag, label="ε2") 86 | plt.xlabel('Photon energy (eV)') 87 | plt.ylabel('ε') 88 | plt.xscale('log') 89 | plt.yscale('log') 90 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 91 | 92 | #plot n,k vs eV 93 | plt.figure(2) 94 | plt.plot(eV, n, label="n") 95 | plt.plot(eV, k, label="k") 96 | plt.xlabel('Photon energy (eV)') 97 | plt.ylabel('n, k') 98 | plt.yscale('log') 99 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 100 | 101 | #plot n,k vs μm 102 | plt.figure(3) 103 | plt.plot(μm, n, label="n") 104 | plt.plot(μm, k, label="k") 105 | plt.xlabel('Wavelength (μm)') 106 | plt.ylabel('n, k') 107 | plt.xscale('log') 108 | plt.yscale('log') 109 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Cu (LD model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # Lorentz-Drude (LD) model parameters 10 | ωp = 10.83 #eV 11 | f0 = 0.575 12 | Γ0 = 0.030 #eV 13 | 14 | f1 = 0.061 15 | Γ1 = 0.378 #eV 16 | ω1 = 0.291 #eV 17 | 18 | f2 = 0.104 19 | Γ2 = 1.056 #eV 20 | ω2 = 2.957 #eV 21 | 22 | f3 = 0.723 23 | Γ3 = 3.213 #eV 24 | ω3 = 5.300 #eV 25 | 26 | f4 = 0.638 27 | Γ4 = 4.305 #eV 28 | ω4 = 11.18 #eV 29 | 30 | Ωp = f0**.5 * ωp #eV 31 | 32 | def LD(ω): #ω: eV 33 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 34 | ε += f1*ωp**2 / ((ω1**2-ω**2)-1j*ω*Γ1) 35 | ε += f2*ωp**2 / ((ω2**2-ω**2)-1j*ω*Γ2) 36 | ε += f3*ωp**2 / ((ω3**2-ω**2)-1j*ω*Γ3) 37 | ε += f4*ωp**2 / ((ω4**2-ω**2)-1j*ω*Γ4) 38 | return ε 39 | 40 | ev_min=0.1 41 | ev_max=6 42 | npoints=200 43 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 44 | μm = 4.13566733e-1*2.99792458/eV 45 | ε = LD(eV) 46 | n = (ε**.5).real 47 | k = (ε**.5).imag 48 | 49 | #============================ DATA OUTPUT ================================= 50 | file = open('out.txt', 'w') 51 | for i in range(npoints-1, -1, -1): 52 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 53 | file.close() 54 | 55 | 56 | #=============================== PLOT ===================================== 57 | plt.rc('font', family='Arial', size='14') 58 | 59 | plt.figure(1) 60 | plt.plot(eV, -ε.real, label="-ε1") 61 | plt.plot(eV, ε.imag, label="ε2") 62 | plt.xlabel('Photon energy (eV)') 63 | plt.ylabel('ε') 64 | plt.xscale('log') 65 | plt.yscale('log') 66 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 67 | 68 | #plot n,k vs eV 69 | plt.figure(2) 70 | plt.plot(eV, n, label="n") 71 | plt.plot(eV, k, label="k") 72 | plt.xlabel('Photon energy (eV)') 73 | plt.ylabel('n, k') 74 | plt.yscale('log') 75 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 76 | 77 | #plot n,k vs μm 78 | plt.figure(3) 79 | plt.plot(μm, n, label="n") 80 | plt.plot(μm, k, label="k") 81 | plt.xlabel('Wavelength (μm)') 82 | plt.ylabel('n, k') 83 | plt.xscale('log') 84 | plt.yscale('log') 85 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Ni (BB model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | from scipy.special import wofz as w 9 | π = np.pi 10 | 11 | # Brendel-Bormann (BB) model parameters 12 | ωp = 15.92 #eV 13 | f0 = 0.083 14 | Γ0 = 0.022 #eV 15 | 16 | f1 = 0.357 17 | Γ1 = 2.820 #eV 18 | ω1 = 0.317 #eV 19 | σ1 = 0.606 #eV 20 | 21 | f2 = 0.039 22 | Γ2 = 0.120 #eV 23 | ω2 = 1.059 #eV 24 | σ2 = 1.454 #eV 25 | 26 | f3 = 0.127 27 | Γ3 = 1.822 #eV 28 | ω3 = 4.583 #eV 29 | σ3 = 0.379 #eV 30 | 31 | f4 = 0.654 32 | Γ4 = 6.637 #eV 33 | ω4 = 8.825 #eV 34 | σ4 = 0.510 #eV 35 | 36 | Ωp = f0**.5 * ωp #eV 37 | 38 | def BB(ω): #ω: eV 39 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 40 | 41 | α = (ω**2+1j*ω*Γ1)**.5 42 | za = (α-ω1)/(2**.5*σ1) 43 | zb = (α+ω1)/(2**.5*σ1) 44 | ε += 1j*π**.5*f1*ωp**2 / (2**1.5*α*σ1) * (w(za)+w(zb)) #χ1 45 | 46 | α = (ω**2+1j*ω*Γ2)**.5 47 | za = (α-ω2)/(2**.5*σ2) 48 | zb = (α+ω2)/(2**.5*σ2) 49 | ε += 1j*π**.5*f2*ωp**2 / (2**1.5*α*σ2) * (w(za)+w(zb)) #χ2 50 | 51 | α = (ω**2+1j*ω*Γ3)**.5 52 | za = (α-ω3)/(2**.5*σ3) 53 | zb = (α+ω3)/(2**.5*σ3) 54 | ε += 1j*π**.5*f3*ωp**2 / (2**1.5*α*σ3) * (w(za)+w(zb)) #χ3 55 | 56 | α = (ω**2+1j*ω*Γ4)**.5 57 | za = (α-ω4)/(2**.5*σ4) 58 | zb = (α+ω4)/(2**.5*σ4) 59 | ε += 1j*π**.5*f4*ωp**2 / (2**1.5*α*σ4) * (w(za)+w(zb)) #χ4 60 | 61 | return ε 62 | 63 | ev_min=0.2 64 | ev_max=5 65 | npoints=200 66 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 67 | μm = 4.13566733e-1*2.99792458/eV 68 | ε = BB(eV) 69 | n = (ε**.5).real 70 | k = (ε**.5).imag 71 | 72 | 73 | #============================ DATA OUTPUT ================================= 74 | file = open('out.txt', 'w') 75 | for i in range(npoints-1, -1, -1): 76 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 77 | file.close() 78 | 79 | 80 | #=============================== PLOT ===================================== 81 | plt.rc('font', family='Arial', size='14') 82 | 83 | plt.figure(1) 84 | plt.plot(eV, -ε.real, label="-ε1") 85 | plt.plot(eV, ε.imag, label="ε2") 86 | plt.xlabel('Photon energy (eV)') 87 | plt.ylabel('ε') 88 | plt.xscale('log') 89 | plt.yscale('log') 90 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 91 | 92 | #plot n,k vs eV 93 | plt.figure(2) 94 | plt.plot(eV, n, label="n") 95 | plt.plot(eV, k, label="k") 96 | plt.xlabel('Photon energy (eV)') 97 | plt.ylabel('n, k') 98 | plt.yscale('log') 99 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 100 | 101 | #plot n,k vs μm 102 | plt.figure(3) 103 | plt.plot(μm, n, label="n") 104 | plt.plot(μm, k, label="k") 105 | plt.xlabel('Wavelength (μm)') 106 | plt.ylabel('n, k') 107 | plt.xscale('log') 108 | plt.yscale('log') 109 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Ni (LD model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # Lorentz-Drude (LD) model parameters 10 | ωp = 15.92 #eV 11 | f0 = 0.096 12 | Γ0 = 0.048 #eV 13 | 14 | f1 = 0.100 15 | Γ1 = 4.511 #eV 16 | ω1 = 0.174 #eV 17 | 18 | f2 = 0.135 19 | Γ2 = 1.334 #eV 20 | ω2 = 0.582 #eV 21 | 22 | f3 = 0.106 23 | Γ3 = 2.178 #eV 24 | ω3 = 1.597 #eV 25 | 26 | f4 = 0.729 27 | Γ4 = 6.292 #eV 28 | ω4 = 6.089 #eV 29 | 30 | Ωp = f0**.5 * ωp #eV 31 | 32 | def LD(ω): #ω: eV 33 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 34 | ε += f1*ωp**2 / ((ω1**2-ω**2)-1j*ω*Γ1) 35 | ε += f2*ωp**2 / ((ω2**2-ω**2)-1j*ω*Γ2) 36 | ε += f3*ωp**2 / ((ω3**2-ω**2)-1j*ω*Γ3) 37 | ε += f4*ωp**2 / ((ω4**2-ω**2)-1j*ω*Γ4) 38 | return ε 39 | 40 | ev_min=0.2 41 | ev_max=5 42 | npoints=1000 43 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 44 | μm = 4.13566733e-1*2.99792458/eV 45 | ε = LD(eV) 46 | n = (ε**.5).real 47 | k = (ε**.5).imag 48 | 49 | #============================ DATA OUTPUT ================================= 50 | file = open('out.txt', 'w') 51 | for i in range(npoints-1, -1, -1): 52 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 53 | file.close() 54 | 55 | 56 | #=============================== PLOT ===================================== 57 | plt.rc('font', family='Arial', size='14') 58 | 59 | plt.figure(1) 60 | plt.plot(eV, -ε.real, label="-ε1") 61 | plt.plot(eV, ε.imag, label="ε2") 62 | plt.xlabel('Photon energy (eV)') 63 | plt.ylabel('ε') 64 | plt.xscale('log') 65 | plt.yscale('log') 66 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 67 | 68 | #plot n,k vs eV 69 | plt.figure(2) 70 | plt.plot(eV, n, label="n") 71 | plt.plot(eV, k, label="k") 72 | plt.xlabel('Photon energy (eV)') 73 | plt.ylabel('n, k') 74 | plt.yscale('log') 75 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 76 | 77 | #plot n,k vs μm 78 | plt.figure(3) 79 | plt.plot(μm, n, label="n") 80 | plt.plot(μm, k, label="k") 81 | plt.xlabel('Wavelength (μm)') 82 | plt.ylabel('n, k') 83 | plt.xscale('log') 84 | plt.yscale('log') 85 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Pd (BB model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | from scipy.special import wofz as w 9 | π = np.pi 10 | 11 | # Brendel-Bormann (BB) model parameters 12 | ωp = 9.72 #eV 13 | f0 = 0.330 14 | Γ0 = 0.009 #eV 15 | 16 | f1 = 0.769 17 | Γ1 = 2.343 #eV 18 | ω1 = 0.066 #eV 19 | σ1 = 0.694 #eV 20 | 21 | f2 = 0.093 22 | Γ2 = 0.497 #eV 23 | ω2 = 0.502 #eV 24 | σ2 = 0.027 #eV 25 | 26 | f3 = 0.309 27 | Γ3 = 2.022 #eV 28 | ω3 = 2.432 #eV 29 | σ3 = 1.167 #eV 30 | 31 | f4 = 0.409 32 | Γ4 = 0.119 #eV 33 | ω4 = 5.987 #eV 34 | σ4 = 1.331 #eV 35 | 36 | Ωp = f0**.5 * ωp #eV 37 | 38 | def BB(ω): #ω: eV 39 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 40 | 41 | α = (ω**2+1j*ω*Γ1)**.5 42 | za = (α-ω1)/(2**.5*σ1) 43 | zb = (α+ω1)/(2**.5*σ1) 44 | ε += 1j*π**.5*f1*ωp**2 / (2**1.5*α*σ1) * (w(za)+w(zb)) #χ1 45 | 46 | α = (ω**2+1j*ω*Γ2)**.5 47 | za = (α-ω2)/(2**.5*σ2) 48 | zb = (α+ω2)/(2**.5*σ2) 49 | ε += 1j*π**.5*f2*ωp**2 / (2**1.5*α*σ2) * (w(za)+w(zb)) #χ2 50 | 51 | α = (ω**2+1j*ω*Γ3)**.5 52 | za = (α-ω3)/(2**.5*σ3) 53 | zb = (α+ω3)/(2**.5*σ3) 54 | ε += 1j*π**.5*f3*ωp**2 / (2**1.5*α*σ3) * (w(za)+w(zb)) #χ3 55 | 56 | α = (ω**2+1j*ω*Γ4)**.5 57 | za = (α-ω4)/(2**.5*σ4) 58 | zb = (α+ω4)/(2**.5*σ4) 59 | ε += 1j*π**.5*f4*ωp**2 / (2**1.5*α*σ4) * (w(za)+w(zb)) #χ4 60 | 61 | return ε 62 | 63 | ev_min=0.1 64 | ev_max=5 65 | npoints=200 66 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 67 | μm = 4.13566733e-1*2.99792458/eV 68 | ε = BB(eV) 69 | n = (ε**.5).real 70 | k = (ε**.5).imag 71 | 72 | 73 | #============================ DATA OUTPUT ================================= 74 | file = open('out.txt', 'w') 75 | for i in range(npoints-1, -1, -1): 76 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 77 | file.close() 78 | 79 | 80 | #=============================== PLOT ===================================== 81 | plt.rc('font', family='Arial', size='14') 82 | 83 | plt.figure(1) 84 | plt.plot(eV, -ε.real, label="-ε1") 85 | plt.plot(eV, ε.imag, label="ε2") 86 | plt.xlabel('Photon energy (eV)') 87 | plt.ylabel('ε') 88 | plt.xscale('log') 89 | plt.yscale('log') 90 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 91 | 92 | #plot n,k vs eV 93 | plt.figure(2) 94 | plt.plot(eV, n, label="n") 95 | plt.plot(eV, k, label="k") 96 | plt.xlabel('Photon energy (eV)') 97 | plt.ylabel('n, k') 98 | plt.yscale('log') 99 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 100 | 101 | #plot n,k vs μm 102 | plt.figure(3) 103 | plt.plot(μm, n, label="n") 104 | plt.plot(μm, k, label="k") 105 | plt.xlabel('Wavelength (μm)') 106 | plt.ylabel('n, k') 107 | plt.xscale('log') 108 | plt.yscale('log') 109 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Pd (LD model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # Lorentz-Drude (LD) model parameters 10 | ωp = 9.72 #eV 11 | f0 = 0.330 12 | Γ0 = 0.008 #eV 13 | 14 | f1 = 0.649 15 | Γ1 = 2.950 #eV 16 | ω1 = 0.336 #eV 17 | 18 | f2 = 0.121 19 | Γ2 = 0.555 #eV 20 | ω2 = 0.501 #eV 21 | 22 | f3 = 0.638 23 | Γ3 = 4.621 #eV 24 | ω3 = 1.659 #eV 25 | 26 | f4 = 0.453 27 | Γ4 = 3.236 #eV 28 | ω4 = 5.715 #eV 29 | 30 | Ωp = f0**.5 * ωp #eV 31 | 32 | def LD(ω): #ω: eV 33 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 34 | ε += f1*ωp**2 / ((ω1**2-ω**2)-1j*ω*Γ1) 35 | ε += f2*ωp**2 / ((ω2**2-ω**2)-1j*ω*Γ2) 36 | ε += f3*ωp**2 / ((ω3**2-ω**2)-1j*ω*Γ3) 37 | ε += f4*ωp**2 / ((ω4**2-ω**2)-1j*ω*Γ4) 38 | return ε 39 | 40 | ev_min=0.1 41 | ev_max=5 42 | npoints=1000 43 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 44 | μm = 4.13566733e-1*2.99792458/eV 45 | ε = LD(eV) 46 | n = (ε**.5).real 47 | k = (ε**.5).imag 48 | 49 | #============================ DATA OUTPUT ================================= 50 | file = open('out.txt', 'w') 51 | for i in range(npoints-1, -1, -1): 52 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 53 | file.close() 54 | 55 | 56 | #=============================== PLOT ===================================== 57 | plt.rc('font', family='Arial', size='14') 58 | 59 | plt.figure(1) 60 | plt.plot(eV, -ε.real, label="-ε1") 61 | plt.plot(eV, ε.imag, label="ε2") 62 | plt.xlabel('Photon energy (eV)') 63 | plt.ylabel('ε') 64 | plt.xscale('log') 65 | plt.yscale('log') 66 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 67 | 68 | #plot n,k vs eV 69 | plt.figure(2) 70 | plt.plot(eV, n, label="n") 71 | plt.plot(eV, k, label="k") 72 | plt.xlabel('Photon energy (eV)') 73 | plt.ylabel('n, k') 74 | plt.yscale('log') 75 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 76 | 77 | #plot n,k vs μm 78 | plt.figure(3) 79 | plt.plot(μm, n, label="n") 80 | plt.plot(μm, k, label="k") 81 | plt.xlabel('Wavelength (μm)') 82 | plt.ylabel('n, k') 83 | plt.xscale('log') 84 | plt.yscale('log') 85 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Pt (BB model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | from scipy.special import wofz as w 9 | π = np.pi 10 | 11 | # Brendel-Bormann (BB) model parameters 12 | ωp = 9.59 #eV 13 | f0 = 0.333 14 | Γ0 = 0.080 #eV 15 | 16 | f1 = 0.186 17 | Γ1 = 0.498 #eV 18 | ω1 = 0.782 #eV 19 | σ1 = 0.031 #eV 20 | 21 | f2 = 0.665 22 | Γ2 = 1.851 #eV 23 | ω2 = 1.317 #eV 24 | σ2 = 0.096 #eV 25 | 26 | f3 = 0.551 27 | Γ3 = 2.604 #eV 28 | ω3 = 3.189 #eV 29 | σ3 = 0.766 #eV 30 | 31 | f4 = 2.214 32 | Γ4 = 2.891 #eV 33 | ω4 = 8.236 #eV 34 | σ4 = 1.146 #eV 35 | 36 | Ωp = f0**.5 * ωp #eV 37 | 38 | def BB(ω): #ω: eV 39 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 40 | 41 | α = (ω**2+1j*ω*Γ1)**.5 42 | za = (α-ω1)/(2**.5*σ1) 43 | zb = (α+ω1)/(2**.5*σ1) 44 | ε += 1j*π**.5*f1*ωp**2 / (2**1.5*α*σ1) * (w(za)+w(zb)) #χ1 45 | 46 | α = (ω**2+1j*ω*Γ2)**.5 47 | za = (α-ω2)/(2**.5*σ2) 48 | zb = (α+ω2)/(2**.5*σ2) 49 | ε += 1j*π**.5*f2*ωp**2 / (2**1.5*α*σ2) * (w(za)+w(zb)) #χ2 50 | 51 | α = (ω**2+1j*ω*Γ3)**.5 52 | za = (α-ω3)/(2**.5*σ3) 53 | zb = (α+ω3)/(2**.5*σ3) 54 | ε += 1j*π**.5*f3*ωp**2 / (2**1.5*α*σ3) * (w(za)+w(zb)) #χ3 55 | 56 | α = (ω**2+1j*ω*Γ4)**.5 57 | za = (α-ω4)/(2**.5*σ4) 58 | zb = (α+ω4)/(2**.5*σ4) 59 | ε += 1j*π**.5*f4*ωp**2 / (2**1.5*α*σ4) * (w(za)+w(zb)) #χ4 60 | 61 | return ε 62 | 63 | ev_min=0.1 64 | ev_max=5 65 | npoints=200 66 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 67 | μm = 4.13566733e-1*2.99792458/eV 68 | ε = BB(eV) 69 | n = (ε**.5).real 70 | k = (ε**.5).imag 71 | 72 | 73 | #============================ DATA OUTPUT ================================= 74 | file = open('out.txt', 'w') 75 | for i in range(npoints-1, -1, -1): 76 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 77 | file.close() 78 | 79 | 80 | #=============================== PLOT ===================================== 81 | plt.rc('font', family='Arial', size='14') 82 | 83 | plt.figure(1) 84 | plt.plot(eV, -ε.real, label="-ε1") 85 | plt.plot(eV, ε.imag, label="ε2") 86 | plt.xlabel('Photon energy (eV)') 87 | plt.ylabel('ε') 88 | plt.xscale('log') 89 | plt.yscale('log') 90 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 91 | 92 | #plot n,k vs eV 93 | plt.figure(2) 94 | plt.plot(eV, n, label="n") 95 | plt.plot(eV, k, label="k") 96 | plt.xlabel('Photon energy (eV)') 97 | plt.ylabel('n, k') 98 | plt.yscale('log') 99 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 100 | 101 | #plot n,k vs μm 102 | plt.figure(3) 103 | plt.plot(μm, n, label="n") 104 | plt.plot(μm, k, label="k") 105 | plt.xlabel('Wavelength (μm)') 106 | plt.ylabel('n, k') 107 | plt.xscale('log') 108 | plt.yscale('log') 109 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Pt (LD model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # Lorentz-Drude (LD) model parameters 10 | ωp = 9.59 #eV 11 | f0 = 0.333 12 | Γ0 = 0.080 #eV 13 | 14 | f1 = 0.191 15 | Γ1 = 0.517 #eV 16 | ω1 = 0.780 #eV 17 | 18 | f2 = 0.659 19 | Γ2 = 1.838 #eV 20 | ω2 = 1.314 #eV 21 | 22 | f3 = 0.547 23 | Γ3 = 3.668 #eV 24 | ω3 = 3.141 #eV 25 | 26 | f4 = 3.576 27 | Γ4 = 8.517 #eV 28 | ω4 = 9.249 #eV 29 | 30 | Ωp = f0**.5 * ωp #eV 31 | 32 | def LD(ω): #ω: eV 33 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 34 | ε += f1*ωp**2 / ((ω1**2-ω**2)-1j*ω*Γ1) 35 | ε += f2*ωp**2 / ((ω2**2-ω**2)-1j*ω*Γ2) 36 | ε += f3*ωp**2 / ((ω3**2-ω**2)-1j*ω*Γ3) 37 | ε += f4*ωp**2 / ((ω4**2-ω**2)-1j*ω*Γ4) 38 | return ε 39 | 40 | ev_min=0.1 41 | ev_max=5 42 | npoints=1000 43 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 44 | μm = 4.13566733e-1*2.99792458/eV 45 | ε = LD(eV) 46 | n = (ε**.5).real 47 | k = (ε**.5).imag 48 | 49 | #============================ DATA OUTPUT ================================= 50 | file = open('out.txt', 'w') 51 | for i in range(npoints-1, -1, -1): 52 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 53 | file.close() 54 | 55 | 56 | #=============================== PLOT ===================================== 57 | plt.rc('font', family='Arial', size='14') 58 | 59 | plt.figure(1) 60 | plt.plot(eV, -ε.real, label="-ε1") 61 | plt.plot(eV, ε.imag, label="ε2") 62 | plt.xlabel('Photon energy (eV)') 63 | plt.ylabel('ε') 64 | plt.xscale('log') 65 | plt.yscale('log') 66 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 67 | 68 | #plot n,k vs eV 69 | plt.figure(2) 70 | plt.plot(eV, n, label="n") 71 | plt.plot(eV, k, label="k") 72 | plt.xlabel('Photon energy (eV)') 73 | plt.ylabel('n, k') 74 | plt.yscale('log') 75 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 76 | 77 | #plot n,k vs μm 78 | plt.figure(3) 79 | plt.plot(μm, n, label="n") 80 | plt.plot(μm, k, label="k") 81 | plt.xlabel('Wavelength (μm)') 82 | plt.ylabel('n, k') 83 | plt.xscale('log') 84 | plt.yscale('log') 85 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Ti (BB model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | from scipy.special import wofz as w 9 | π = np.pi 10 | 11 | # Brendel-Bormann (BB) model parameters 12 | ωp = 7.29 #eV 13 | f0 = 0.126 14 | Γ0 = 0.067 #eV 15 | 16 | f1 = 0.427 17 | Γ1 = 1.877 #eV 18 | ω1 = 1.459 #eV 19 | σ1 = 0.463 #eV 20 | 21 | f2 = 0.218 22 | Γ2 = 0.100 #eV 23 | ω2 = 2.661 #eV 24 | σ2 = 0.506 #eV 25 | 26 | f3 = 0.513 27 | Γ3 = 0.615 #eV 28 | ω3 = 0.805 #eV 29 | σ3 = 0.799 #eV 30 | 31 | f4 = 0.0002 32 | Γ4 = 4.109 #eV 33 | ω4 = 19.86 #eV 34 | σ4 = 2.854 #eV 35 | 36 | Ωp = f0**.5 * ωp #eV 37 | 38 | def BB(ω): #ω: eV 39 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 40 | 41 | α = (ω**2+1j*ω*Γ1)**.5 42 | za = (α-ω1)/(2**.5*σ1) 43 | zb = (α+ω1)/(2**.5*σ1) 44 | ε += 1j*π**.5*f1*ωp**2 / (2**1.5*α*σ1) * (w(za)+w(zb)) #χ1 45 | 46 | α = (ω**2+1j*ω*Γ2)**.5 47 | za = (α-ω2)/(2**.5*σ2) 48 | zb = (α+ω2)/(2**.5*σ2) 49 | ε += 1j*π**.5*f2*ωp**2 / (2**1.5*α*σ2) * (w(za)+w(zb)) #χ2 50 | 51 | α = (ω**2+1j*ω*Γ3)**.5 52 | za = (α-ω3)/(2**.5*σ3) 53 | zb = (α+ω3)/(2**.5*σ3) 54 | ε += 1j*π**.5*f3*ωp**2 / (2**1.5*α*σ3) * (w(za)+w(zb)) #χ3 55 | 56 | α = (ω**2+1j*ω*Γ4)**.5 57 | za = (α-ω4)/(2**.5*σ4) 58 | zb = (α+ω4)/(2**.5*σ4) 59 | ε += 1j*π**.5*f4*ωp**2 / (2**1.5*α*σ4) * (w(za)+w(zb)) #χ4 60 | 61 | return ε 62 | 63 | ev_min=0.04 64 | ev_max=5 65 | npoints=200 66 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 67 | μm = 4.13566733e-1*2.99792458/eV 68 | ε = BB(eV) 69 | n = (ε**.5).real 70 | k = (ε**.5).imag 71 | 72 | 73 | #============================ DATA OUTPUT ================================= 74 | file = open('out.txt', 'w') 75 | for i in range(npoints-1, -1, -1): 76 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 77 | file.close() 78 | 79 | 80 | #=============================== PLOT ===================================== 81 | plt.rc('font', family='Arial', size='14') 82 | 83 | plt.figure(1) 84 | plt.plot(eV, -ε.real, label="-ε1") 85 | plt.plot(eV, ε.imag, label="ε2") 86 | plt.xlabel('Photon energy (eV)') 87 | plt.ylabel('ε') 88 | plt.xscale('log') 89 | plt.yscale('log') 90 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 91 | 92 | #plot n,k vs eV 93 | plt.figure(2) 94 | plt.plot(eV, n, label="n") 95 | plt.plot(eV, k, label="k") 96 | plt.xlabel('Photon energy (eV)') 97 | plt.ylabel('n, k') 98 | plt.yscale('log') 99 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 100 | 101 | #plot n,k vs μm 102 | plt.figure(3) 103 | plt.plot(μm, n, label="n") 104 | plt.plot(μm, k, label="k") 105 | plt.xlabel('Wavelength (μm)') 106 | plt.ylabel('n, k') 107 | plt.xscale('log') 108 | plt.yscale('log') 109 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - Ti (LD model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # Lorentz-Drude (LD) model parameters 10 | ωp = 7.29 #eV 11 | f0 = 0.148 12 | Γ0 = 0.082 #eV 13 | 14 | f1 = 0.899 15 | Γ1 = 2.276 #eV 16 | ω1 = 0.777 #eV 17 | 18 | f2 = 0.393 19 | Γ2 = 2.518 #eV 20 | ω2 = 1.545 #eV 21 | 22 | f3 = 0.187 23 | Γ3 = 1.663 #eV 24 | ω3 = 2.509 #eV 25 | 26 | f4 = 0.001 27 | Γ4 = 1.762 #eV 28 | ω4 = 19.43 #eV 29 | 30 | Ωp = f0**.5 * ωp #eV 31 | 32 | def LD(ω): #ω: eV 33 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 34 | ε += f1*ωp**2 / ((ω1**2-ω**2)-1j*ω*Γ1) 35 | ε += f2*ωp**2 / ((ω2**2-ω**2)-1j*ω*Γ2) 36 | ε += f3*ωp**2 / ((ω3**2-ω**2)-1j*ω*Γ3) 37 | ε += f4*ωp**2 / ((ω4**2-ω**2)-1j*ω*Γ4) 38 | return ε 39 | 40 | ev_min=0.04 41 | ev_max=5 42 | npoints=1000 43 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 44 | μm = 4.13566733e-1*2.99792458/eV 45 | ε = LD(eV) 46 | n = (ε**.5).real 47 | k = (ε**.5).imag 48 | 49 | #============================ DATA OUTPUT ================================= 50 | file = open('out.txt', 'w') 51 | for i in range(npoints-1, -1, -1): 52 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 53 | file.close() 54 | 55 | 56 | #=============================== PLOT ===================================== 57 | plt.rc('font', family='Arial', size='14') 58 | 59 | plt.figure(1) 60 | plt.plot(eV, -ε.real, label="-ε1") 61 | plt.plot(eV, ε.imag, label="ε2") 62 | plt.xlabel('Photon energy (eV)') 63 | plt.ylabel('ε') 64 | plt.xscale('log') 65 | plt.yscale('log') 66 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 67 | 68 | #plot n,k vs eV 69 | plt.figure(2) 70 | plt.plot(eV, n, label="n") 71 | plt.plot(eV, k, label="k") 72 | plt.xlabel('Photon energy (eV)') 73 | plt.ylabel('n, k') 74 | plt.yscale('log') 75 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 76 | 77 | #plot n,k vs μm 78 | plt.figure(3) 79 | plt.plot(μm, n, label="n") 80 | plt.plot(μm, k, label="k") 81 | plt.xlabel('Wavelength (μm)') 82 | plt.ylabel('n, k') 83 | plt.xscale('log') 84 | plt.yscale('log') 85 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - W (BB model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | from scipy.special import wofz as w 9 | π = np.pi 10 | 11 | # Brendel-Bormann (BB) model parameters 12 | ωp = 13.22 #eV 13 | f0 = 0.197 14 | Γ0 = 0.057 #eV 15 | 16 | f1 = 0.006 17 | Γ1 = 3.689 #eV 18 | ω1 = 0.481 #eV 19 | σ1 = 3.754 #eV 20 | 21 | f2 = 0.022 22 | Γ2 = 0.277 #eV 23 | ω2 = 0.985 #eV 24 | σ2 = 0.059 #eV 25 | 26 | f3 = 0.136 27 | Γ3 = 1.433 #eV 28 | ω3 = 1.962 #eV 29 | σ3 = 0.273 #eV 30 | 31 | f4 = 2.648 32 | Γ4 = 4.555 #eV 33 | ω4 = 5.442 #eV 34 | σ4 = 1.912 #eV 35 | 36 | Ωp = f0**.5 * ωp #eV 37 | 38 | def BB(ω): #ω: eV 39 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 40 | 41 | α = (ω**2+1j*ω*Γ1)**.5 42 | za = (α-ω1)/(2**.5*σ1) 43 | zb = (α+ω1)/(2**.5*σ1) 44 | ε += 1j*π**.5*f1*ωp**2 / (2**1.5*α*σ1) * (w(za)+w(zb)) #χ1 45 | 46 | α = (ω**2+1j*ω*Γ2)**.5 47 | za = (α-ω2)/(2**.5*σ2) 48 | zb = (α+ω2)/(2**.5*σ2) 49 | ε += 1j*π**.5*f2*ωp**2 / (2**1.5*α*σ2) * (w(za)+w(zb)) #χ2 50 | 51 | α = (ω**2+1j*ω*Γ3)**.5 52 | za = (α-ω3)/(2**.5*σ3) 53 | zb = (α+ω3)/(2**.5*σ3) 54 | ε += 1j*π**.5*f3*ωp**2 / (2**1.5*α*σ3) * (w(za)+w(zb)) #χ3 55 | 56 | α = (ω**2+1j*ω*Γ4)**.5 57 | za = (α-ω4)/(2**.5*σ4) 58 | zb = (α+ω4)/(2**.5*σ4) 59 | ε += 1j*π**.5*f4*ωp**2 / (2**1.5*α*σ4) * (w(za)+w(zb)) #χ4 60 | 61 | return ε 62 | 63 | ev_min=0.1 64 | ev_max=5 65 | npoints=200 66 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 67 | μm = 4.13566733e-1*2.99792458/eV 68 | ε = BB(eV) 69 | n = (ε**.5).real 70 | k = (ε**.5).imag 71 | 72 | 73 | #============================ DATA OUTPUT ================================= 74 | file = open('out.txt', 'w') 75 | for i in range(npoints-1, -1, -1): 76 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 77 | file.close() 78 | 79 | 80 | #=============================== PLOT ===================================== 81 | plt.rc('font', family='Arial', size='14') 82 | 83 | plt.figure(1) 84 | plt.plot(eV, -ε.real, label="-ε1") 85 | plt.plot(eV, ε.imag, label="ε2") 86 | plt.xlabel('Photon energy (eV)') 87 | plt.ylabel('ε') 88 | plt.xscale('log') 89 | plt.yscale('log') 90 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 91 | 92 | #plot n,k vs eV 93 | plt.figure(2) 94 | plt.plot(eV, n, label="n") 95 | plt.plot(eV, k, label="k") 96 | plt.xlabel('Photon energy (eV)') 97 | plt.ylabel('n, k') 98 | plt.yscale('log') 99 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 100 | 101 | #plot n,k vs μm 102 | plt.figure(3) 103 | plt.plot(μm, n, label="n") 104 | plt.plot(μm, k, label="k") 105 | plt.xlabel('Wavelength (μm)') 106 | plt.ylabel('n, k') 107 | plt.xscale('log') 108 | plt.yscale('log') 109 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Rakic 1998 - W (LD model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-02 4 | # Original data: Rakić et al. 1998, https://doi.org/10.1364/AO.37.005271 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | 9 | # Lorentz-Drude (LD) model parameters 10 | ωp = 13.22 #eV 11 | f0 = 0.206 12 | Γ0 = 0.064 #eV 13 | 14 | f1 = 0.054 15 | Γ1 = 0.530 #eV 16 | ω1 = 1.004 #eV 17 | 18 | f2 = 0.166 19 | Γ2 = 1.281 #eV 20 | ω2 = 1.917 #eV 21 | 22 | f3 = 0.706 23 | Γ3 = 3.332 #eV 24 | ω3 = 3.580 #eV 25 | 26 | f4 = 2.590 27 | Γ4 = 5.836 #eV 28 | ω4 = 7.498 #eV 29 | 30 | Ωp = f0**.5 * ωp #eV 31 | 32 | def LD(ω): #ω: eV 33 | ε = 1-Ωp**2/(ω*(ω+1j*Γ0)) 34 | ε += f1*ωp**2 / ((ω1**2-ω**2)-1j*ω*Γ1) 35 | ε += f2*ωp**2 / ((ω2**2-ω**2)-1j*ω*Γ2) 36 | ε += f3*ωp**2 / ((ω3**2-ω**2)-1j*ω*Γ3) 37 | ε += f4*ωp**2 / ((ω4**2-ω**2)-1j*ω*Γ4) 38 | return ε 39 | 40 | ev_min=0.1 41 | ev_max=5 42 | npoints=1000 43 | eV = np.logspace(np.log10(ev_min), np.log10(ev_max), npoints) 44 | μm = 4.13566733e-1*2.99792458/eV 45 | ε = LD(eV) 46 | n = (ε**.5).real 47 | k = (ε**.5).imag 48 | 49 | #============================ DATA OUTPUT ================================= 50 | file = open('out.txt', 'w') 51 | for i in range(npoints-1, -1, -1): 52 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 53 | file.close() 54 | 55 | 56 | #=============================== PLOT ===================================== 57 | plt.rc('font', family='Arial', size='14') 58 | 59 | plt.figure(1) 60 | plt.plot(eV, -ε.real, label="-ε1") 61 | plt.plot(eV, ε.imag, label="ε2") 62 | plt.xlabel('Photon energy (eV)') 63 | plt.ylabel('ε') 64 | plt.xscale('log') 65 | plt.yscale('log') 66 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 67 | 68 | #plot n,k vs eV 69 | plt.figure(2) 70 | plt.plot(eV, n, label="n") 71 | plt.plot(eV, k, label="k") 72 | plt.xlabel('Photon energy (eV)') 73 | plt.ylabel('n, k') 74 | plt.yscale('log') 75 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 76 | 77 | #plot n,k vs μm 78 | plt.figure(3) 79 | plt.plot(μm, n, label="n") 80 | plt.plot(μm, k, label="k") 81 | plt.xlabel('Wavelength (μm)') 82 | plt.ylabel('n, k') 83 | plt.xscale('log') 84 | plt.yscale('log') 85 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) -------------------------------------------------------------------------------- /scripts/Sato 1993 - ZnTe.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-05-18 4 | # Original data: Sato and Adachi 1993, https://doi.org/10.1063/1.353305 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | π = np.pi 9 | 10 | # model parameters from table III 11 | E0 = 2.28 #eV 12 | Δ0 = 3.20-E0 #eV 13 | G0 = 0.010 #eV 14 | A = 15 #eV**1.5 15 | A0x = 0.007 #eV 16 | Γ0 = 0.020 #eV 17 | 18 | E1 = 3.78 #eV 19 | Δ1 = 4.34-E1 #eV 20 | G1 = 0.19 #eV 21 | G1s = 0.19 #eV 22 | B1 = 2.4 23 | B2 = 0.75 24 | B1x = 1.62 #eV 25 | B2x = 0.75 #eV 26 | Γ1 = 0.17 #eV 27 | 28 | E2 = 5.23 #eV 29 | C = 1.4 30 | γ = 0.17 31 | 32 | εinf= 0.5 33 | 34 | def Epsilon_A(ħω): 35 | χ0 = (ħω+1j*Γ0) / E0 36 | χs0 = (ħω+1j*Γ0) / (E0+Δ0) 37 | fχ0 = χ0**-2 * ( 2-(1+χ0)**0.5-(1-χ0)**0.5 ) 38 | fχs0 = χs0**-2 * ( 2-(1+χs0)**0.5-(1-χs0)**0.5 ) 39 | return A*E0**-1.5 * (fχ0+0.5*(E0/(E0+Δ0))**1.5*fχs0) 40 | 41 | def Epsilon_Ax(ħω): 42 | y=0 43 | for n in range(1,1000): 44 | y += A0x/n**3 * ( 2/(E0-G0/n**2-ħω-1j*Γ0) + 1/(E0+Δ0-G0/n**2-ħω-1j*Γ0) ) 45 | return y 46 | 47 | def Epsilon_B(ħω): 48 | χ1d = (ħω + 1j*Γ1) / E1 49 | χ1sd = (ħω + 1j*Γ1) / (E1+Δ1) 50 | return -B1*χ1d**-2*np.log(1-χ1d**2) - B2*χ1sd**-2*np.log(1-χ1sd**2) 51 | 52 | def Epsilon_Bx(ħω): 53 | y=0 54 | for n in range(1,1000): 55 | y += 1/(2*n-1)**3 * ( B1x/(E1-G1/(2*n-1)**2-ħω-1j*Γ1) 56 | + B2x/(E1+Δ1-G1s/(2*n-1)**2-ħω-1j*Γ1) ) 57 | return y 58 | 59 | def Epsilon_C(ħω): 60 | χ2 = ħω/E2 61 | return C/((1-χ2**2)-1j*χ2*γ) 62 | 63 | ev_min=1.5 64 | ev_max=5.6 65 | npoints=500 66 | 67 | eV = np.linspace(ev_min, ev_max, npoints) 68 | μm = 4.13566733e-1*2.99792458/eV 69 | εA = Epsilon_A(eV) 70 | εAx = Epsilon_Ax(eV) 71 | εB = Epsilon_B(eV) 72 | εBx = Epsilon_Bx(eV) 73 | εC = Epsilon_C(eV) 74 | ε = εA + εAx + εB + εBx + εC + εinf 75 | n = (ε**.5).real 76 | k = (ε**.5).imag 77 | α = 4*π*k/μm*1e4 #1/cm 78 | 79 | 80 | #============================ DATA OUTPUT ================================= 81 | file = open('out.txt', 'w') 82 | for i in range(npoints-1, -1, -1): 83 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 84 | file.close() 85 | 86 | 87 | #=============================== PLOT ===================================== 88 | plt.rc('font', family='Arial', size='14') 89 | 90 | #plot ε vs eV 91 | plt.figure(1) 92 | plt.plot(eV, ε.real, label="ε1") 93 | plt.plot(eV, ε.imag, label="ε2") 94 | plt.xlabel('Photon energy (eV)') 95 | plt.ylabel('ε') 96 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 97 | 98 | #plot intermediate data (for debugging) 99 | plt.figure(2) 100 | plt.plot(eV, εA.real, label="Re(εA)") 101 | plt.plot(eV, εAx.real, label="Re(εAx)") 102 | plt.plot(eV, εB.real, label="Re(εB)") 103 | plt.plot(eV, εBx.real, label="Re(εBx)") 104 | plt.plot(eV, εC.real, label="Re(εC)") 105 | plt.xlabel('Photon energy (eV)') 106 | plt.ylabel('ε') 107 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 108 | 109 | plt.figure(3) 110 | plt.plot(eV, εA.imag, label="Im(εA)") 111 | plt.plot(eV, εAx.imag, label="Im(εAx)") 112 | plt.plot(eV, εB.imag, label="Im(εB)") 113 | plt.plot(eV, εBx.imag, label="Im(εBx)") 114 | plt.plot(eV, εC.imag, label="Im(εC)") 115 | plt.xlabel('Photon energy (eV)') 116 | plt.ylabel('ε') 117 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 118 | 119 | #plot n,k vs eV 120 | plt.figure(4) 121 | plt.plot(eV, n, label="n") 122 | plt.plot(eV, k, label="k") 123 | plt.xlabel('Photon energy (eV)') 124 | plt.ylabel('n, k') 125 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 126 | 127 | #plot n,k vs μm 128 | plt.figure(5) 129 | plt.plot(μm, n, label="n") 130 | plt.plot(μm, k, label="k") 131 | plt.xlabel('Wavelength (μm)') 132 | plt.ylabel('n, k') 133 | plt.yscale('log') 134 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 135 | 136 | #plot α vs eV 137 | plt.figure(6) 138 | plt.plot(eV,α) 139 | plt.yscale('log') 140 | plt.ylim([1e3,1e7]) 141 | plt.xlabel('Photon energy (eV)') 142 | plt.ylabel('α (1/cm)') -------------------------------------------------------------------------------- /scripts/Suzuki 1995 - PbSe.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Mikhail Polyanskiy 3 | # Last modified: 2017-04-13 4 | # Original data: Suzuki et al. 1995, https://doi.org/10.1063/1.358926 5 | 6 | import numpy as np 7 | import matplotlib.pyplot as plt 8 | π = np.pi 9 | 10 | # model parameters 11 | E0 = 0.31 #eV 12 | A = 0.8 #eV**1.5 13 | Γ0 = 0.01 #eV 14 | 15 | E1 = 1.6 #eV 16 | C1 = 3.5 17 | γ1 = 0.36 18 | 19 | E2 = 2.73 #eV 20 | C2 = 15.4 21 | γ2 = 0.48 22 | 23 | E3 = 4.10 #eV 24 | B = 1.2 25 | Γ3 = 0.30 #eV 26 | 27 | εinf= 1.5 28 | 29 | def Epsilon_0(ħω): 30 | χ0 = (ħω+1j*Γ0) / E0 31 | fχ0 = χ0**-2 * ( 2-(1+χ0)**0.5-(1-χ0)**0.5 ) 32 | return A*E0**-1.5 * fχ0 33 | 34 | def Epsilon_1(ħω): 35 | χ1 = ħω/E1 36 | return C1 / (1 - χ1**2 - 1j*χ1*γ1) 37 | 38 | def Epsilon_2(ħω): 39 | χ1 = ħω/E2 40 | return C2 / (1 - χ1**2 - 1j*χ1*γ2) 41 | 42 | def Epsilon_3(ħω): 43 | χ3 = (ħω+1j*Γ3) / E3 44 | return -B*χ3**-2*np.log(1-χ3**2) 45 | 46 | 47 | ev_min=1.15 48 | ev_max=5.4 49 | npoints=500 50 | 51 | eV = np.linspace(ev_min, ev_max, npoints) 52 | μm = 4.13566733e-1*2.99792458/eV 53 | ε0 = Epsilon_0(eV) 54 | ε1 = Epsilon_1(eV) 55 | ε2 = Epsilon_2(eV) 56 | ε3 = Epsilon_3(eV) 57 | ε = ε0 + ε1 + ε2 + ε3 + εinf 58 | n = (ε**.5).real 59 | k = (ε**.5).imag 60 | α = 4*π*k/μm*1e4 #1/cm 61 | 62 | 63 | #============================ DATA OUTPUT ================================= 64 | file = open('out.txt', 'w') 65 | for i in range(npoints-1, -1, -1): 66 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(μm[i],n[i],k[i])) 67 | file.close() 68 | 69 | 70 | #=============================== PLOT ===================================== 71 | plt.rc('font', family='Arial', size='14') 72 | 73 | #plot ε vs eV 74 | plt.figure(1) 75 | plt.plot(eV, ε.real, label="ε1") 76 | plt.plot(eV, ε.imag, label="ε2") 77 | plt.xlabel('Photon energy (eV)') 78 | plt.ylabel('ε') 79 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 80 | 81 | #plot intermediate data (for debugging) 82 | plt.figure(2) 83 | plt.plot(eV, ε0.real, label="Re(ε0)") 84 | plt.plot(eV, ε1.real, label="Re(ε1)") 85 | plt.plot(eV, ε2.real, label="Re(ε2)") 86 | plt.plot(eV, ε3.real, label="Re(ε3)") 87 | plt.xlabel('Photon energy (eV)') 88 | plt.ylabel('ε') 89 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 90 | 91 | plt.figure(3) 92 | plt.plot(eV, ε0.imag, label="Im(ε0)") 93 | plt.plot(eV, ε1.imag, label="Im(ε1)") 94 | plt.plot(eV, ε2.imag, label="Im(ε2)") 95 | plt.plot(eV, ε3.imag, label="Im(ε3)") 96 | plt.xlabel('Photon energy (eV)') 97 | plt.ylabel('ε') 98 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 99 | 100 | #plot n,k vs eV 101 | plt.figure(4) 102 | plt.plot(eV, n, label="n") 103 | plt.plot(eV, k, label="k") 104 | plt.xlabel('Photon energy (eV)') 105 | plt.ylabel('n, k') 106 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 107 | 108 | #plot n,k vs μm 109 | plt.figure(5) 110 | plt.plot(μm, n, label="n") 111 | plt.plot(μm, k, label="k") 112 | plt.xlabel('Wavelength (μm)') 113 | plt.ylabel('n, k') 114 | plt.yscale('log') 115 | plt.legend(bbox_to_anchor=(0,1.02,1,0),loc=3,ncol=2,borderaxespad=0) 116 | 117 | #plot α vs eV 118 | plt.figure(6) 119 | plt.plot(eV,α) 120 | plt.yscale('log') 121 | plt.ylim([1e3,1e7]) 122 | plt.xlabel('Photon energy (eV)') 123 | plt.ylabel('α (1/cm)') -------------------------------------------------------------------------------- /scripts/Synowicki 2004 - As2S3 -- IR.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Original data: Synowicki et al. 2004, https://doi.org/10.1016/j.tsf.2004.02.028 4 | # NB! Lorentz equation 1a seems to have a typo -- denominator parenthesis should be squared (?) 5 | 6 | # Kramers-Kroning Integration https://doi.org/10.1366/0003702884430380 7 | 8 | # Version history 9 | # 2025-03-03 first version (Pavel Dmitriev) 10 | # 11 | 12 | import numpy as np 13 | import matplotlib.pyplot as plt 14 | 15 | import matplotlib 16 | matplotlib.use("TkAgg") 17 | 18 | 19 | def generate_epsilon(): 20 | auxfuncs = __import__("Synowicki 2004 - Aux funcs") 21 | # 22 | # Model parameters 23 | # 24 | 25 | # Gaussian cm-1 -- only IR 26 | Gaussian_Amplitude = [0.72443, 4.0012, 1.0615, 8.8976] 27 | Gaussian_E0 = [387.09, 330.31, 324.31, 308.96] 28 | Gaussian_Br = [25.814, 68.616, 33.397, 23.55] 29 | 30 | 31 | # # Gaussian eV -- only UV 32 | # Gaussian_Amplitude = [0.50989, 4.92*10**-5, 6.15*10**-6, 0.69671] 33 | # Gaussian_E0 = [6.045, 2.1442, 4.4274, 4.5874] 34 | # Gaussian_Br = [1.7501, 0.21914, 4.2673, 1.188] 35 | # 36 | # 37 | # #Tauc Lorentz eV -- only UV 38 | # TL_A = [191.03, 178.58] 39 | # TL_E0 = [8.4056, 3.5588] 40 | # TL_C = [3.3764, 3.674] 41 | # TL_Eg = [7.3762, 2.4054] 42 | 43 | #Poles 44 | 45 | eps_inf = 1. 46 | 47 | # Simulate range 48 | num_points = 6000 49 | 50 | waveNumber = np.linspace(1, 6000, num_points, True) #cm-1 51 | 52 | # 53 | # Oscillators 54 | # 55 | eps_2 = np.zeros(waveNumber.shape) 56 | eps_1 = np.zeros(waveNumber.shape) 57 | 58 | # 59 | # Gaussian oscillators -- only for IR 60 | # 61 | for i in range(len(Gaussian_E0)): 62 | eps_1_osc, eps_2_osc = auxfuncs.gaussian(waveNumber, Gaussian_E0[i], Gaussian_Amplitude[i], Gaussian_Br[i]) 63 | eps_2 += eps_2_osc 64 | eps_1 += eps_1_osc 65 | 66 | 67 | eps_1 += eps_inf 68 | 69 | epsilon = np.asarray(eps_1 + 1j * eps_2, dtype=np.complex128) 70 | 71 | return waveNumber, epsilon 72 | 73 | 74 | if __name__ == "__main__": 75 | waveNumber, epsilon = generate_epsilon() 76 | model_um = np.divide(waveNumber, 1e4) 77 | 78 | # Model range 79 | fit_points = 200 80 | wl_um = np.linspace(1.7, 33, fit_points, True) 81 | fit_wavenumber = np.divide(1e4, wl_um) 82 | 83 | n = (epsilon ** .5).real 84 | k = (epsilon ** .5).imag 85 | 86 | # 87 | # Interpolate to data range 88 | # 89 | n_interp = np.interp(fit_wavenumber, waveNumber, n) 90 | k_interp = np.interp(fit_wavenumber, waveNumber, k) 91 | 92 | e2_interp = np.interp(fit_wavenumber, waveNumber, epsilon.imag) 93 | e1_interp = np.interp(fit_wavenumber, waveNumber, epsilon.real) 94 | 95 | # ============================ DATA OUTPUT ================================= 96 | file = open('out.txt', 'w') 97 | for i in range(fit_points - 1, -1, -1): 98 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(wl_um[i], n_interp[i], k_interp[i])) 99 | file.close() 100 | 101 | # =============================== PLOT ===================================== 102 | # plot eps1 vs eV 103 | plt.figure(1) 104 | plt.plot(wl_um, e1_interp) 105 | plt.xlabel('Wavelength (um)') 106 | #plt.ylim([0, 12]) 107 | plt.ylabel('epsilon1') 108 | 109 | # plot eps2 vs eV 110 | plt.figure(2) 111 | plt.plot(wl_um, e2_interp) 112 | plt.xlabel('Wavelength (um)') 113 | plt.ylim([0, 15]) 114 | plt.ylabel('epsilon2') 115 | 116 | # plot n,k vs μm 117 | plt.figure(3) 118 | plt.plot(wl_um, n_interp, label="n") 119 | plt.plot(wl_um, k_interp, label="k") 120 | plt.legend() 121 | plt.xlabel('Wavelength (μm)') 122 | 123 | plt.show() 124 | -------------------------------------------------------------------------------- /scripts/Synowicki 2004 - As2S3 -- UV.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Original data: Synowicki et al. 2004, https://doi.org/10.1016/j.tsf.2004.02.028 4 | # NB! Lorentz equation 1a seems to have a typo -- denominator parenthesis should be squared (?) 5 | 6 | # Kramers-Kroning Integration https://doi.org/10.1366/0003702884430380 7 | 8 | # Version history 9 | # 2025-03-03 first version (Pavel Dmitriev) 10 | # 11 | 12 | import numpy as np 13 | import matplotlib.pyplot as plt 14 | 15 | import matplotlib 16 | matplotlib.use("TkAgg") 17 | 18 | 19 | def generate_epsilon(num_points=10000, min_eV=0.01, max_eV=30.0): 20 | auxfuncs = __import__("Synowicki 2004 - Aux funcs") 21 | # 22 | # Model parameters 23 | # 24 | 25 | # # Gaussian cm-1 -- only IR 26 | # Gaussian_Amplitude = [0.72443, 4.0012, 1.0615, 8.8976] 27 | # Gaussian_E0 = [387.09, 330.31, 324.31, 308.96] 28 | # Gaussian_Br = [25.814, 68.616, 33.397, 23.55] 29 | 30 | 31 | # Gaussian eV -- only UV 32 | Gaussian_Amplitude = [0.50989, 4.92*10**-5, 6.15*10**-6, 0.69671] 33 | Gaussian_E0 = [6.045, 2.1442, 4.4274, 4.5874] 34 | Gaussian_Br = [1.7501, 0.21914, 4.2673, 1.188] 35 | 36 | 37 | #Tauc Lorentz eV -- only UV 38 | TL_A = [191.03, 178.58] 39 | TL_E0 = [8.4056, 3.5588] 40 | TL_C = [3.3764, 3.674] 41 | TL_Eg = [7.3762, 2.4054] 42 | 43 | #Poles 44 | 45 | eps_inf = 1 46 | 47 | # Simulate range 48 | eV = np.linspace(min_eV, max_eV, num_points, True) 49 | 50 | 51 | # 52 | # Oscillators 53 | # 54 | eps_2 = np.zeros(eV.shape) 55 | eps_1 = np.zeros(eV.shape) 56 | 57 | # 58 | # Gaussian oscillators -- only for UV 59 | # 60 | for i in range(len(Gaussian_E0)): 61 | eps_1_osc, eps_2_osc = auxfuncs.gaussian(eV, Gaussian_E0[i], Gaussian_Amplitude[i], Gaussian_Br[i]) 62 | eps_2 += eps_2_osc 63 | eps_1 += eps_1_osc 64 | 65 | # 66 | # Tauc-Lorentz oscillators -- only for UV 67 | # 68 | for i in range(len(TL_E0)): 69 | eps_1_osc, eps_2_osc = auxfuncs.taucLorentz_KK(eV, TL_E0[i], TL_A[i], TL_C[i], TL_Eg[i]) 70 | eps_2 += eps_2_osc 71 | eps_1 += eps_1_osc 72 | 73 | eps_1 += eps_inf 74 | 75 | epsilon = np.asarray(eps_1 + 1j * eps_2, dtype=np.complex128) 76 | 77 | return eV, epsilon 78 | 79 | 80 | if __name__ == "__main__": 81 | eV, epsilon = generate_epsilon() 82 | 83 | # Model range 84 | fit_points = 200 85 | fit_eV = np.linspace(0.073, 9.53, fit_points, True) 86 | 87 | n = (epsilon ** .5).real 88 | k = (epsilon ** .5).imag 89 | 90 | # 91 | # Interpolate to data range 92 | # 93 | n_interp = np.interp(fit_eV, eV, n) 94 | k_interp = np.interp(fit_eV, eV, k) 95 | 96 | wl_um = np.divide(1.23984193, fit_eV) 97 | 98 | # ============================ DATA OUTPUT ================================= 99 | file = open('out.txt', 'w') 100 | for i in range(fit_points - 1, -1, -1): 101 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(wl_um[i], n_interp[i], k_interp[i])) 102 | file.close() 103 | 104 | # =============================== PLOT ===================================== 105 | # plot eps1 vs eV 106 | plt.figure(1) 107 | plt.plot(eV, epsilon.real) 108 | plt.xlabel('Photon energy (eV)') 109 | plt.xlim([0.073, 9.53]) 110 | plt.ylim([0., 10.]) 111 | plt.ylabel('epsilon1') 112 | 113 | # plot n vs eV 114 | plt.figure(2) 115 | plt.plot(eV, epsilon.imag) 116 | plt.xlabel('Photon energy (eV)') 117 | plt.xlim([0.073, 9.53]) 118 | plt.ylim([0., 8.]) 119 | plt.ylabel('epsilon2') 120 | 121 | # plot n,k vs μm 122 | plt.figure(3) 123 | plt.plot(eV, epsilon.real, label="eps_1") 124 | plt.plot(eV, epsilon.imag, label="eps_2") 125 | plt.legend() 126 | plt.xlabel('Energy (eV)') 127 | plt.xlim([0.073, 9.53]) 128 | plt.ylim([0., 10.]) 129 | 130 | # plot n,k vs μm 131 | plt.figure(4) 132 | plt.plot(wl_um, n_interp, label="n") 133 | plt.plot(wl_um, k_interp, label="k") 134 | plt.legend() 135 | plt.xlabel('Wavelength (μm)') 136 | 137 | plt.show() 138 | -------------------------------------------------------------------------------- /scripts/Synowicki 2004 - Aux funcs.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Kramers-Kroning Integration https://doi.org/10.1366/0003702884430380 4 | 5 | # Tauc-Lorentz oscillators https://doi.org/10.1063/1.118064 6 | 7 | # Version history 8 | # 2025-03-07 first version (Pavel Dmitriev) 9 | # 10 | 11 | import numpy as np 12 | import matplotlib.pyplot as plt 13 | 14 | import matplotlib 15 | matplotlib.use("TkAgg") 16 | # 17 | # def tauc_lorentz_analytic(eV, Eg, A, E0, C): 18 | # 19 | # # 20 | # # Epsilon 2 21 | # # 22 | # 23 | # eps2 = np.zeros(eV.shape) 24 | # for i, e in enumerate(eV): 25 | # if e > Eg: 26 | # eps2[i] = (1 / e) * ( (A * E0 * C * (e - Eg)**2) 27 | # / ((e**2 - E0**2)**2 + C**2 * e**2)) 28 | # 29 | # # 30 | # # Epsilon 1 closed form 31 | # # 32 | # eps1 = np.zeros(eV.shape) 33 | # for i, e in enumerate(eV): 34 | # 35 | # alpha_ln = (Eg**2 - E0**2)*e*2 + Eg**2*C**2 - E0**2 * (E0**2 + 3*Eg**2) 36 | # alpha_atan = (e**2 - E0**2) * (E0**2 +Eg**2) + Eg**2 * C**2 37 | # 38 | # alpha = np.sqrt(4 * E0**2 - C**2) 39 | # gamma = np.sqrt(E0**2 - C**2/2) 40 | # 41 | # xi4 = (e**2 - gamma**2)**2 + alpha**2 * C**2 / 4 42 | # 43 | # eps1[i] = ( 44 | # + (1/2)*(A/np.pi)*(C/xi4)*(alpha_ln/(alpha*E0))*np.log2( 45 | # (E0**2 + Eg**2 + alpha*Eg) / (E0**2 + Eg**2 - alpha*Eg) 46 | # ) 47 | # - (A / (np.pi * xi4)) * (alpha_atan/E0) * (np.pi 48 | # - np.arctan((2*Eg+alpha)/C) 49 | # + np.arctan((-2*Eg+alpha)/C)) 50 | # + 2 * (A*E0*C)/(np.pi*xi4) * (Eg*(e**2-gamma**2)*(np.pi + 2*np.arctan((gamma**2 - Eg**2)/(alpha*C)))) 51 | # - 2 * ((A*E0*C)/(np.pi * xi4))*((e**2 + Eg**2)/e)*np.log2(np.abs(e-Eg)/(e+Eg)) 52 | # + 2 * (A*E0*C)/(np.pi*xi4)*Eg*np.log2((np.abs(e-Eg)*(e+Eg))/np.sqrt((E0**2 - Eg**2)**2+Eg**2*C**2)) 53 | # ) 54 | # 55 | # return eps1, eps2 56 | # 57 | 58 | 59 | def taucLorentz_KK(eV, E0, A, C, Eg): 60 | eps_2 = np.zeros(eV.shape) 61 | 62 | for j, e in enumerate(eV): 63 | if e > Eg: 64 | eps_2[j] = (1. / e) * ( 65 | (A * E0 * C * (e - Eg) ** 2) / 66 | ( 67 | (e ** 2 - E0 ** 2) ** 2 + C ** 2 * e ** 2 68 | ) 69 | ) 70 | 71 | eps_1 = kk_integral_maclaurin(eV, eps_2) 72 | 73 | return eps_1, eps_2 74 | 75 | 76 | def lorentz(eV, A, FWHM, Eg): 77 | Br = FWHM #/ (2 * np.sqrt(np.log(2))) 78 | # epsilon = [A*e**2 / (Eg**2-e**2-1j*e*Br) for e in eV] 79 | # return np.real(epsilon), np.imag(epsilon) 80 | 81 | eps_2 = [A * Br**2 * Eg * e / ((Eg**2 - e**2)**2 + Br**2*e**2) for e in eV] 82 | eps_1 = [A * Br * Eg * (Eg**2 - e**2) / ((Eg**2 - e**2)**2 + Br**2*e**2) for e in eV] 83 | return np.asarray(eps_1), np.asarray(eps_2) 84 | 85 | 86 | def gaussian(eV, E0, Amplitude, Br): 87 | f = (0.5 / np.sqrt(np.log(2))) 88 | eps_2_osc = [ 89 | Amplitude*np.exp( 90 | -((e-E0)/(f*Br))**2 91 | ) - 92 | Amplitude*np.exp( 93 | -((e+E0)/(f*Br))**2 94 | ) 95 | for e in eV 96 | ] 97 | 98 | eps_1_osc = kk_integral_maclaurin(eV, eps_2_osc) 99 | return eps_1_osc, np.asarray(eps_2_osc) 100 | 101 | 102 | def kk_integral_maclaurin(f, eps2): 103 | # 104 | # KK integral 105 | # 106 | df = f[1] - f[0] 107 | eps1 = np.zeros(f.shape) 108 | for i, e in enumerate(f): 109 | prefactor = (2 / np.pi) * 2 * df 110 | 111 | maclaurin_sum = 0 112 | if i % 2 == 0: 113 | js = [z for z in range(f.shape[-1])[1::2]] 114 | else: 115 | js = [z for z in range(f.shape[-1])[0::2]] 116 | 117 | for j in js: 118 | maclaurin_sum += (1. / 2.) * ( 119 | eps2[j] / (f[j] - e) + 120 | eps2[j] / (f[j] + e) 121 | ) 122 | eps1[i] = prefactor * maclaurin_sum 123 | 124 | return eps1 125 | 126 | -------------------------------------------------------------------------------- /scripts/Synowicki 2004 - MgO -- IR.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Original data: Synowicki et al. 2004, https://doi.org/10.1016/j.tsf.2004.02.028 4 | # NB! Lorentz equation 1a seems to have a typo -- denominator parenthesis should be squared (?) 5 | 6 | # Kramers-Kroning Integration https://doi.org/10.1366/0003702884430380 7 | 8 | # Version history 9 | # 2025-03-03 first version (Pavel Dmitriev) 10 | # 11 | 12 | import numpy as np 13 | import matplotlib.pyplot as plt 14 | 15 | import matplotlib 16 | matplotlib.use("TkAgg") 17 | 18 | 19 | def generate_epsilon(): 20 | auxfuncs = __import__("Synowicki 2004 - Aux funcs") 21 | # 22 | # Model parameters 23 | # 24 | 25 | # # Gaussian eV -- only UV 26 | # Gaussian_Amplitude = [0.55291, 4.2344, 6.71*10**-4, 6.18*10**-5, 3.56*10**-5] 27 | # Gaussian_E0 = [8.6734, 7.6359, 7.2652, 5.0889, 4.3675] 28 | # Gaussian_Br = [1.0501, 0.18511, 2.1479, 0.80321, 0.60936] 29 | 30 | # Lorentz cm-1 -- only IR 31 | Lorentz_Amplitude = [1702.3, 0.26993] 32 | Lorentz_Eg = [396.73, 643.56] 33 | Lorentz_Br = [1.5498, 106.86] 34 | 35 | # #Tauc Lorentz eV -- only UV 36 | # TL_A = [297.39, 2274.6] 37 | # TL_C = [4.4633, 0.17911] 38 | # TL_E0 = [9.623, 7.7091] 39 | # TL_Eg = [7.9862, 7.6602] 40 | 41 | #Poles 42 | 43 | eps_inf = 1 44 | 45 | # Simulate range 46 | num_points = 6000 47 | 48 | waveNumber = np.linspace(1, 6000, num_points, True) #cm-1 49 | 50 | # 51 | # Oscillators 52 | # 53 | eps_2 = np.zeros(waveNumber.shape) 54 | eps_1 = np.zeros(waveNumber.shape) 55 | 56 | # 57 | # Lorentz oscillators 58 | # 59 | for i in range(len(Lorentz_Amplitude)): 60 | eps_1_osc, eps_2_osc = auxfuncs.lorentz(waveNumber, Lorentz_Amplitude[i], Lorentz_Br[i], Lorentz_Eg[i]) 61 | eps_2 += eps_2_osc 62 | eps_1 += eps_1_osc 63 | 64 | 65 | eps_1 += eps_inf 66 | 67 | epsilon = np.asarray(eps_1 + 1j * eps_2, dtype=np.complex128) 68 | 69 | return waveNumber, epsilon 70 | 71 | 72 | 73 | if __name__ == "__main__": 74 | waveNumber, epsilon = generate_epsilon() 75 | 76 | # Model range 77 | fit_points = 200 78 | wl_um = np.linspace(1.7, 33, fit_points, True) 79 | fit_wavenumber = np.divide(1e4, wl_um) 80 | 81 | 82 | n = (epsilon ** .5).real 83 | k = (epsilon ** .5).imag 84 | 85 | # 86 | # Interpolate to data range 87 | # 88 | n_interp = np.interp(fit_wavenumber, waveNumber, n) 89 | k_interp = np.interp(fit_wavenumber, waveNumber, k) 90 | 91 | e2_interp = np.interp(fit_wavenumber, waveNumber, epsilon.imag) 92 | e1_interp = np.interp(fit_wavenumber, waveNumber, epsilon.real) 93 | 94 | # ============================ DATA OUTPUT ================================= 95 | file = open('out.txt', 'w') 96 | for i in range(fit_points - 1, -1, -1): 97 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(wl_um[i], n_interp[i], k_interp[i])) 98 | file.close() 99 | 100 | # =============================== PLOT ===================================== 101 | # plot eps1 vs eV 102 | plt.figure(1) 103 | plt.plot(wl_um, e1_interp) 104 | plt.xlabel('Wavelength (um)') 105 | plt.ylabel('epsilon1') 106 | 107 | # plot eps2 vs eV 108 | plt.figure(2) 109 | plt.plot(wl_um, e2_interp) 110 | plt.xlabel('Wavelength (um)') 111 | plt.ylabel('epsilon2') 112 | 113 | # plot n,k vs μm 114 | plt.figure(3) 115 | plt.plot(wl_um, n_interp, label="n") 116 | plt.plot(wl_um, k_interp, label="k") 117 | plt.legend() 118 | plt.xlabel('Wavelength (μm)') 119 | 120 | plt.show() 121 | -------------------------------------------------------------------------------- /scripts/Synowicki 2004 - MgO -- UV.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Original data: Synowicki et al. 2004, https://doi.org/10.1016/j.tsf.2004.02.028 4 | # NB! Lorentz equation 1a seems to have a typo -- denominator parenthesis should be squared (?) 5 | 6 | # Kramers-Kroning Integration https://doi.org/10.1366/0003702884430380 7 | 8 | # Version history 9 | # 2025-03-03 first version (Pavel Dmitriev) 10 | # 11 | 12 | import numpy as np 13 | import matplotlib.pyplot as plt 14 | 15 | import matplotlib 16 | matplotlib.use("TkAgg") 17 | 18 | 19 | def generate_epsilon(num_points=10000, min_eV=0.01, max_eV=30.0): 20 | auxfuncs = __import__("Synowicki 2004 - Aux funcs") 21 | # 22 | # Model parameters 23 | # 24 | 25 | # Gaussian eV -- only UV 26 | Gaussian_Amplitude = [0.55291, 4.2344, 6.71*10**-4, 6.18*10**-5, 3.56*10**-5] 27 | Gaussian_E0 = [8.6734, 7.6359, 7.2652, 5.0889, 4.3675] 28 | Gaussian_Br = [1.0501, 0.18511, 2.1479, 0.80321, 0.60936] 29 | 30 | # # Lorentz cm-1 -- only IR 31 | # Lorentz_Amplitude = [1702.3, 0.26993] 32 | # Lorentz_Eg = [396.73, 643.56] 33 | # Lorentz_Br = [1.5498, 106.86] 34 | 35 | #Tauc Lorentz eV -- only UV 36 | TL_A = [297.39, 2274.6] 37 | TL_C = [4.4633, 0.17911] 38 | TL_E0 = [9.623, 7.7091] 39 | TL_Eg = [7.9862, 7.6602] 40 | 41 | #Poles 42 | 43 | eps_inf = 1. 44 | 45 | # Simulate range 46 | eV = np.linspace(min_eV, max_eV, num_points, True) 47 | 48 | 49 | # 50 | # Oscillators 51 | # 52 | eps_2 = np.zeros(eV.shape) 53 | eps_1 = np.zeros(eV.shape) 54 | 55 | # 56 | # Gaussian oscillators -- only for UV 57 | # 58 | for i in range(len(Gaussian_E0)): 59 | eps_1_osc, eps_2_osc = auxfuncs.gaussian(eV, Gaussian_E0[i], Gaussian_Amplitude[i], Gaussian_Br[i]) 60 | eps_2 += eps_2_osc 61 | eps_1 += eps_1_osc 62 | 63 | # 64 | # Tauc-Lorentz oscillators -- only for UV 65 | # 66 | for i in range(len(TL_E0)): 67 | eps_1_osc, eps_2_osc = auxfuncs.taucLorentz_KK(eV, TL_E0[i], TL_A[i], TL_C[i], TL_Eg[i]) 68 | eps_2 += eps_2_osc 69 | eps_1 += eps_1_osc 70 | 71 | eps_1 += eps_inf 72 | 73 | epsilon = np.asarray(eps_1 + 1j * eps_2, dtype=np.complex128) 74 | 75 | return eV, epsilon 76 | 77 | 78 | if __name__ == "__main__": 79 | eV, epsilon = generate_epsilon() 80 | 81 | # Model range 82 | fit_points = 200 83 | fit_eV = np.linspace(0.073, 9.53, fit_points, True) 84 | 85 | 86 | n = (epsilon ** .5).real 87 | k = (epsilon ** .5).imag 88 | 89 | # 90 | # Interpolate to data range 91 | # 92 | n_interp = np.interp(fit_eV, eV, n) 93 | k_interp = np.interp(fit_eV, eV, k) 94 | 95 | wl_um = np.divide(1.23984193, fit_eV) 96 | 97 | # ============================ DATA OUTPUT ================================= 98 | file = open('out.txt', 'w') 99 | for i in range(fit_points - 1, -1, -1): 100 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(wl_um[i], n_interp[i], k_interp[i])) 101 | file.close() 102 | 103 | # =============================== PLOT ===================================== 104 | # plot eps1 vs eV 105 | plt.figure(1) 106 | plt.plot(eV, epsilon.real) 107 | plt.xlabel('Photon energy (eV)') 108 | plt.xlim([0.073, 9.53]) 109 | plt.ylim([2., 9.]) 110 | plt.ylabel('epsilon1') 111 | 112 | # plot n vs eV 113 | plt.figure(2) 114 | plt.plot(eV, epsilon.imag) 115 | plt.xlabel('Photon energy (eV)') 116 | plt.xlim([0.073, 9.53]) 117 | plt.ylim([0., 5.]) 118 | plt.ylabel('epsilon2') 119 | 120 | # plot n,k vs μm 121 | plt.figure(3) 122 | plt.plot(eV, epsilon.real, label="eps_1") 123 | plt.plot(eV, epsilon.imag, label="eps_2") 124 | plt.legend() 125 | plt.xlabel('Energy (eV)') 126 | plt.xlim([0.073, 9.53]) 127 | plt.ylim([0., 9.]) 128 | 129 | # plot n,k vs μm 130 | plt.figure(4) 131 | plt.plot(wl_um, n_interp, label="n") 132 | plt.plot(wl_um, k_interp, label="k") 133 | plt.legend() 134 | plt.xlabel('Wavelength (μm)') 135 | 136 | plt.show() 137 | -------------------------------------------------------------------------------- /scripts/Synowicki 2004 - ZrO2 -- IR.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Original data: Synowicki et al. 2004, https://doi.org/10.1016/j.tsf.2004.02.028 4 | # NB! Lorentz equation 1a seems to have a typo -- denominator parenthesis should be squared (?) 5 | 6 | # Kramers-Kroning Integration https://doi.org/10.1366/0003702884430380 7 | 8 | # Version history 9 | # 2025-03-03 first version (Pavel Dmitriev) 10 | # 11 | 12 | import numpy as np 13 | import matplotlib.pyplot as plt 14 | 15 | import matplotlib 16 | matplotlib.use("TkAgg") 17 | 18 | 19 | def generate_epsilon(): 20 | auxfuncs = __import__("Synowicki 2004 - Aux funcs") 21 | # 22 | # Model parameters 23 | # 24 | 25 | # Gaussian cm-1 -- only IR 26 | Gaussian_Amplitude = [24.263, 7.32, 32.304, 0.2135, 1.1005, 1.6355, 0.4633] 27 | Gaussian_E0 = [69.044, 331.92, 339.2, 350.77, 476.18, 539.94, 709.72] 28 | Gaussian_Br = [322.13, 43.363, 134.76, 907.53, 68.217, 122.4, 99.048] 29 | 30 | # #Tauc Lorentz eV -- only UV 31 | # TL_A = [98.541, 145.09, 255.06] 32 | # TL_E0 = [6.1261, 7.2693, 8.7795] 33 | # TL_C = [1.2042, 2.2904, 2.8711] 34 | # TL_Eg = [5.124, 5.3382, 6.8865] 35 | 36 | # Poles 37 | 38 | eps_inf = 1 39 | 40 | # Simulate range 41 | num_points = 5601 42 | 43 | waveNumber = np.linspace(300, 5900, num_points, True) # cm-1 44 | 45 | # Simulate range 46 | num_points = 6000 47 | 48 | waveNumber = np.linspace(1, 6000, num_points, True) # cm-1 49 | 50 | # 51 | # Oscillators 52 | # 53 | eps_2 = np.zeros(waveNumber.shape) 54 | eps_1 = np.zeros(waveNumber.shape) 55 | 56 | # 57 | # Gaussian oscillators -- only for IR 58 | # 59 | for i in range(len(Gaussian_E0)): 60 | eps_1_osc, eps_2_osc = auxfuncs.gaussian(waveNumber, Gaussian_E0[i], Gaussian_Amplitude[i], Gaussian_Br[i]) 61 | eps_2 += eps_2_osc 62 | eps_1 += eps_1_osc 63 | 64 | eps_1 += eps_inf 65 | 66 | epsilon = np.asarray(eps_1 + 1j * eps_2, dtype=np.complex128) 67 | 68 | return waveNumber, epsilon 69 | 70 | 71 | if __name__ == "__main__": 72 | waveNumber, epsilon = generate_epsilon() 73 | 74 | # Model range 75 | fit_points = 200 76 | wl_um = np.linspace(1.7, 33, fit_points, True) 77 | fit_wavenumber = np.divide(1e4, wl_um) 78 | 79 | n = (epsilon ** .5).real 80 | k = (epsilon ** .5).imag 81 | 82 | # 83 | # Interpolate to data range 84 | # 85 | n_interp = np.interp(fit_wavenumber, waveNumber, n) 86 | k_interp = np.interp(fit_wavenumber, waveNumber, k) 87 | 88 | e2_interp = np.interp(fit_wavenumber, waveNumber, epsilon.imag) 89 | e1_interp = np.interp(fit_wavenumber, waveNumber, epsilon.real) 90 | 91 | # ============================ DATA OUTPUT ================================= 92 | file = open('out.txt', 'w') 93 | for i in range(fit_points - 1, -1, -1): 94 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(wl_um[i], n_interp[i], k_interp[i])) 95 | file.close() 96 | 97 | # =============================== PLOT ===================================== 98 | # plot eps1 vs eV 99 | plt.figure(1) 100 | plt.plot(wl_um, e1_interp) 101 | plt.xlabel('Wavelength (um)') 102 | plt.ylim([-20, 20]) 103 | plt.ylabel('epsilon1') 104 | 105 | # plot eps2 vs eV 106 | plt.figure(2) 107 | plt.plot(wl_um, e2_interp) 108 | plt.xlabel('Wavelength (um)') 109 | plt.ylim([0, 50]) 110 | plt.ylabel('epsilon2') 111 | 112 | # plot n,k vs μm 113 | plt.figure(3) 114 | plt.plot(wl_um, n_interp, label="n") 115 | plt.plot(wl_um, k_interp, label="k") 116 | plt.legend() 117 | plt.xlabel('Wavelength (μm)') 118 | 119 | plt.show() 120 | -------------------------------------------------------------------------------- /scripts/Synowicki 2004 - ZrO2 -- UV.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Original data: Synowicki et al. 2004, https://doi.org/10.1016/j.tsf.2004.02.028 4 | # NB! Lorentz equation 1a seems to have a typo -- denominator parenthesis should be squared (?) 5 | 6 | # Kramers-Kroning Integration https://doi.org/10.1366/0003702884430380 7 | 8 | # Version history 9 | # 2025-03-03 first version (Pavel Dmitriev) 10 | # 11 | 12 | import numpy as np 13 | import matplotlib.pyplot as plt 14 | 15 | import matplotlib 16 | matplotlib.use("TkAgg") 17 | 18 | 19 | def generate_epsilon(num_points=10000, min_eV=0.01, max_eV=30.0): 20 | auxfuncs = __import__("Synowicki 2004 - Aux funcs") 21 | # 22 | # Model parameters 23 | # 24 | 25 | # # Gaussian cm-1 -- only IR 26 | # Gaussian_Amplitude = [24.263, 7.32, 32.304, 0.2135, 1.1005, 1.6355, 0.4633] 27 | # Gaussian_E0 = [69.044, 331.92, 339.2, 350.77, 476.18, 539.94, 709.72] 28 | # Gaussian_Br = [322.13, 43.363, 134.76, 907.53, 68.217, 122.4, 99.048] 29 | 30 | #Tauc Lorentz eV -- only UV 31 | TL_A = [98.541, 145.09, 255.06] 32 | TL_E0 = [6.1261, 7.2693, 8.7795] 33 | TL_C = [1.2042, 2.2904, 2.8711] 34 | TL_Eg = [5.124, 5.3382, 6.8865] 35 | 36 | #Poles 37 | 38 | eps_inf = 1 39 | 40 | # Simulate range 41 | eV = np.linspace(min_eV, max_eV, num_points, True) 42 | 43 | 44 | # 45 | # Oscillators 46 | # 47 | eps_2 = np.zeros(eV.shape) 48 | eps_1 = np.zeros(eV.shape) 49 | 50 | # 51 | # Tauc-Lorentz oscillators -- only for UV 52 | # 53 | for i in range(len(TL_E0)): 54 | eps_1_osc, eps_2_osc = auxfuncs.taucLorentz_KK(eV, TL_E0[i], TL_A[i], TL_C[i], TL_Eg[i]) 55 | eps_2 += eps_2_osc 56 | eps_1 += eps_1_osc 57 | 58 | eps_1 += eps_inf 59 | 60 | epsilon = np.asarray(eps_1 + 1j * eps_2, dtype=np.complex128) 61 | 62 | return eV, epsilon 63 | 64 | 65 | if __name__ == "__main__": 66 | eV, epsilon = generate_epsilon() 67 | 68 | # Model range 69 | fit_points = 200 70 | fit_eV = np.linspace(0.073, 9.53, fit_points, True) 71 | 72 | 73 | n = (epsilon ** .5).real 74 | k = (epsilon ** .5).imag 75 | 76 | # 77 | # Interpolate to data range 78 | # 79 | n_interp = np.interp(fit_eV, eV, n) 80 | k_interp = np.interp(fit_eV, eV, k) 81 | 82 | wl_um = np.divide(1.23984193, fit_eV) 83 | 84 | # ============================ DATA OUTPUT ================================= 85 | file = open('out.txt', 'w') 86 | for i in range(fit_points - 1, -1, -1): 87 | file.write('\n {:.4e} {:.4e} {:.4e}'.format(wl_um[i], n_interp[i], k_interp[i])) 88 | file.close() 89 | 90 | # =============================== PLOT ===================================== 91 | # plot eps1 vs eV 92 | plt.figure(1) 93 | plt.plot(eV, epsilon.real) 94 | plt.xlabel('Photon energy (eV)') 95 | plt.xlim([0.073, 9.53]) 96 | plt.ylim([2., 9.]) 97 | plt.ylabel('epsilon1') 98 | 99 | # plot n vs eV 100 | plt.figure(2) 101 | plt.plot(eV, epsilon.imag) 102 | plt.xlabel('Photon energy (eV)') 103 | plt.xlim([0.073, 9.53]) 104 | plt.ylim([0., 5.]) 105 | plt.ylabel('epsilon2') 106 | 107 | # plot n,k vs μm 108 | plt.figure(3) 109 | plt.plot(eV, epsilon.real, label="eps_1") 110 | plt.plot(eV, epsilon.imag, label="eps_2") 111 | plt.legend() 112 | plt.xlabel('Energy (eV)') 113 | plt.xlim([0.073, 9.53]) 114 | plt.ylim([0., 9.]) 115 | 116 | # plot n,k vs μm 117 | plt.figure(4) 118 | plt.plot(wl_um, n_interp, label="n") 119 | plt.plot(wl_um, k_interp, label="k") 120 | plt.legend() 121 | plt.xlabel('Wavelength (μm)') 122 | 123 | plt.show() 124 | -------------------------------------------------------------------------------- /scripts/Tsuda 2018 - PMMA (LD model).py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Braden Czapla (2019) 3 | # Original data: Tsuda et al. 2018, https://doi.org/10.1364/OE.26.006899 4 | 5 | # Version history 6 | # 2019-04-30 first version (Braden Czapla) 7 | # 2025-02-28 simplify output (Misha Polyanskiy) 8 | 9 | from __future__ import absolute_import, division, print_function 10 | import numpy as np 11 | import matplotlib.pyplot as plt 12 | 13 | ############################################################################### 14 | 15 | # Determine wavelengths to sample 16 | def w(w_max, w_min, step): 17 | linspace_lower = (np.floor_divide(w_min, step)+1)*step 18 | N = np.floor_divide(w_max-w_min, step) 19 | linspace_upper = linspace_lower + N*step 20 | w = np.linspace(linspace_lower, linspace_upper, int(N)+1) 21 | 22 | if not np.isclose(w[0], w_min, atol=step/5.): 23 | w = np.concatenate((np.array([w_min]), w)) 24 | 25 | if not np.isclose(w[-1], w_max, atol=step/5.): 26 | w = np.concatenate((w,np.array([w_max]))) 27 | 28 | return w, len(w) 29 | 30 | # Compute dielectric function using Lorentzian model. 31 | # Units of w and ResFreq must match and must be directly proportional to angular frequency. All other parameters are unitless. 32 | def Lorentzian(w, ResFreq, Strength, Damping, Eps_Inf): 33 | Permittivity = Eps_Inf*np.ones(len(w), dtype=complex) 34 | for ii in range(len(ResFreq)): 35 | Permittivity += Strength[ii]/( 1. - (w/ResFreq[ii])**2 - 1j*Damping[ii]*(w/ResFreq[ii]) ) 36 | return Permittivity 37 | 38 | ############################################################################### 39 | 40 | ## Wavelengths to sample ## 41 | w_um_max = 10000./550. # [um] 42 | w_um_min = 10000./4000. # [um] 43 | step_um = 0.01 # [um] 44 | 45 | w_um, N_freq = w(w_um_max, w_um_min, step_um) 46 | #w_um = np.linspace(10000./4000., 10000./550., 10000) 47 | w_invcm = 10000./w_um 48 | ## ## 49 | 50 | ## Model Parameters ## 51 | # See Table 1 52 | ResFreq = np.array([752.25, 808.09, 825.19, 843.16, 913.82, 965.31, 989.60, 1066.27, 1149.37, 1190.32, 1241.23, 1269.59, 1361.50, 1387.61, 1434.77, 1450.59, 1481.89, 1730.18, 2840.98, 2920.93, 2950.55, 2997.71, 3440.07]) # [cm^-1] 53 | Strength = np.array([3.18E-03, 6.94E-04, 1.13E-04, 2.86E-03, 1.68E-03, 3.94E-03, 2.79E-03, 1.10E-03, 2.92E-02, 1.04E-02, 6.64E-03, 5.49E-03, 1.09E-03, 1.07E-03, 1.34E-03, 4.11E-03, 2.12E-03, 1.56E-02, 6.66E-05, 8.42E-04, 6.60E-04, 9.53E-04, 4.15E-05]) 54 | Damping = np.array([13.65, 15.51, 4.21, 23.09, 32.50, 26.70, 14.68, 13.56, 31.12, 22.12, 21.38, 24.66, 41.97, 15.80, 10.56, 25.15, 19.17, 9.40, 15.32, 60.94, 18.80, 36.68, 33.89])/ResFreq 55 | EpsInf = 2.162 56 | ## ## 57 | 58 | ## Generate and Save Data ## 59 | eps = Lorentzian(w_invcm, ResFreq, Strength, Damping, EpsInf) 60 | RefInd = np.sqrt(eps) 61 | 62 | export = np.column_stack((w_um, np.real(RefInd), np.imag(RefInd))) 63 | np.savetxt('out.txt', export, fmt=' %4.3f %#.6g %#.3e') 64 | 65 | ## Plotting ## Note: This is not an exact match because Fig. 3 plots the results of the Brendel-Bormann model. The Lorentz model is very similar, but with more extreme peaks. 66 | plt.figure('Figure 3a - Real(ϵ)') 67 | plt.plot(w_invcm, np.real(eps), label='PMMA') 68 | plt.legend(loc=1) 69 | plt.xlim(500,4000) 70 | plt.ylim(1,3) 71 | plt.xlabel('Wavenumber (cm$^{-1}$)') 72 | plt.ylabel('Real(ϵ)') 73 | 74 | 75 | plt.figure('Figure 3b - Imag(ϵ)') 76 | plt.plot(w_invcm, np.imag(eps), label='PMMA') 77 | 78 | plt.legend(loc=1) 79 | plt.xlim(500,4000) 80 | plt.ylim(0,2) 81 | plt.xlabel('Wavenumber (cm$^{-1}$)') 82 | plt.ylabel('Imag(ϵ)') 83 | ## ## -------------------------------------------------------------------------------- /scripts/Zhang 1998 - Kapton.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Author: Braden Czapla (2019) 3 | # Original data: Zhang 1998, https://doi.org/10.1023/A:1022655309574 4 | 5 | # Version history 6 | # 2019-05-17 first version (Braden Czapla) 7 | # 2025-02-27 simplify output (Misha Polyanskiy) 8 | 9 | from __future__ import absolute_import, division, print_function 10 | import numpy as np 11 | import matplotlib.pyplot as plt 12 | 13 | plt.close('all') 14 | ############################################################################### 15 | 16 | # Determine wavelengths to sample 17 | def w(w_max, w_min, step): 18 | linspace_lower = (np.floor_divide(w_min, step)+1)*step 19 | N = np.floor_divide(w_max-w_min, step) 20 | linspace_upper = linspace_lower + N*step 21 | w = np.linspace(linspace_lower, linspace_upper, int(N)+1) 22 | 23 | if not np.isclose(w[0], w_min, atol=step/5.): 24 | w = np.concatenate((np.array([w_min]), w)) 25 | 26 | if not np.isclose(w[-1], w_max, atol=step/5.): 27 | w = np.concatenate((w,np.array([w_max]))) 28 | 29 | return w, len(w) 30 | 31 | # Compute dielectric function using Lorentzian model. 32 | # Units of w and ResFreq must match and must be directly proportional to angular frequency. All other parameters are unitless. 33 | def Lorentzian(w, ResFreq, Strength, Damping, Eps_Inf): 34 | Permittivity = Eps_Inf*np.ones(len(w), dtype=complex) 35 | for ii in range(len(ResFreq)): 36 | Permittivity += Strength[ii]/( 1. - (w/ResFreq[ii])**2 - 1j*Damping[ii]*(w/ResFreq[ii]) ) 37 | return Permittivity 38 | 39 | ############################################################################### 40 | 41 | ## Wavelengths to sample ## 42 | w_um_min = 10000./6000. # [um] 43 | w_um_max = 10000./500. # [um] 44 | step_um = 0.005 # [um] 45 | 46 | w_um, N_freq = w(w_um_max, w_um_min, step_um) 47 | w_invcm = 10000./w_um 48 | ## ## 49 | 50 | ## Model Parameters ## 51 | ResFreq = np.array([529.5, 551., 568, 590., 636.5, 673., 698.5, 736.5, 752., 763.5, 795.5, 832., 865.5, 890., 1023., 1082.5, 1123., 1177.5, 1224., 1267., 1356., 1421., 1472., 1515., 1620., 1717., 1773., 2718., 3070., 3476., 3630.]) # [cm^-1] 52 | Strength = np.array([0.004, 0.0065, 0.002, 0.0035, 0.001, 0.0018, 0.01, 0.0106, 0.00035, 0.0008, 0.0007, 0.02, 0.0016, 0.0035, 0.001, 0.016, 0.004, 0.00065, 0.0068, 0.0025, 0.06, 0.0032, 0.0004, 0.011, 0.002, 0.026, 0.0054, 0.00018, 0.00055, 0.00017, 0.00025]) 53 | Damping = np.array([8., 10., 10., 14., 10.5, 5.5, 12.5, 6.5, 3., 8., 5., 17., 18., 8.5, 9., 35., 14., 10., 19., 17., 25., 11., 15., 10., 19., 20., 10.5, 40., 80., 40., 80.])/ResFreq 54 | EpsInf = 3.075 55 | ## ## 56 | 57 | ## Generate and Save Data ## 58 | eps = Lorentzian(w_invcm, ResFreq, Strength, Damping, EpsInf) 59 | RefInd = np.sqrt(eps) 60 | 61 | export = np.column_stack((w_um, np.real(RefInd), np.imag(RefInd))) 62 | np.savetxt('out.txt', export, fmt=' %4.3f %#.6g %#.3e') 63 | 64 | ## Plotting ## 65 | plt.figure('Figure 5a - n') 66 | plt.plot(w_invcm, np.real(RefInd), label='PMMA - $n$') 67 | plt.legend(loc=1) 68 | plt.xlim(2000,500) 69 | plt.ylim(0.8,2.4) 70 | plt.xlabel('Wavenumber (cm$^{-1}$)') 71 | plt.ylabel('$n$') 72 | 73 | 74 | plt.figure('Figure 5b - k') 75 | plt.plot(w_invcm, np.imag(RefInd), label='PMMA - $k$') 76 | 77 | plt.legend(loc=1) 78 | plt.xlim(2000,500) 79 | plt.ylim(0.0,0.9) 80 | plt.xlabel('Wavenumber (cm$^{-1}$)') 81 | plt.ylabel('$k$') 82 | ## ## --------------------------------------------------------------------------------