From 3ac4641ca1dbd70c176cc32106c7249810b02352 Mon Sep 17 00:00:00 2001
From: Le Roux Erwan <erwan.le-roux@irstea.fr>
Date: Fri, 22 Mar 2019 16:11:39 +0100
Subject: [PATCH] [SCM] add new_safran_study for exploratory work

---
 .../new_safran_study.py                       | 31 +++++++++++++++++++
 .../meteo_france_SCM_study/safran/safran.py   |  2 +-
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 experiment/meteo_france_SCM_study/new_safran_study.py

diff --git a/experiment/meteo_france_SCM_study/new_safran_study.py b/experiment/meteo_france_SCM_study/new_safran_study.py
new file mode 100644
index 00000000..5e72ba92
--- /dev/null
+++ b/experiment/meteo_france_SCM_study/new_safran_study.py
@@ -0,0 +1,31 @@
+import numpy as np
+
+from experiment.meteo_france_SCM_study.abstract_study import AbstractStudy
+import os.path as op
+
+from experiment.meteo_france_SCM_study.safran.safran_variable import SafranSnowfallVariable
+
+
+class NewStudy(AbstractStudy):
+
+
+    @property
+    def safran_full_path(self) -> str:
+        return op.join(self.full_path, 'alp_flat/reanalysis/meteo')
+        # return op.join(self.full_path, 'alp_flat/reanalysis/pro')
+
+if __name__ == '__main__':
+    study = NewStudy(SafranSnowfallVariable)
+    d = study.year_to_dataset_ordered_dict[1958]
+    print(d)
+    s = study.year_to_daily_time_serie_array[1958].shape
+    print(s)
+    print(s[1] / 23)
+    print(d.variables['massif'])
+    print(np.array(d.variables['massif']))
+
+    for item in ['LAT', 'LON', 'ZS', 'massif']:
+        a = np.array(d.variables[item])
+        print(a)
+        s = set(a)
+        print(len(s))
diff --git a/experiment/meteo_france_SCM_study/safran/safran.py b/experiment/meteo_france_SCM_study/safran/safran.py
index 98147a32..d34ed4ed 100644
--- a/experiment/meteo_france_SCM_study/safran/safran.py
+++ b/experiment/meteo_france_SCM_study/safran/safran.py
@@ -75,7 +75,7 @@ if __name__ == '__main__':
         print('{}: {}'.format(year, dataset.massifsList))
     d = study.year_to_dataset_ordered_dict[1958]
     print(d.variables['time'])
-    # print(study.year_to_daily_time_serie[1958].shape)
+    print(study.year_to_daily_time_serie_array[1958].shape)
     # print(len(d.variables['time']))
     # print(study.year_to_annual_total)
     # print(study.df_annual_total.columns)
-- 
GitLab