Commit 3b75fce7 authored by Lucas Laplanche's avatar Lucas Laplanche
Browse files

ajout graphes couplage

parent 76db0a0e
......@@ -73,17 +73,17 @@ def electromagnetic_amplitude(bypass_dbr=True, electric_field=0., wavelength=850
def clad_coupling_electromagnetic_amplitude(bypass_dbr=False, electric_field=0., wavelength=850e-9):
sl1 = st.structure_eam_vcsel(bypass_dbr=bypass_dbr, l_eam_clad=1e-9)
sl2 = st.structure_eam_vcsel(bypass_dbr=bypass_dbr, l_eam_clad=3e-9)
sl3 = st.structure_eam_vcsel(bypass_dbr=bypass_dbr, l_eam_clad=10e-9)
sl1 = st.structure_eam_vcsel(bypass_dbr=bypass_dbr, l_eam_clad=10e-9, amount_eam_qw=25)
sl2 = st.structure_eam_vcsel(bypass_dbr=bypass_dbr, l_eam_clad=15e-9, amount_eam_qw=25)
sl3 = st.structure_eam_vcsel(bypass_dbr=bypass_dbr, l_eam_clad=20e-9, amount_eam_qw=25)
sl1 = op.algaas_super_lattice_refractive_index(sl1, electric_field, wavelength)
sl2 = op.algaas_super_lattice_refractive_index(sl2, electric_field, wavelength)
sl3 = op.algaas_super_lattice_refractive_index(sl3, electric_field, wavelength)
sl1 = pt.cut_in_equal_layers_thickness(sl1, 1e-9)
sl2 = pt.cut_in_equal_layers_thickness(sl2, 1e-9)
sl3 = pt.cut_in_equal_layers_thickness(sl3, 1e-9)
sl1 = pt.cut_in_equal_layers_thickness(sl1, 1e-8)
sl2 = pt.cut_in_equal_layers_thickness(sl2, 1e-8)
sl3 = pt.cut_in_equal_layers_thickness(sl3, 1e-8)
em1 = op.em_amplitude_smm(sl1, wavelength)
em2 = op.em_amplitude_smm(sl2, wavelength)
......@@ -96,6 +96,18 @@ def clad_coupling_electromagnetic_amplitude(bypass_dbr=False, electric_field=0.,
plt.plot_refra_clad_coupling_em(sl1, sl2, sl3)
def animation_clad_coupling(bypass_dbr=False, electric_field=0., wavelength=850e-9):
cladding = np.linspace(0.1e-9, 20e-9, 20)
for cl in cladding:
sl = st.structure_eam_vcsel(bypass_dbr=bypass_dbr, l_eam_clad=cl, amount_eam_qw=25)
sl = op.algaas_super_lattice_refractive_index(sl, electric_field, wavelength)
sl = pt.cut_in_equal_layers_thickness(sl, 1e-8)
em = op.em_amplitude_smm(sl, wavelength)
sl.insert(sl.shape[1], 'electromagnetic_amplitude', value=em)
plt.plot_refra_em(sl)
def zandberg_electromagnetic_amplitude(electric_field=0., wavelength=1e-6):
sl = st.structure_zandbergen()
sl = op.algaas_super_lattice_refractive_index(sl, electric_field, wavelength)
......
......@@ -296,38 +296,55 @@ def plot_refra_clad_coupling_em(sl1, sl2, sl3):
sl3.at[i, 'depth'] = sl3.loc[0:i, 'thickness'].sum()
# create a figure
fig = make_subplots(rows=2, cols=2,)
# define xaxes, yaxes
fig = make_subplots(
rows=3,
cols=1,
specs=[[{'secondary_y': True}],
[{'secondary_y': False}],
[{'secondary_y': False}]]
)
# add the traces
fig.add_trace(go.Scatter(
x=sl1['depth'],
y=sl1['refractive_index'].apply(np.real),
name='refractive index'
),row=1, col=1)
fig.add_trace(go.Scatter(
# add traces
fig.add_scatter(
x=sl1['depth'],
y=sl1['electromagnetic_amplitude'],
name='em amplitude1',
),row=2, col=1)
row=1,
col=1
)
fig.add_trace(go.Scatter(
fig.add_scatter(
x=sl1['depth'],
y=sl1['refractive_index'].apply(np.real),
name='refractive index',
row=1,
col=1,
secondary_y=True
)
fig.add_scatter(
x=sl2['depth'],
y=sl2['electromagnetic_amplitude'],
name='em amplitude2',
),row=1, col=2)
row=2,
col=1
)
fig.add_trace(go.Scatter(
fig.add_scatter(
x=sl3['depth'],
y=sl3['electromagnetic_amplitude'],
name='em amplitude3',
),row=2, col=2)
row=3,
col=1
)
# update layout properties
fig.update_layout(
title_text='refractive index and electromagnetic amplitude along z axis',
width=1600,
height=900,
)
......@@ -576,4 +593,24 @@ def plot_eos_spectrum_gold_plate(wavelength, data_mean_sample, data_empty, data_
)
fig.update_layout(width=1600, title_text="Optical emission spectroscopy")
fig.show()
\ No newline at end of file
fig.show()
# function that returns default yaxis domain for each subplot and the additional yaxes positions
def xyaxes_dom_yaxes_pos(gap=0.1, rows=2):
if rows < 2:
raise ValueError('This function works for subplots with rows>2 and cols=1')
h_window = (1 - gap) / rows # window height
d = 3 / 10 / 2
# xaxis{k} has the domain [w[2],w[-3]] k=1,...rows
# w[1], w[-2] give the left, resp right yaxes position associated to the default yaxis of the plot window
yd = []
for k in range(rows):
start = k * (h_window + gap)
end = start + h_window
yd.append([start, end])
w = [0, d, 2 * d, 1 - 2 * d, 1 - d, 1]
return w, yd[::-1] # yd[::-1] contains the domains of the default yaxes
\ No newline at end of file
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