Commit 28995fa2 authored by MAURICE's avatar MAURICE
Browse files

Rajout d'une variable premiere_date pour synchroniser les nom_numero_radiale et tableau_radiale

parent 8d0276c9
......@@ -47,7 +47,7 @@ import pickle
def scaling (freqs_XXxx_db,Sv_surfXXxx_db,Sa_surfXXxx_db,depth_surface_XXxx_db,depth_bottom_XXxx_db,
lat_surfXXxx_db,lon_surfXXxx_db,time_XXxx_db,
indices_transduc_choisis,date_time_debut,date_time_fin,name_radiales,save = False, filename=None):
indices_transduc_choisis,date_time_debut,date_time_fin,premiere_date,name_radiales,save = False, filename=None):
......@@ -141,23 +141,27 @@ def scaling (freqs_XXxx_db,Sv_surfXXxx_db,Sa_surfXXxx_db,depth_surface_XXxx_db,d
indices_debut_rad=[]
indices_fin_rad=[]
Time = hac_util.hac_read_day_time(time_XXxx_db)
indice = []
for i in range (len(datetime_debutrad)):
indice = []
# indice = []
for j in range (len(Time)):
if ((Time[j]<=datetime_finrad[i])and(Time[j]>=datetime_debutrad[i])) :
indice.append(j)
break
if len(indice)>0:
indices_debut_rad.append( min( indice))
indices_fin_rad.append(max( indice))
liste_nomrad.append(nameliste[i])
liste_numrad.append(i+1)
# indices_debut_rad.append( min( indice))
# indices_fin_rad.append(max( indice))
# liste_nomrad.append(nameliste[i])
# liste_numrad.append(i+1)
liste_nomrad.append(nameliste[i+premiere_date])
liste_numrad.append(i+premiere_date)
indices_radiales = np.zeros((2,len(indices_fin_rad)),dtype=int)
indices_radiales[0,:]=np.array(indices_debut_rad,dtype=int)
indices_radiales[1,:]=np.array(indices_fin_rad,dtype=int)
# indices_radiales = np.zeros((2,len(indices_fin_rad)),dtype=int)
# indices_radiales[0,:]=np.array(indices_debut_rad,dtype=int)
# indices_radiales[1,:]=np.array(indices_fin_rad,dtype=int)
Sv_moy_transducteur_x = np.array(Sv_moy_transducteur_x)
......@@ -168,8 +172,14 @@ def scaling (freqs_XXxx_db,Sv_surfXXxx_db,Sa_surfXXxx_db,depth_surface_XXxx_db,d
tableau_radiales = np.zeros((len(Sv)))
for x in range (len(liste_nomrad )):
tableau_radiales[indices_debut_rad[x]:indices_fin_rad[x]]=x
for x in range (1,len(liste_nomrad)):
tableau_radiales[indice[x-1]:indice[x]]=liste_numrad[x-1]
tableau_radiales[indice[-1]:]=liste_numrad[len(liste_nomrad)-1]
# for x in range (len(liste_nomrad )):
# tableau_radiales[indices_debut_rad[x]:indices_fin_rad[x]]=x
nom_numero_radiales = (liste_nomrad,liste_numrad)
if save :
......
......@@ -9,7 +9,7 @@ import os
import glob
import numpy as np
def ei_survey_transects(path_hac_survey,path_config,path_save,date_start,date_end,time_start,time_end,name_transects=None,ME70=False,EK80=True,EK80h=False) :
def ei_survey_transects(path_hac_survey,path_config,path_save,date_start,date_end,time_start,time_end,premiere_date,name_transects=None,ME70=False,EK80=True,EK80h=False) :
"""
Process EI over specified transects periods (potentially partitionned in different parts) and specified echosounders (ME70, EK80 and horizontal EK80)
......@@ -56,7 +56,8 @@ def ei_survey_transects(path_hac_survey,path_config,path_save,date_start,date_en
name_transect=name_transect.replace('/','')
name_transect=name_transect.replace(':','')
else:
name_transect=name_transects[x]
# name_transect=name_transects[x]
name_transect=name_transects[x+premiere_date]
sample_echo_integration(path_hac_survey,path_config,path_save+"/"+name_transect+"/",nameTransect=name_transect,dateStart=date_start[x],timeStart=time_start[x],dateEnd=date_end[x],timeEnd=time_end[x])
......
......@@ -95,9 +95,12 @@ import pymovies_3d.visualization.map_drawing as md
####################################################################################################
# path_evt = '/echosonde/data/PELGAS2019/Casino/casino_pelgas2019.csv'
path_evt = 'D:\PHOENIX18\Casino\PHOENIX2018_casino_evts.csv'
C,Entete,index_events,date_heure = ic.import_casino (path_evt)
path_evt = 'D:\PHOENIX18\Casino\PHOENIX2018_casino_Copie.txt'
#path_evt= 'F:\EchoSonde\EchoSonde2019-2\CasinoManuelEchoSonde2019-2.txt'
# C,Entete,index_events,date_heure = ic.import_casino_bio(path_evt)
C,Entete,index_events,date_heure = ic.import_casino(path_evt)
datedebut,datefin,heuredebut,heurefin,nameTransect, vit_vent_vrai,dir_vent_vrai = ic.infos_radiales(C)
# datedebut,datefin,heuredebut,heurefin,nameTransect, vit_vent_vrai,dir_vent_vrai = ic.infos_radiales_echosonde(C)
#supression des variables qui ne sont plus utiles
del C,Entete,index_events,date_heure
......@@ -113,12 +116,16 @@ for i in range (len(indsuppr) ):
del datedebut[indsuppr[i]-nbsuppr],datefin[indsuppr[i]-nbsuppr],heuredebut[indsuppr[i]-nbsuppr],heurefin[indsuppr[i]-nbsuppr],nameTransect[indsuppr[i]-nbsuppr]
premiere_date=0
derniere_date=1
# # essais
# datedebut = datedebut[0:10]
# heuredebut = heuredebut[0:10]
# datefin=datefin[0:10]
# heurefin=heurefin[0:10]
datedebut = datedebut[premiere_date:derniere_date]
heuredebut = heuredebut[premiere_date:derniere_date]
datefin=datefin[premiere_date:derniere_date]
heurefin=heurefin[premiere_date:derniere_date]
#print(premiere_date)
date_time_debut= []
date_time_fin= []
......@@ -128,9 +135,12 @@ for i in range (len(datedebut)):
#path windows
path_hac_survey = 'D:\PHOENIX18\PHOENIX18_FM\HERMES'
path_config = 'D:\PHOENIX18\PHOENIX18_FM\Configs_M3D\configsAnalyseM3D\EIlay'
path_hac_survey = 'F:\HERMES'
path_config = 'F:/Configs_M3D/configsAnalyseM3D/EIlay'
survey_name='PHOENIX18'
# path_hac_survey = 'D:\SBES_MBES\ECHOSONDE2019-2\RUN370'
# path_config = 'F:/Configs_M3D/configsAnalyseM3D/EIlay'
# survey_name='Echosonde2019_2'
# datedebut='05/06/2018'
# datefin='05/06/2018'
......@@ -141,8 +151,9 @@ survey_name='PHOENIX18'
# # datedebut='05/06/2018'
# # datefin='05/06/2018'
path_save = path_hac_survey + '/Result/' + survey_name +'/'
path_save = 'D:\PHOENIX18_2emeEI\PHOENIX18_ACOU3_calib' + '/Result/' + survey_name +'/'
# path_save = 'D:\Echosonde2019_2_Rad4' + '/Result/' + survey_name +'/'
# path_save = path_hac_survey + '/Result/' + survey_name +'/'
# heuredebut ='13:44:00'
# heurefin ='14:14:00'
......@@ -211,7 +222,7 @@ if save_data :
var_choix = input('voulez vous modifier les données de l EI ? \n y or n \n')
if var_choix == 'y' :
ei.ei_survey_transects(path_hac_survey,path_config,path_save,datedebut,datefin,heuredebut,heurefin,nameTransect,False,True,False)
ei.ei_survey_transects(path_hac_survey,path_config,path_save,datedebut,datefin,heuredebut,heurefin,premiere_date,nameTransect,False,True,False)
#concaténation de tous des résultats EI EK80 de tous les transects pour analyse MFR à l'échelle de la campagne
ei_bind.ei_bind_transects(path_save,None,filename_EK80,None)
......@@ -250,7 +261,7 @@ if save_data :
standardizing.scaling(freqs_EK80_db,Sv_surfEK80_db,Sa_surfEK80_db,depth_surface_EK80_db,depth_bottom_EK80_db,lat_surfEK80_db,
lon_surfEK80_db,time_EK80_db,indices_transduc_choisis,date_time_debut,date_time_fin,nameTransect,save=save_data, filename=filename_data_EK80)
lon_surfEK80_db,time_EK80_db,indices_transduc_choisis,date_time_debut,date_time_fin,premiere_date,nameTransect,save=save_data, filename=filename_data_EK80)
......@@ -302,7 +313,7 @@ else :
freq_MFR,freqs_moy_transducteur,Sv,Sv_moy_transducteur_x,Sa,Depth,Lat,Lon,Time,nb_transduc_choisis,tableau_radiales,nom_numero_radiales = standardizing.scaling(freqs_EK80_db,Sv_surfEK80_db,Sa_surfEK80_db,depth_surface_EK80_db,depth_bottom_EK80_db,lat_surfEK80_db,lon_surfEK80_db,
time_EK80_db,indices_transduc_choisis,date_time_debut,date_time_fin,save=save_data)
time_EK80_db,indices_transduc_choisis,date_time_debut,date_time_fin,premiere_date,nameTransect,save=save_data)
nombre_de_categories = (int) (input('Combien de clusters voulez-vous ? \n'))
kmeans,labels,Q1_,Q3_,med= classif.clustering(Sv,Sv_moy_transducteur_x,freq_MFR,freqs_moy_transducteur,nombre_de_categories,Sa,Time,Depth,Lat,Lon,nb_transduc,tableau_radiales,nom_numero_radiales)
......@@ -426,8 +437,10 @@ for t in range(nb_transduc):
# Sa_moy_log = 10*np.log10(Sa_moy)
# Sa_moy_log[a] = -100
Lat_moy = np.mean(Lat,axis=1)
Lon_moy = np.mean(Lon,axis=1)
Lat_moy = np.true_divide(Lat.sum(1),(Lat!=0).sum(1))
Lon_moy = np.true_divide(Lon.sum(1),(Lon!=0).sum(1))
# Lat_moy = np.mean(Lat,axis=1)
# Lon_moy = np.mean(Lon,axis=1)
# Lon_moy_repmat = np.transpose(np.matlib.repmat(Lon_moy,len(Depth),1))
# Lat_moy_repmat = np.transpose(np.matlib.repmat(Lat_moy,len(Depth),1))
......
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