Commit 967170e7 authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

[Eurocode drawing] add grid. add function to compute the percentage of...

[Eurocode drawing] add grid. add function to compute the percentage of significant trend on an example
parent fad1d0d8
No related merge requests found
Showing with 25 additions and 20 deletions
+25 -20
......@@ -83,3 +83,5 @@ def plot_label_to_ordered_return_level_uncertainties(ax, massif_name, model_name
ax.set_title(massif_name + ' ' + model_name)
ax.set_ylabel('50-year return level (N $m^-2$)')
ax.set_xlabel('Altitude (m)')
ax.grid()
......@@ -57,9 +57,9 @@ def main_drawing():
# Select parameters
massif_names = MASSIF_NAMES_ALPS[:]
model_class_and_last_year = [
(StationaryTemporalModel, LAST_YEAR_FOR_EUROCODE),
(StationaryTemporalModel, 2017),
(NonStationaryLocationAndScaleTemporalModel, 2017),
# Add the temperature here
][1:]
altitudes = EUROCODE_ALTITUDES[:]
uncertainty_methods = [ConfidenceIntervalMethodFromExtremes.my_bayes,
......@@ -68,11 +68,11 @@ def main_drawing():
if fast_plot:
show = True
model_class_and_last_year = model_class_and_last_year[:2]
model_class_and_last_year = model_class_and_last_year[:1]
altitudes = altitudes[2:]
# altitudes = altitudes[:]
massif_names = massif_names[:3]
uncertainty_methods = uncertainty_methods[:2]
massif_names = massif_names[:1]
uncertainty_methods = uncertainty_methods[1:]
model_name_to_massif_name_to_ordered_return_level = {}
for model_class, last_year_for_the_data in model_class_and_last_year:
......
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
import numpy as np
d = {
'mu': [8, 4, 1],
'sigma': [5, 2, 2],
"both": [9, 6, 5]
}
def compare(a):
assert a in ['mu', 'sigma']
percents = [new / old for old, new in zip(d[a], d['both'])]
print(np.mean(percents))
if __name__ == '__main__':
compare('mu')
compare('sigma')
# conclusion: more than 2 times more significant trends in average
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