-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_mirror_qe.py
52 lines (42 loc) · 1.58 KB
/
plot_mirror_qe.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
import pandas as pd
from scipy.interpolate import interp1d
import numpy as np
import matplotlib.pyplot as plt
from unibe import *
def get_mirror():
df_mirror = pd.read_csv("data/mirrors_transmission.txt", delimiter="\s")
M = interp1d(df_mirror.wavelength, df_mirror.transmission, fill_value="extrapolate")
# percent
return M
def get_detector():
df_qe = pd.read_csv("data/qe.txt", delimiter=",")
Q = interp1d(df_qe.Wavelength, df_qe.QE / 100, fill_value="extrapolate")
# electrons per photons
return Q
def get_solar():
df_solar = pd.read_csv("data/solar.csv", delimiter=";", skiprows=1)
S = interp1d(df_solar["Wavelength (nm)"], df_solar["Extraterrestrial W*m-2*nm-1"], fill_value="extrapolate")
# W per meter squared per nanometer
return S
if __name__ == "__main__":
M = get_mirror()
Q = get_detector()
S = get_solar()
wavelengths = np.linspace(300, 1050, 1000)
plt.plot(wavelengths, 100 * M(wavelengths), color=BLACK)
plt.plot(wavelengths, 100 * M(wavelengths)**4, color=BLACK, ls="--")
plt.plot(wavelengths, 100 * M(wavelengths)**0.25, color=BLACK, ls=":")
plt.xlabel("wavelength [nm]")
plt.ylabel("reflection [%]")
plt.savefig("plots/mirrors.pdf")
plt.show()
plt.plot(wavelengths, 100*Q(wavelengths), color=BLACK)
plt.xlabel("wavelength [nm]")
plt.ylabel("QE [%]")
plt.savefig("plots/qe.pdf")
plt.show()
plt.plot(wavelengths, S(wavelengths), color=BLACK)
plt.xlabel("wavelength [nm]")
plt.ylabel(r"solar flux [Wm$^{-2}$nm$^{-1}$]")
plt.savefig("plots/solar.pdf")
plt.show()