Commit 3103402e authored by Lucas Laplanche's avatar Lucas Laplanche
Browse files

importation des données du ftir ajoutées

parent 83ec2e92
import numpy as np
from scipy.interpolate import splrep, splev
from globals import T
import oes as oe
import optic as op
import pandas_tools as pt
......@@ -8,7 +10,7 @@ import plot as plt
import quantum as qt
import scipy.io
import super_lattice_structure as st
from globals import T
import vertex_70 as vtx
......@@ -60,6 +62,24 @@ def zandberg_electromagnetic_amplitude(electric_field=0., wavelength=1e-6):
def ftir_reflectivity(filename='eam_2'):
# import data
wavelength, r = vtx.import_vertex_70_data(filename)
# smooth the curve (I know it is cheating but ftir currently is out of service, so data is disgusting)
bspl = splrep(wavelength, r, s=4.5)
r = splev(wavelength, bspl)
# correct data
r_max = np.max(r)
r = r * 0.99 / r_max
# plot
plt.plot_reflectivity(wavelength, r)
def mqw_psi(lz=0.01e-9, electric_field=0., wavelength=850e-9):
sl = st.structure_eam(air=False, top_dbr=False, bot_dbr=False, shared_dbr=False, contact=False, substrate=False, amount_qw=5)
sl = pt.cut_in_equal_layers_thickness(sl, 1e-11)
......
......@@ -16,7 +16,7 @@ def reflectivity_from_growth_speed_2x2(bypass_dbr=True, delta_speed=0.1, start_w
r = np.zeros(len(wavelength))
# epitaxy structure parameters
speed_array = np.array([1. -delta_speed, 1., 1. +delta_speed])
speed_array = np.array([1. -delta_speed, 1. +delta_speed])
v_ga6 = 100 * speed_array
v_ga11 = 850 * speed_array
v_al5 = 900 * speed_array
......@@ -85,6 +85,80 @@ def reflectivity_from_growth_speed_2x2(bypass_dbr=True, delta_speed=0.1, start_w
def reflectivity_from_growth_speed_1x2(bypass_dbr=True, delta_speed=0.1, start_wavelength=700e-9, stop_wavelength=1000e-9, electric_field=0., n_points=200):
# reflectivity computation parameters
wavelength = np.linspace(start_wavelength, stop_wavelength, num=n_points)
r = np.zeros(len(wavelength))
# epitaxy structure parameters
speed_array = np.array([1.02, 1.05])
v_ga11 = 850 * speed_array
v_al5 = 900 * speed_array
cell_list = [v_ga11, v_al5]
cell_names = ['v_ga11', 'v_al5']
# figure parameters
# create a figure
fig = make_subplots(rows=1, cols=2,
subplot_titles=(cell_names[0], cell_names[1]))
for i in tqdm(range(len(cell_list))):
for j in range(len(cell_list[i])):
argument = {cell_names[i]: cell_list[i][j]}
sl = sls.structure_eam(bypass_dbr=bypass_dbr,
**argument,
v_ga6=90)
for k in range(len(wavelength)):
sl = op.algaas_super_lattice_refractive_index(sl, electric_field, wavelength[k])
n = sl['refractive_index'].to_numpy(dtype=np.complex128)
d = sl['thickness'].to_numpy(dtype=np.complex128)
r[k] = op.reflection(n, d, wavelength[k])
# add the traces
fig.add_trace(
go.Scatter(
x=wavelength,
y=r,
name=cell_names[i] +' = ' +str(cell_list[i][j]) +' um/h'),
row=row_num(i),
col=col_num(i),
)
# create axis objects
fig.update_layout(
xaxis=dict(
title='wavelength [m]'
),
yaxis=dict(
title='reflectivity [1]',
titlefont=dict(
color='#1f77b4'
),
tickfont=dict(
color='#1f77b4'
)
)
)
# update layout properties
fig.update_layout(
title_text='reflectivity as a function of wavelength',
width=1600,
)
# show the figure
fig.show()
def row_num(x):
if x>=2:
return 2
......
import numpy as np
def import_vertex_70_data(file, document_folder=True, linux=True):
if document_folder:
if linux:
file = '/home/llaplanche/Documents/mesures/ftir/' +file
else:
file = 'Z:\\Documents\\mesures\\ftir\\' +file
wavelength = np.loadtxt(file, skiprows=2, max_rows=1, dtype=str, comments=None)
wavelength = clean_wavelength_data(wavelength)
reflectivity = np.loadtxt(file, skiprows=3, usecols=0)
# flip the array because for some reason opus goes decrescendo
wavelength = np.flip(wavelength)
reflectivity = np.flip(reflectivity)
return wavelength, reflectivity
def clean_wavelength_data(array):
# remove the #c comment
array = np.delete(array, 0)
# convert as float
array = array.astype(float)
array = array * 1e-9 # [nm] -> [m]
return array
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment