Commit 5d94491c authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

[POSTER EVAN] add maxima visualization for the EAN

parent b14b1d73
No related merge requests found
Showing with 23 additions and 11 deletions
+23 -11
......@@ -34,13 +34,20 @@ altitude_massif_name_and_study_class_for_poster = [
(2700, 'Parpaillon', SafranSnowfall),
]
altitude_massif_name_and_study_class_for_poster_evan = [
(900, 'Chartreuse', CrocusSwe3Days),
(1800, 'Vanoise', CrocusSwe3Days),
(2700, 'Parpaillon', CrocusSwe3Days),
]
SCM_STUDY_NAME_TO_ABBREVIATION = {get_display_name_from_object_type(k): v for k, v in
SCM_STUDY_CLASS_TO_ABBREVIATION.items()}
SCM_COLORS = ['tab:orange', 'y', 'tab:purple', 'lightseagreen']
SCM_STUDY_CLASS_TO_COLOR = dict(zip(SCM_STUDIES, SCM_COLORS))
SCM_STUDY_NAME_TO_COLOR = {get_display_name_from_object_type(s): color
for s, color in zip(SCM_STUDIES, SCM_COLORS)}
poster_altitude_to_color = dict(zip([900, 1800, 2700], ['y', 'tab:purple', 'tab:orange']))
SCM_EXTENDED_STUDIES = [ExtendedSafranSnowfall, ExtendedCrocusSweTotal, ExtendedCrocusDepth]
SCM_STUDY_TO_EXTENDED_STUDY = OrderedDict(zip(SCM_STUDIES, SCM_EXTENDED_STUDIES))
......@@ -237,15 +244,20 @@ def maxima_analysis():
def max_graph_annual_maxima_poster():
save_to_file = True
for altitude, massif_name, study_class in altitude_massif_name_and_study_class_for_poster:
choice_tuple = [
altitude_massif_name_and_study_class_for_poster,
altitude_massif_name_and_study_class_for_poster_evan,
][1]
for altitude, massif_name, study_class in choice_tuple:
for study in study_iterator_global([study_class], altitudes=[altitude]):
study_visualizer = StudyVisualizer(study, save_to_file=save_to_file,
verbose=True,
multiprocessing=True)
snow_abbreviation = SCM_STUDY_CLASS_TO_ABBREVIATION[study_class]
color = SCM_STUDY_CLASS_TO_COLOR[study_class]
# study_visualizer.visualize_max_graphs_poster(massif_name, altitude, snow_abbreviation, color)
study_visualizer.visualize_gev_graphs_poster(massif_name, altitude, snow_abbreviation, color)
# color = SCM_STUDY_CLASS_TO_COLOR[study_class]
color = poster_altitude_to_color[altitude]
study_visualizer.visualize_max_graphs_poster(massif_name, altitude, snow_abbreviation, color)
# study_visualizer.visualize_gev_graphs_poster(massif_name, altitude, snow_abbreviation, color)
def altitude_analysis():
......@@ -260,8 +272,8 @@ def main_run():
# trend_analysis()
# altitude_analysis()
# max_graph_annual_maxima_poster()
maxima_analysis()
max_graph_annual_maxima_poster()
# maxima_analysis()
# case_study()
# all_scores_vizu()
# maxima_analysis()
......
......@@ -618,12 +618,12 @@ class StudyVisualizer(VisualizationParameters):
# Display the graph of the max on top
ax = plt.gca()
_, y = self.smooth_maxima_x_y(massif_names.index(massif_name))
d = IsmevGevFit(x_gev=y).gev_params
gev_param = IsmevGevFit(x_gev=y).gev_params
# Round up
d = {k: self.round_sig(v, 2) for k, v in d.items()}
print(d)
gev_param = GevParams.from_dict(d)
# d = {k: self.round_sig(v, 2) for k, v in d.items()}
# print(d)
# gev_param = GevParams.from_dict(d)
x_gev = np.linspace(0.0, 1.5 * max(y), num=1000)
y_gev = [gev_param.density(x) for x in x_gev]
ax.plot(x_gev, y_gev, color=color, linewidth=5)
......
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