diff --git a/experiment/eurocode_data/__init__.py b/experiment/eurocode_data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiment/eurocode_data/departementalpesfrancaises.py b/experiment/eurocode_data/departementalpesfrancaises.py new file mode 100644 index 0000000000000000000000000000000000000000..d36d9f41eb9dfc7c229ee3bc9a80fb9005bd9967 --- /dev/null +++ b/experiment/eurocode_data/departementalpesfrancaises.py @@ -0,0 +1,82 @@ +from enum import Enum + +from experiment.eurocode_data.region_eurocode import AbstractRegionType, E, C2, C1 + + +class AbstractDepartementAlpesFrancaises(object): + + def __init__(self, region: type): + self.region = region() # type: AbstractRegionType + + +class HauteSavoie(AbstractDepartementAlpesFrancaises): + + def __init__(self): + super().__init__(E) + + +class Savoie(AbstractDepartementAlpesFrancaises): + + def __init__(self): + super().__init__(E) + + +class Isere(AbstractDepartementAlpesFrancaises): + + def __init__(self): + super().__init__(C2) + + +class HautesAlpes(AbstractDepartementAlpesFrancaises): + + def __init__(self): + super().__init__(C1) + + +class AlpesMaritimes(AbstractDepartementAlpesFrancaises): + + def __init__(self): + super().__init__(C1) + + +class AlpesDeHauteProvence(AbstractDepartementAlpesFrancaises): + + def __init__(self): + super().__init__(C1) + + +class Drome(AbstractDepartementAlpesFrancaises): + + def __init__(self): + super().__init__(C2) + + +""" +Quand c'est à cheval, je mets les deux massifs +Quand juste un bout du massif est dans un autre departement +(Chartreuse, Belledonne sont un peu en Savoie +""" +massif_name_to_departements = { + 'Chablais': [HauteSavoie], + 'Aravis': [HauteSavoie, Savoie], + 'Mont-Blanc': [HauteSavoie], + 'Bauges': [HauteSavoie, Savoie], + 'Beaufortain': [HauteSavoie, Savoie], + 'Haute-Tarentaise': [Savoie], + 'Chartreuse': [Isere], + 'Belledonne': [Isere], + 'Maurienne': [Savoie], + 'Vanoise': [Savoie], + 'Haute-Maurienne': [Savoie], + 'Grandes-Rousses': [Isere, Savoie], + 'Thabor': [HauteSavoie], + 'Vercors': [Isere, Drome], + 'Oisans': [Isere, HautesAlpes], + 'Pelvoux': [Isere, HautesAlpes], + 'Queyras': [HautesAlpes], + 'Devoluy': [Drome, Isere, HautesAlpes], + 'Champsaur': [HautesAlpes], + 'Parpaillon': [HautesAlpes, AlpesDeHauteProvence], + 'Ubaye': [AlpesDeHauteProvence], + 'Haut_Var-Haut_Verdon': [AlpesDeHauteProvence], + 'Mercantour': [AlpesMaritimes, AlpesDeHauteProvence]} diff --git a/experiment/eurocode_data/region_eurocode.py b/experiment/eurocode_data/region_eurocode.py new file mode 100644 index 0000000000000000000000000000000000000000..5ede49c6c00d0785bc49eaa0fe07d367fa54d621 --- /dev/null +++ b/experiment/eurocode_data/region_eurocode.py @@ -0,0 +1,16 @@ + + +class AbstractRegionType(object): + pass + + +class C1(AbstractRegionType): + pass + + +class C2(AbstractRegionType): + pass + + +class E(AbstractRegionType): + pass \ No newline at end of file diff --git a/experiment/meteo_france_data/scm_models_data/abstract_study.py b/experiment/meteo_france_data/scm_models_data/abstract_study.py index 7c85b8d69cedfb9fb2b1269e45064c9f67d8222d..121eec14347aaffade3929a54215abfccca1ea06 100644 --- a/experiment/meteo_france_data/scm_models_data/abstract_study.py +++ b/experiment/meteo_france_data/scm_models_data/abstract_study.py @@ -43,6 +43,7 @@ class AbstractStudy(object): Les fichiers netcdf de SAFRAN et CROCUS sont autodocumentés (on peut les comprendre avec ncdump -h notamment). """ REANALYSIS_FOLDER = 'SAFRAN_montagne-CROCUS_2019/alp_flat/reanalysis' + # REANALYSIS_FOLDER = 'SAFRAN_montagne-CROCUS_2019/postes/reanalysis' def __init__(self, variable_class: type, altitude: int = 1800, year_min=1000, year_max=3000, multiprocessing=True): diff --git a/experiment/meteo_france_data/scm_models_data/safran/safran.py b/experiment/meteo_france_data/scm_models_data/safran/safran.py index 173fbfb365790e03f9fc63e71797c3598999c3f0..a45199aaf283e64b53b2c9403c696c78ab9eaf02 100644 --- a/experiment/meteo_france_data/scm_models_data/safran/safran.py +++ b/experiment/meteo_france_data/scm_models_data/safran/safran.py @@ -67,13 +67,20 @@ if __name__ == '__main__': study = SafranSnowfall() # d = study.year_to_dataset_ordered_dict[1958] # print(d.variables) + print(study.study_massif_names) + d = { + name: '' for name in study.study_massif_names + } + print(d) for i in range(1958, 1959): d = study.year_to_dataset_ordered_dict[i] + # variable = 'station' + # print(np.array(d.variables[variable])) variable = 'Tair' a = np.mean(np.array(d.variables[variable]), axis=1) - d = study.year_to_dataset_ordered_dict[i+1] + d = study.year_to_dataset_ordered_dict[i + 1] b = np.mean(np.array(d.variables[variable]), axis=1) - print(a[-1] - b[0]) + # print(a[-1] - b[0]) # print(d.variables['time']) # print(study.all_massif_names) # print(study.massif_name_to_altitudes) @@ -84,7 +91,6 @@ if __name__ == '__main__': # print(study.year_to_annual_total) # print(study.df_annual_total.columns) - # for i in range(1958, 2016): # d = study.year_to_dataset_ordered_dict[i] # variable = 'Tair'