-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathplot.py
executable file
·95 lines (61 loc) · 1.99 KB
/
plot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import yaml
from parse import *
import sys
import cmath
import numpy as np
from getData import *
def NtoEps(matVec):
matVec=np.array(matVec)
lamb=matVec[:,0]
n=matVec[:,1]
k=matVec[:,2]
N=n[:]+1j*k[:]
eps=N[:]*N[:]
matEps=[lamb,eps.real,eps.imag]
return matEps
import matplotlib.pyplot as plt
#Plotting Ag
#hag=getData("database/main/Ag/Hagemann.yml");
range=(0.280,0.790)
lambdasAg=np.linspace(range[0],range[1],100)
ag=getData("database/main/Ag/Johnson.yml",lambdasAg);
#print ag
lambdasTiO2=np.linspace(0.280,0.790)
#tio2=getData("database/main/TiO2/Devore-o.yml",lambdasTiO2);
tio2=getData("database/main/SiO2/Malitson.yml",lambdasTiO2);
fig=plt.figure()
plt.plot(lambdasTiO2*1e3,[ x.real for x in tio2],'g-',label=r'Real($n_{SiO_{2}}$)')
plt.legend()
plt.title(r"Współczynnik załamania $SiO_2$ ($n$)");
plt.ylabel('')
plt.xlabel('wavelength [nm]')
plt.xlim([280,750])
plt.savefig("../phd/images/sio2n.png")
fig=plt.figure()
plt.plot(lambdasAg*1e3,[ x.real for x in ag ],'r-',label=r'Real($n_{Ag}$)')
plt.plot(lambdasAg*1e3,[ x.imag for x in ag] ,'b-',label=r'Imag($n_{Ag}$)')
#plt.plot(lambdasTiO2*1e3,[ x.real for x in tio2],'g-',label=r'Real($n_{TiO_{2}}$)')
plt.legend()
plt.title(r"Współczynnik załamania srebra ($n$)");
plt.ylabel('')
plt.xlabel('wavelength [nm]')
plt.xlim([280,750])
plt.ylim([0,3])
plt.savefig("../phd/images/agn.png")
fig=plt.figure()
plt.plot(lambdasAg*1e3,[ (x*x).real for x in ag ],'r-',label=r'Real($\varepsilon_{Ag}$)')
plt.plot(lambdasAg*1e3,[ (x*x).imag for x in ag] ,'b-',label=r'Imag($\varepsilon_{Ag}$)')
#plt.plot(lambdasTiO2*1e3,[ (x*x).real for x in tio2],'g-',label=r'Real($\varepsilon_{TiO_{2}}$)')
plt.legend()
plt.title(r"Współczynnik przenikalnośći elektrycznej ($\varepsilon$)");
plt.ylabel('')
plt.xlabel('wavelength [nm]')
plt.xlim([380,750])
#plt.ylim([-1.5,1.5])
plt.savefig("../phd/images/agtio2eps.png")
########
#GaAs do rozdzialu o THz
plt.show()