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

correction 550°C

parent 29b1a46a
......@@ -283,19 +283,13 @@ def surface_fit_550_test():
wavelength = data['wavelength_array']
n = data['n_array']
# al and wavelength must be of same size
wavelength_length = wavelength.shape[0]
al_length = al.shape[0]
indices_list = np.linspace(0, wavelength_length -1, num=al_length).astype(int)
wavelength = wavelength[indices_list]
n_calc = np.zeros([wavelength.shape[0], al.shape[0]])
for i in range(wavelength.shape[0]):
for j in range(al.shape[0]):
n_calc[i, j] = np.real(op.almuneau_complex_550C_algaas_refractive_index(al[j], wavelength[i]))
# then of course, n and k must be square matrices
n = n[indices_list, :]
n_calc = op.almuneau_complex_550C_algaas_refractive_index(al, wavelength)
plt.plot_2_std_heatmaps(al, wavelength, n, al, wavelength, np.real(n_calc))
plt.plot_2_std_heatmaps(al, wavelength, n, al, wavelength, n_calc)
......
......@@ -29,9 +29,9 @@ NALOX = 1.6 # oxided Al refractive index
# refractive indices at 550°C
# loads al_array, wavelength_array, n_array (real part) and k_array (imaginary part)
REFRA_DATA_550 = np.load('data/550C_AlGaAs_refractive_indices/indices_arrays.npz')
REFRA_DATA_550 = np.load('data/550C_AlGaAs_refractive_indices/indices_arrays.npz', allow_pickle=True)
# loads n and k coefficients to use with polyval in polynomial_fit
REFRA_MODEL_550 = np.load('data/550C_AlGaAs_refractive_indices/model.npz')
REFRA_MODEL_550 = np.load('data/550C_AlGaAs_refractive_indices/model.npz', allow_pickle=True)
# distributed Bragg Reflectors constants @ 850nm
......
......@@ -4,8 +4,7 @@ OBJECTIFS
Faire le fit du FTIR.
Vérifier les recettes avec Alexandre
Faire l'épitaxie.
ACCOMPLI
......@@ -14,6 +13,9 @@ ACCOMPLI
Réinstaller crystal XE et faire les recettes EAM-VCSELs.
Corriger le scattering tmm !!!!!!!!!
Vérifier les recettes avec Alexandre
Faire l'épitaxie.
ECHOUÉ
FTIR.
......
......@@ -19,16 +19,9 @@ def generate_550C_polynomial_regression():
k = data['k_array']
# al and wavelength must be of same size
wavelength_length = wavelength.shape[0]
al_length = al.shape[0]
indices_list = np.linspace(0, wavelength_length -1, num=al_length).astype(int)
wavelength = wavelength[indices_list]
# then of course, n and k must be square matrices
n = n[indices_list, :]
k = k[indices_list, :]
# reshape the arrays
al, wavelength, n = reshape_xyz_matrices_into_vectors(al, wavelength, n)
k = np.reshape(k, k.shape[0] * k.shape[1])
# Fit a 3rd order, 2d polynomial
......@@ -37,18 +30,59 @@ def generate_550C_polynomial_regression():
# save the coeffs
np.savez('data/550C_AlGaAs_refractive_indices/model.npz', n=n, k=k)
np.savez('data/550C_AlGaAs_refractive_indices/model.npz', n=n, k=k, allow_pickle=True)
def polyfit2d(x, y, z, deg=np.array([2, 2])):
def polyfit2d(x, y, z, deg=np.array([4, 4])):
# create the vandermonde matrix which the least square will be applied on
vander = np.polynomial.polynomial.polyvander2d(x, y, deg)
#vander = vander.reshape((-1,vander.shape[-1]))
#z = z.reshape((vander.shape[0],))
c = np.linalg.lstsq(vander, z)[0]
# least square regression
# c contains the coefficient
# must be used by calling the function polyval
c = np.linalg.lstsq(vander, z)
#return c.reshape(deg +1)
return c
def reshape_xyz_matrices_into_vectors(x, y, z):
# x, y, z must be numpy arrays
# x, y must be vectors of lenght n and m
# z must be a nxm matrix
# get the length of x and y
x_length = x.shape[0]
y_length = y.shape[0]
total_length = x_length * y_length
# reshape z matrix into a vector
z = np.reshape(z, total_length)
# reshape x as a vector [x1 x2 x3 ... xn x1 x2 x3 ... xn]
x_new = np.zeros([total_length])
for i in range(y_length):
for j in range(x_length):
x_new[i * x_length +j] = x[j]
x = x_new
# reshape y as a vector [y1 y1 y1 ... y2 y2 y2 ... yn yn yn]
y_new = np.zeros([total_length])
for i in range(y_length):
for j in range(x_length):
y_new[i * x_length + j] = y[i]
y = y_new
return x, y, z
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