Commit 6790d024 authored by Lucas Laplanche's avatar Lucas Laplanche
Browse files

comparaison ftir théorie ajoutée

parent 2b9a0fbf
......@@ -78,6 +78,38 @@ 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.):
# 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
# get index of 750nm and 950nm
idx_750 = np.abs(wavelength -750e-9).argmin()
idx_950 = np.abs(wavelength -950e-9).argmin()
# slice the arrays
r = r[idx_750:idx_950]
wavelength = wavelength[idx_750:idx_950]
# calculate the theorical reflectivity according
wavelength_theory = np.linspace(750e-9, 950e-9, num=500)
if 'eam_2' in filename:
r_theory = op.reflectivity(True, electric_field, wavelength_theory)
else:
r_theory = op.reflectivity(False, electric_field, wavelength_theory)
# plot
plt.plot_mult_reflectivity(wavelength, r, wavelength_theory, r_theory)
def mqw_psi(lz=0.01e-9, electric_field=0., wavelength=850e-9):
......
......@@ -318,6 +318,52 @@ def plot_reflectivity(wavelength, r):
fig.show()
def plot_mult_reflectivity(wavelength, r1, wavelength2, r2):
# create a figure
fig = go.Figure()
# add the traces
fig.add_trace(go.Scatter(
x=wavelength,
y=r1,
name='measurement'
))
fig.add_trace(go.Scatter(
x=wavelength2,
y=r2,
name='theory'
))
# 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 plot_reflectivity_heatmap(wavelength, time, r):
fig = go.Figure(data=
go.Heatmap(x=time, y=wavelength, z=r, ))
......
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