From 5989c63492d33cdad5ca257ecf06f4768b149d9c Mon Sep 17 00:00:00 2001
From: Le Roux Erwan <erwan.le-roux@irstea.fr>
Date: Mon, 27 Apr 2020 19:06:26 +0200
Subject: [PATCH] [taline] final version sent to taline

---
 .../case_studies/taline/taline.py                | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/extreme_data/meteo_france_data/scm_models_data/case_studies/taline/taline.py b/extreme_data/meteo_france_data/scm_models_data/case_studies/taline/taline.py
index afa23740..ab70bdb7 100644
--- a/extreme_data/meteo_france_data/scm_models_data/case_studies/taline/taline.py
+++ b/extreme_data/meteo_france_data/scm_models_data/case_studies/taline/taline.py
@@ -7,17 +7,22 @@ from extreme_data.meteo_france_data.scm_models_data.crocus.crocus import CrocusD
 from extreme_data.meteo_france_data.scm_models_data.safran.safran import SafranTemperature, SafranSnowfall1Day, \
     SafranPrecipitation1Day
 from extreme_data.meteo_france_data.scm_models_data.utils import Season
-from extreme_data.meteo_france_data.scm_models_data.visualization.main_study_visualizer import ALL_ALTITUDES
 
-massifs_names = ['Queyras', 'Thabor', 'Haute-Maurienne'][:]
 study_classes = [SafranTemperature, SafranSnowfall1Day, SafranPrecipitation1Day,
                  CrocusDepth, CrocusDepthIn3Days, CrocusDepthWet][:]
-altitudes = ALL_ALTITUDES
+massif_name_to_start_end = {
+    'Queyras': [900, 3300],
+    'Thabor': [900, 3300],
+    'Haute-Maurienne': [900, 3900]
+}
 season = Season.annual
-for massif_name in massifs_names:
+for massif_name, (start, end) in massif_name_to_start_end.items():
+    print(massif_name)
     writer = pd.ExcelWriter('{}.xlsx'.format(massif_name), engine='xlsxwriter')
     for study_class in study_classes:
+        print(study_class)
         altitude_to_time_serie = OrderedDict()
+        altitudes = list(range(start, end + 300, 300))
         for altitude in altitudes:
             study = study_class(altitude=altitude)  # type: AbstractStudy
             if massif_name in study.study_massif_names:
@@ -28,6 +33,3 @@ for massif_name in massifs_names:
         print(df.head())
         df.to_excel(writer, sheet_name=study.variable_name)
     writer.save()
-
-
-
-- 
GitLab