Commit 596787fc authored by Lucas Laplanche's avatar Lucas Laplanche
Browse files

modification des dictionnaires

parent f65e4f53
......@@ -12,7 +12,7 @@ import quantum as qt
import scipy.io
import super_lattice_structure as st
import transfer_matrix_method as tmm
import vertex_70 as vtx
import ftir as vtx
......
......@@ -23,6 +23,7 @@ def import_vertex_70_data(file, document_folder=True, linux=True):
def clean_wavelength_data(array):
# remove the #c comment
array = np.delete(array, 0)
......@@ -32,4 +33,20 @@ def clean_wavelength_data(array):
array = array * 1e-9 # [nm] -> [m]
return array
\ No newline at end of file
return array
def import_ftir_mbe_maison(file, document_folder=True, linux=True):
if document_folder:
if linux:
file = '/home/llaplanche/Documents/mesures/ftir_salle_blanche/' +file
else:
file = 'Z:\\Documents\\mesures\\ftir_salle_blanche\\' +file
wavelength = np.loadtxt(file, usecols=0)
reflectivity = np.loadtxt(file, usecols=1)
return wavelength, reflectivity
import numpy as np
def import_horiba_ev20_data(file, document_folder=True):
if document_folder:
file = 'Z:\\Documents\\' +file +'.exp'
time = np.loadtxt(file, delimiter='\t', skiprows=2, max_rows=1, dtype=str)
time = clean_time_data(time)
wavelength = np.loadtxt(file, delimiter='\t', skiprows=3, usecols=0)
# select every columns except the first and last one that has a ghost character
cols = [i +1 for i in range(time.shape[0] -2)]
data = np.loadtxt(file, delimiter='\t', skiprows=3, usecols=cols)
return time, wavelength, data
def convert_horiba_ev20_data_to_csv(file, document_folder=True):
time, wavelength, data = import_horiba_ev20_data(file, document_folder=document_folder)
data = np.vstack((time, data))
wavelength = np.append(np.nan, wavelength)
data = np.column_stack((wavelength, data))
if document_folder:
data.tofile('Z:\\Documents\\' +file +'.csv', sep = ',')
else:
data.tofile(file, sep = ',')
def clean_time_data(array):
# remove the lambdas comment
array = np.delete(array, 0)
# remove the 'ghost' character
array = np.delete(array, array.shape[0] -1)
# remove the strings
array = np.char.strip(array, chars='Spec ')
array = np.char.strip(array, chars=' ms')
# convert as float
array = array.astype(float)
array = array/1000. # [ms] -> [s]
return array
......@@ -2,17 +2,66 @@ import numpy as np
import scipy.signal as ss
import horiba_ev20 as he
def import_horiba_ev20_data(file, document_folder=True):
if document_folder:
file = 'Z:\\Documents\\' +file +'.exp'
time = np.loadtxt(file, delimiter='\t', skiprows=2, max_rows=1, dtype=str)
time = clean_time_data(time)
wavelength = np.loadtxt(file, delimiter='\t', skiprows=3, usecols=0)
# select every columns except the first and last one that has a ghost character
cols = [i +1 for i in range(time.shape[0] -2)]
data = np.loadtxt(file, delimiter='\t', skiprows=3, usecols=cols)
return time, wavelength, data
def convert_horiba_ev20_data_to_csv(file, document_folder=True):
time, wavelength, data = import_horiba_ev20_data(file, document_folder=document_folder)
data = np.vstack((time, data))
wavelength = np.append(np.nan, wavelength)
data = np.column_stack((wavelength, data))
if document_folder:
data.tofile('Z:\\Documents\\' +file +'.csv', sep = ',')
else:
data.tofile(file, sep = ',')
def clean_time_data(array):
# remove the lambdas comment
array = np.delete(array, 0)
# remove the 'ghost' character
array = np.delete(array, array.shape[0] -1)
# remove the strings
array = np.char.strip(array, chars='Spec ')
array = np.char.strip(array, chars=' ms')
# convert as float
array = array.astype(float)
array = array/1000. # [ms] -> [s]
return array
def import_data_march_2021():
time, wavelength, data_1 = he.import_horiba_ev20_data('preclean_1')
time, wavelength, data_2 = he.import_horiba_ev20_data('preclean_2')
time, wavelength, data_3 = he.import_horiba_ev20_data('preclean_3')
time, wavelength, data_4 = he.import_horiba_ev20_data('preclean_4')
time, wavelength, data_empty = he.import_horiba_ev20_data('preclean_vide')
time, wavelength, data_1 = import_horiba_ev20_data('preclean_1')
time, wavelength, data_2 = import_horiba_ev20_data('preclean_2')
time, wavelength, data_3 = import_horiba_ev20_data('preclean_3')
time, wavelength, data_4 = import_horiba_ev20_data('preclean_4')
time, wavelength, data_empty = import_horiba_ev20_data('preclean_vide')
data_set = [data_1, data_2, data_3, data_4, data_empty]
......
......@@ -3,6 +3,7 @@ import super_lattice_structure as sls
# general dictionnary
def structure_boolean_arg_dict(config):
# boolean setup
# overwrite default config
......@@ -84,22 +85,22 @@ def structure_boolean_arg_dict(config):
def eam_classic():
# structures
def eam_classic_structure():
arg_dict = structure_boolean_arg_dict('eam_only')
return sls.structure_eam_vcsel(**arg_dict)
def eam_bypass():
def eam_bypass_structure():
arg_dict = structure_boolean_arg_dict('eam_only')
arg_dict['bypass_dbr'] = True
return sls.structure_eam_vcsel(**arg_dict)
def eam_alox():
def eam_alox_structure():
arg_dict = structure_boolean_arg_dict('eam_only')
arg_dict['eam_alox'] = True
arg_dict['bypass_dbr'] = True
......@@ -110,14 +111,14 @@ def eam_alox():
def eam_vcsel_classic():
def eam_vcsel_classic_structure():
arg_dict = structure_boolean_arg_dict('eam_vcsel')
return sls.structure_eam_vcsel(**arg_dict)
def eam_vcsel_bypass():
def eam_vcsel_bypass_structure():
arg_dict = structure_boolean_arg_dict('eam_vcsel')
arg_dict['bypass_dbr'] = True
......@@ -125,7 +126,7 @@ def eam_vcsel_bypass():
return sls.structure_eam_vcsel(**arg_dict)
def eam_vcsel_alox():
def eam_vcsel_alox_structure():
arg_dict = structure_boolean_arg_dict('eam_vcsel')
arg_dict['eam_alox'] = True
arg_dict['bypass_dbr'] = True
......@@ -136,8 +137,69 @@ def eam_vcsel_alox():
def vcsel():
def vcsel_structure():
arg_dict = structure_boolean_arg_dict('vcsel_only')
return sls.structure_eam_vcsel(**arg_dict)
# arguments
def eam_classic_arguments():
arg_dict = structure_boolean_arg_dict('eam_only')
return arg_dict
def eam_bypass_arguments():
arg_dict = structure_boolean_arg_dict('eam_only')
arg_dict['bypass_dbr'] = True
return arg_dict
def eam_alox_arguments():
arg_dict = structure_boolean_arg_dict('eam_only')
arg_dict['eam_alox'] = True
arg_dict['bypass_dbr'] = True
return arg_dict
def eam_vcsel_classic_arguments():
arg_dict = structure_boolean_arg_dict('eam_vcsel')
return arg_dict
def eam_vcsel_bypass_arguments():
arg_dict = structure_boolean_arg_dict('eam_vcsel')
arg_dict['bypass_dbr'] = True
return arg_dict
def eam_vcsel_alox_arguments():
arg_dict = structure_boolean_arg_dict('eam_vcsel')
arg_dict['eam_alox'] = True
arg_dict['bypass_dbr'] = True
return arg_dict
def vcsel_arguments():
arg_dict = structure_boolean_arg_dict('vcsel_only')
return sls.structure_eam_vcsel(**arg_dict)
\ No newline at end of file
return arg_dict
\ No newline at end of file
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