Commit 27193d8d authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

[projections] fix main_data.py plot

parent 145e046a
No related merge requests found
Showing with 15 additions and 15 deletions
+15 -15
...@@ -68,8 +68,8 @@ class AdamontStudies(object): ...@@ -68,8 +68,8 @@ class AdamontStudies(object):
label = gcm_rcm_couple_to_str(gcm_rcm_couple) label = gcm_rcm_couple_to_str(gcm_rcm_couple)
color = gcm_rcm_couple_to_color[gcm_rcm_couple] color = gcm_rcm_couple_to_color[gcm_rcm_couple]
ax.plot(x, y, linewidth=linewidth, label=label, color=color) ax.plot(x, y, linewidth=linewidth, label=label, color=color)
if scm_study is None: # if scm_study is None:
pass # pass
# I should recode that, taking into account that the length of annual maxima is not the same # I should recode that, taking into account that the length of annual maxima is not the same
# for all the time series # for all the time series
# x = study.ordered_years # x = study.ordered_years
...@@ -80,16 +80,16 @@ class AdamontStudies(object): ...@@ -80,16 +80,16 @@ class AdamontStudies(object):
# label = 'Mean maxima' # label = 'Mean maxima'
# color = 'black' # color = 'black'
# ax.plot(x, y, linewidth=linewidth * 2, label=label, color=color) # ax.plot(x, y, linewidth=linewidth * 2, label=label, color=color)
else: # else:
# todo: otherwise display the mean in strong black # todo: otherwise display the mean in strong black
try: # try:
x = scm_study.ordered_years # x = scm_study.ordered_years
y = scm_study.massif_name_to_annual_maxima[massif_name] # y = scm_study.massif_name_to_annual_maxima[massif_name]
label = 'Reanalysis' # label = 'Reanalysis'
color = 'black' # color = 'black'
ax.plot(x, y, linewidth=linewidth * 2, label=label, color=color) # ax.plot(x, y, linewidth=linewidth * 2, label=label, color=color)
except KeyError: # except KeyError:
pass # pass
ticks = [year for year in range(self.year_min_studies, self.year_max_studies+1) if year % 10 == 0] ticks = [year for year in range(self.year_min_studies, self.year_max_studies+1) if year % 10 == 0]
ax.xaxis.set_ticks(ticks) ax.xaxis.set_ticks(ticks)
......
...@@ -20,15 +20,15 @@ from extreme_data.meteo_france_data.scm_models_data.utils import Season ...@@ -20,15 +20,15 @@ from extreme_data.meteo_france_data.scm_models_data.utils import Season
def main(): def main():
scm_study_class = SafranSnowfall1Day scm_study_class = SafranSnowfall1Day
adamont_study_class = AdamontSnowfall adamont_study_class = AdamontSnowfall
year_min = 1950 year_min = 2006
year_max = 2100 year_max = 2100
massif_names = ['Vanoise'] massif_names = ['Vanoise']
season = Season.annual season = Season.annual
scenarios = rcm_scenarios_extended scenarios = rcm_scenarios_extended
# scenarios = rcp_scenarios scenarios = rcp_scenarios
altitudes = [600, 2100, 3600] altitudes = [600, 2100, 3600]
for altitude, adamont_scenario in list(zip(altitudes, scenarios))[:]: for altitude, adamont_scenario in list(zip(altitudes, scenarios))[:]:
plt.figure(figsize=(20, 5)) plt.figure(figsize=(10, 5))
# Loading part # Loading part
scm_study = scm_study_class(altitude=altitude) scm_study = scm_study_class(altitude=altitude)
real_adamont_scenario = scenario_to_real_scenarios(adamont_scenario=adamont_scenario)[-1] real_adamont_scenario = scenario_to_real_scenarios(adamont_scenario=adamont_scenario)[-1]
...@@ -38,7 +38,7 @@ def main(): ...@@ -38,7 +38,7 @@ def main():
season=season, scenario=adamont_scenario) season=season, scenario=adamont_scenario)
print(altitude, adamont_scenario) print(altitude, adamont_scenario)
adamont_studies.plot_maxima_time_series_adamont(massif_names=massif_names, adamont_studies.plot_maxima_time_series_adamont(massif_names=massif_names,
scm_study=scm_study, legend_and_labels=False) scm_study=scm_study, legend_and_labels=True)
if __name__ == '__main__': if __name__ == '__main__':
......
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