Commit 530fafb0 authored by Lucas Laplanche's avatar Lucas Laplanche
Browse files

ajout carte de chaleur de la refléctivité pendant l'épitaxie

parent f2e1715a
......@@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Python 3.9 (eam-vcsel)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
......@@ -2,7 +2,6 @@ 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
......@@ -72,12 +71,12 @@ def ftir_reflectivity(filename='eam_2', document_folder=True, linux=True):
plt.plot_reflectivity(wavelength, r)
def ftir_theory_comparison_reflectivity(filename='eam_2', electric_field=0.):
def ftir_theory_comparison_reflectivity(filename='eam_2', electric_field=0., document_folder=True, linux=True):
# import data
wavelength, r = vtx.import_vertex_70_data(filename)
wavelength, r = vtx.import_vertex_70_data(filename, document_folder=document_folder, linux=linux)
# 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)
bspl = splrep(wavelength, r, s=5)
r = splev(wavelength, bspl)
# correct data
......
......@@ -4,8 +4,8 @@ from plotly.subplots import make_subplots
from tqdm import tqdm
from globals import T
import optic as op
import pandas_tools as pdt
import plot as plt
import super_lattice_structure as sls
......@@ -236,10 +236,61 @@ def reflectivity_from_growth_speed_1x1(bypass_dbr=True, delta_speed=0.1, start_w
def reflectivity_meshgrid(temperature=T, bypass_dbr=True, start_wavelength=820e-9, stop_wavelength=880e-9, electric_field=0., n_points=100):
wavelength = np.linspace(start_wavelength, stop_wavelength, num=n_points)
time, r = op.reflectivity_meshgrid(bypass_dbr, electric_field, wavelength, temperature)
plt.plot_reflectivity_heatmap(wavelength, time, r)
def reflectivity_heatmap(bypass_dbr=True,
start_wavelength=820e-9,
stop_wavelength=880e-9,
electric_field=0.,
n_wavelength=200,
n_time=600,
v_ga6=100,
v_ga11=850,
v_al5=900,
v_al12=150):
# create the wavelength array
wavelength = np.linspace(start_wavelength, stop_wavelength, num=n_wavelength)
# create the super lattice
sl = sls.structure_eam(bypass_dbr=bypass_dbr,
v_ga6=v_ga6,
v_ga11=v_ga11,
v_al5=v_al5,
v_al12=v_al12)
# add the depth column
sl = pdt.add_depth_column(sl)
# add time column
sl = pdt.add_epitaxial_time_columns(sl,
v_ga6=v_ga6,
v_ga11=v_ga11,
v_al5=v_al5,
v_al12=v_al12)
# get the total time of epitaxy minus substrate
total_epitaxy_time = sl.at[sl.shape[0] -1, 'stop_time']
# create the time array
time = np.linspace(1.0, total_epitaxy_time, num=n_time)
# create the reflectivity array
r = np.zeros([len(wavelength), len(time)])
# calculate the reflectivity
for i in tqdm(range(n_time)):
sl_i = pdt.cut_sl_at_time(sl, time[i])
# wavelength in [m]
# wavelength must be a numpy array
for j in range(len(wavelength)):
sl_i = op.algaas_super_lattice_refractive_index(sl_i, electric_field, wavelength[j], lengyel=False)
n = sl_i['refractive_index'].to_numpy(dtype=np.complex128)
d = sl_i['thickness'].to_numpy(dtype=np.complex128)
r[j, i] = op.reflection(n, d, wavelength[j])
plt.plot_reflectivity_heatmap(time, wavelength, r)
......
......@@ -11,7 +11,7 @@ from sqw_lengyel_absorption import gaas_sqw_absorption_at_wavelength
def algaas_super_lattice_refractive_index(super_lattice, electric_field, wavelength, temperature=T):
def algaas_super_lattice_refractive_index(super_lattice, electric_field, wavelength, temperature=T, lengyel=True):
for i in range(len(super_lattice)):
name = super_lattice.at[i, 'name']
al = super_lattice.at[i, 'al']
......@@ -40,7 +40,10 @@ def algaas_super_lattice_refractive_index(super_lattice, electric_field, wavelen
# qw thickness
thickness = super_lattice.at[i, 'thickness']
k = gaas_sqw_absorption_at_wavelength(al, thickness, electric_field, wavelength)
if lengyel:
k = gaas_sqw_absorption_at_wavelength(al, thickness, electric_field, wavelength)
else:
k = 0.
k = -100*k*wavelength/(4*np.pi)
n += 1j*k
......
......@@ -99,6 +99,29 @@ def cut_in_equal_layers_thickness(super_lattice, step):
return super_lattice
def cut_sl_at_time(sl, time):
# get index of corresponding layer
idx = find_nearest_index(sl['stop_time'].to_numpy(), time)
if time > sl.at[idx, 'stop_time']:
idx += 1
# calculate its modified thickness
ratio = (time - sl.at[idx, 'start_time']) / (sl.at[idx, 'stop_time'] - sl.at[idx, 'start_time'])
corrected_thickness = ratio * sl.at[idx, 'thickness']
# copy and remove the unneeded
sl_cut = sl.copy().loc[0:idx]
# modify last layer thickness
sl_cut.at[:, 'thickness'] = corrected_thickness
# modify last layer stop time
sl_cut.at[:, 'stop_time'] = time
return sl_cut
def add_depth_column(super_lattice):
......@@ -138,14 +161,18 @@ def add_epitaxial_time_columns(super_lattice,
v += v_ga6
if super_lattice.at[0, 'ga11']:
v += v_ga11
if super_lattice.at[0, '1l5']:
if super_lattice.at[0, 'al5']:
v += v_al5
if super_lattice.at[0, 'al12']:
v += v_al12
# [nm/h] -> [m/s]
v = slt.nmph_to_mps(v)
t = lz / v
# bof bof :/
if v==0.:
t = 0.
else:
t = lz / v
super_lattice.at[0, 'start_time'] = 0.
super_lattice.at[0, 'stop_time'] = t
......@@ -159,19 +186,26 @@ def add_epitaxial_time_columns(super_lattice,
v += v_ga6
if super_lattice.at[i, 'ga11']:
v += v_ga11
if super_lattice.at[i, '1l5']:
if super_lattice.at[i, 'al5']:
v += v_al5
if super_lattice.at[i, 'al12']:
v += v_al12
# [nm/h] -> [m/s]
v = slt.nmph_to_mps(v)
t = lz / v
# de même :/
if v == 0.:
t = 0.
else:
t = lz / v
super_lattice.at[i, 'start_time'] = super_lattice.loc[i -1, 'stop_time']
super_lattice.at[i, 'stop_time'] = super_lattice.loc[i, 'start_time'] + t
return super_lattice
def fexp(number):
......@@ -180,4 +214,12 @@ def fexp(number):
def fman(number):
return Decimal(number).scaleb(-fexp(number)).normalize()
\ No newline at end of file
return Decimal(number).scaleb(-fexp(number)).normalize()
def find_nearest_index(array, value):
array = np.asarray(array)
idx = (np.abs(array - value)).argmin()
return idx
\ No newline at end of file
......@@ -364,9 +364,9 @@ def plot_mult_reflectivity(wavelength, r1, wavelength2, r2):
fig.show()
def plot_reflectivity_heatmap(wavelength, time, r):
def plot_reflectivity_heatmap(time, wavelength, r):
fig = go.Figure(data=
go.Heatmap(x=time, y=wavelength, z=r, ))
go.Heatmap(x=time, y=wavelength, z=r, colorscale='jet'))
# show the figure
......
Supports Markdown
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