Commit 37558375 authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

[EUROCODE GRAPH] eurocode drawing fixed

parent 18be4af8
No related merge requests found
Showing with 21 additions and 4 deletions
+21 -4
......@@ -64,7 +64,8 @@ def main_drawing():
if fast_plot:
model_class_and_last_year = model_class_and_last_year[:1]
altitudes = altitudes[2:4]
massif_names = massif_names[:1]
# altitudes = altitudes[:]
massif_names = massif_names[:2]
uncertainty_methods = uncertainty_methods[:1]
model_name_to_massif_name_to_ordered_return_level = {}
......
from experiment.meteo_france_data.scm_models_data.crocus.crocus import CrocusDepth
import matplotlib.pyplot as plt
study = CrocusDepth(altitude=1500)
years = []
height = []
for year, days in study.year_to_days.items():
i = days.index(str(year+1) + '-04-01')
a = study.year_to_daily_time_serie_array[year]
j = study.study_massif_names.index('Aravis')
h = a[i, j]
print(h)
height.append(h)
years.append(year)
plt.plot(years, height)
plt.show()
\ No newline at end of file
......@@ -356,15 +356,15 @@ class StudyVisualizer(VisualizationParameters):
return list(range(start_year, stop_year))
def massif_name_to_altitude_and_eurocode_level_uncertainty(self, model_class, last_year_for_the_data, massif_names, ci_method) -> Dict[str, Tuple[int, EurocodeLevelUncertaintyFromExtremes]]:
arguments = [[last_year_for_the_data, self.smooth_maxima_x_y(massif_id), model_class, ci_method] for massif_id, _ in enumerate(massif_names)]
self.multiprocessing = False
massif_ids_and_names = [(massif_id, massif_name) for massif_id, massif_name in enumerate(self.study.study_massif_names) if massif_name in massif_names]
arguments = [[last_year_for_the_data, self.smooth_maxima_x_y(massif_id), model_class, ci_method] for massif_id, _ in massif_ids_and_names]
if self.multiprocessing:
with Pool(NB_CORES) as p:
res = p.starmap(compute_eurocode_level_uncertainty, arguments)
else:
res = [compute_eurocode_level_uncertainty(*argument) for argument in arguments]
res_and_altitude = [(self.study.altitude, r) for r in res]
massif_name_to_eurocode_return_level_uncertainty = OrderedDict(zip(self.study.study_massif_names, res_and_altitude))
massif_name_to_eurocode_return_level_uncertainty = OrderedDict(zip([massif_name for _, massif_name in massif_ids_and_names], res_and_altitude))
return massif_name_to_eurocode_return_level_uncertainty
# def dep_class_to_eurocode_level_uncertainty(self, model_class, last_year_for_the_data):
......
Supports Markdown
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