Commit 1385155d authored by MAURICE's avatar MAURICE
Browse files

rajout de fonctions pour lire un "casino" pour echosonde_bis

parent 27def904
......@@ -37,6 +37,20 @@ def import_casino(path_evt):
return C, Entete, index_events, date_heure
def import_casino_echosonde_bis(path_evt):
C = np.loadtxt(path_evt,dtype='U',delimiter = '\t' ,encoding='latin1')
# C0 = pd.read_table(path_evt)
# C = C0.to_numpy(dtype="str")
Entete = C[0, :]
C = C[1 : (len(C)), :]
index_events = np.squeeze(np.where(C[:, 2] != "ACQAUTO"))
date_heure = np.array(
(pd.to_datetime((np.char.add(C[:, 0], C[:, 1])), format="%d/%m/%Y%H:%M:%S")),
dtype=np.datetime64,
)
return C, Entete, index_events, date_heure
def import_jackpot(path_evt):
C = np.loadtxt(path_evt,dtype='U',delimiter = ';' ,encoding='latin1')
# C0 = pd.read_table(path_evt)
......@@ -290,3 +304,28 @@ def infos_radiales_echosonde(C): #fct infos radiales pour les campagnes echosond
# dir_vent_vrai[i] = float(dir_vent_vrai[i].replace(',','.'))
return dates_debut,dates_fin,heure_debut,heure_fin,name_rad,vit_vent_vrai,dir_vent_vrai
def infos_radiales_echosonde_bis(C): #fct infos radiales pour les campagnes echosonde bis
index_heure = np.squeeze(np.where(((C[:,3] == 'STOPRAD')| (C[:,3] == 'FINRAD')|(C[:,3] == 'REPRAD')| (C[:,3] == 'DEBRAD'))))
C_hd = C[index_heure,:]
index_heure_fin = np.squeeze(np.where(((C_hd[:,3] == 'STOPRAD')| (C_hd[:,3] == 'FINRAD'))))
index_heure_debut = np.squeeze(np.where(((C_hd[:,3] == 'REPRAD')| (C_hd[:,3] == 'DEBRAD'))))
index_heure_fin = deux_de_suite_inferieur(index_heure_fin)
index_heure_debut = deux_de_suite_superieur(index_heure_debut)
dates_debut = (C_hd[index_heure_debut,0]).tolist()
dates_fin = (C_hd[index_heure_fin,0]).tolist()
heure_debut = (C_hd[index_heure_debut,1]).tolist()
heure_fin = (C_hd[index_heure_fin,1]).tolist()
if (len(dates_debut)>len(dates_fin)):
dates_fin.append(C[(len(C)-1),0])
heure_fin.append(C[(len(C)-1),1])
index_heure_fin.append((len(C)-1))
name_rad = (C_hd[index_heure_debut,4]).tolist()
return dates_debut,dates_fin,heure_debut,heure_fin,name_rad
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