Commit d02d851b authored by Lucas Laplanche's avatar Lucas Laplanche
Browse files

ajout calcul reflectivité(profondeur)

parent 60585fd2
......@@ -66,6 +66,25 @@ def reflectivity(sl,
return r
def reflectivity_depth(sl, wavelength=670e-9, step=5e-9):
num = int(sl['thickness'].sum() / step)
r = np.zeros(num)
depth = np.linspace(0., num*step, num=num)
sl = op.algaas_super_lattice_refractive_index(sl, 0., wavelength, lengyel=False, only_real=True)
for i in tqdm(range(num)):
sl_etched = pt.etch_super_lattice_from_top(sl, step*i)
n = sl_etched['refractive_index'].to_numpy(dtype=float)
d = sl_etched['thickness'].to_numpy(dtype=float)
r[i] = tmm.reflection(n, d, wavelength)
al = sl['al'].apply(np.real)
plt.plot_reflectivity_depth(al, r, depth)
def reflectivity_heatmap(bypass_dbr=True,
......
import numpy as np
# physical constants
C = 299792458.0 # speed of light [m/s]
Q = 1.602176634e-19 # electron Charge [C] 1C = 1A*1s
......
......@@ -73,6 +73,13 @@ def reflectivity_vcsel_eam_eam_vcesl():
def reflectivity_for_etch():
cl.reflectivity_depth(stm.eam_classic_structure())
cl.reflectivity_depth(stm.eam_bypass_structure())
def structure_for_matlab(vcsel_only=False, bypass_dbr=False, wavelength=850.5e-9):
l_eam_clad = 5e-9
l_vcsel_clad = 15e-9
......
......@@ -8,6 +8,8 @@ from sqw_lengyel_absorption import gaas_sqw_absorption_at_wavelength
def algaas_super_lattice_refractive_index(super_lattice, electric_field, wavelength, temperature=T, lengyel=True, only_real=False):
# calculate the refractive index of every layer of a superlattice in pandas dataframe format
# super_lattice is a dataframe
# wavelength in [m]
# temperature in [K]
# lengyel : activate the Lengyel model for the calculation of QW absorption
......
from decimal import Decimal
import numpy as np
import pandas as pd
from tqdm import tqdm
......@@ -48,6 +49,50 @@ def insert_row(row_number, df, row_value):
def etch_super_lattice_from_top(sl, etch_depth):
# etch the super_lattice of etch_depth [m]
# removes layers and/or adjust top layer thickness
# removes the air layer
if 'air' in sl.iloc[0]['name']:
sl = sl.drop(index=0)
sl = sl.reset_index(drop=True)
# check wether the depth column exist
if not 'depth' in sl:
sl.insert(sl.shape[1], 'depth', value=np.nan)
# calculate the depth of every layer
for i in range(sl.shape[0]):
sl.at[i, 'depth'] = sl.loc[0:i, 'thickness'].sum()
# get the position of the layer
# get index of corresponding layer
idx = find_nearest_index(sl['depth'].to_numpy(), etch_depth)
if etch_depth > sl.at[idx, 'depth']:
idx -= 1
corrected_thickness = sl.loc[0:idx, 'thickness'].sum() -etch_depth
# copy and remove the unneeded
sl = sl.loc[idx:sl.shape[0]]
# reset the indices so the following lines can work
sl = sl.reset_index(drop=True)
# modify first layer thickness
sl.at[0, 'thickness'] = corrected_thickness
# re-add the air layer
air_layer = pd.DataFrame([['air', 1000e-9, 0., 0., 0., 1., False, False, False, False]],
columns=['name', 'thickness', 'al', 'na', 'nd', 'refractive_index', 'ga6', 'ga11', 'al5', 'al12'])
sl = pd.concat([air_layer, sl]).reset_index(drop=True)
return sl
def cut_in_equal_layers_thickness(super_lattice, step, ignore_air=True, progress_bar=False):
if ignore_air:
......@@ -134,7 +179,6 @@ def cut_sl_at_time(sl, time):
sl_cut.at[0, 'stop_time'] = time
return sl_cut
......
......@@ -464,6 +464,65 @@ def plot_refra_clad_coupling_em(sl1, sl2, sl3):
def plot_reflectivity_depth(al, r, depth):
# create a figure
fig = go.Figure()
# add the traces
fig.add_trace(go.Scatter(
x=depth,
y=np.real(r),
name='reflectivity'
))
fig.add_trace(go.Scatter(
x=depth,
y=al,
name='al content',
yaxis='y2'
))
# create axis objects
fig.update_layout(
xaxis=dict(
title='depth [m]'
),
yaxis=dict(
title='reflectivity',
titlefont=dict(
color='#1f77b4'
),
tickfont=dict(
color='#1f77b4'
)
),
yaxis2=dict(
title='al content [1]',
titlefont=dict(
color='#ff7f0e'
),
tickfont=dict(
color='#ff7f0e'
),
anchor='x',
overlaying='y',
side='right',
)
)
# update layout properties
fig.update_layout(
title_text='reflectivity and al content as a function of depth',
width=1600,
)
# show the figure
fig.show()
def plot_reflectivity(wavelength, r):
# create a figure
......
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