-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
40 lines (34 loc) · 1.53 KB
/
main.py
File metadata and controls
40 lines (34 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- coding:UTF-8 -*-
# ---------------------------------------------------------------------------------------------------------------------#
# Main program to generate figures
# ---------------------------------------------------------------------------------------------------------------------#
# ---------------------------------------------------#
# Import packages
# ---------------------------------------------------#
# local functions
import enso_and_trends.script_figures as fig
# ---------------------------------------------------#
# collect the figure scripts
figure_scripts = {
"f1": fig.f01_trends_plot,
"f2": fig.f02_een_influence_plot,
"f3": fig.f03_constraint_plot,
"f4": fig.f04_warming_level_plot,
"s1": fig.s01_selection_plot,
"s2": fig.s02_ranked_ensembles_plot,
"s3": fig.s03_correlations_plot,
"s4": fig.s04_constraint_plot,
"s5": fig.s05_constraint_percentage_plot,
}
figure_names = sorted(list(figure_scripts.keys()), key=lambda v: v.lower())
figure_names_print = ", ".join(figure_names)
if __name__ == '__main__':
figure_number = input("Which figure do you want to plot?\n Please enter one of: %s\n" % figure_names_print)
while figure_number not in figure_names + ["all"]:
figure_number = input("Given value %s does not correspond to a figure\n Please enter one of: %s\n" % (
figure_number, figure_names_print))
if figure_number == "all":
for k in figure_names:
figure_scripts[k]()
else:
figure_scripts[figure_number]()