-
Notifications
You must be signed in to change notification settings - Fork 0
/
runplot_figure_2_c.ipy
92 lines (76 loc) · 2 KB
/
runplot_figure_2_c.ipy
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import numpy as np
import matplotlib.pyplot as plt
from pskf.tools.plot import specs as sc
import pskf.scripts.errorplot.arrays as ea
import pskf.scripts.errorplot.plot as ep
import pskf.scripts.errorplot.read as er
import pskf.scripts.errorplot.sort as es
import pskf.tools.run.pythonmodule as pm
# Switches
is_read = 1
is_sort = 1
is_quot = 1
is_save = 0
is_show = 1
is_backup = 0
model_name = 'wavereal'
which_methods = [0, 1, 2, 3, 4, 5, 6]
ensemble_sizes = [50, 70, 100, 250]
ensemble_size = 250
# Read
if is_read:
stat_array, stat_array_name = er.read(
model=model_name,
which_methods=which_methods,
ensemble_sizes=ensemble_sizes,
)
np.save(stat_array_name, stat_array)
print('Saved as ' + stat_array_name)
# Sort
if is_sort:
stat_array, stat_array_name, which_methods_sorted = es.sort(
model_name=model_name,
which_methods=which_methods,
ensemble_sizes=ensemble_sizes,
template_model_name=model_name,
template_enssize=ensemble_size,
template_ensemble_sizes=ensemble_sizes,
)
np.save(stat_array_name, stat_array)
print('Saved as ' + stat_array_name)
else:
which_methods_sorted = which_methods
# Quot
if is_quot:
# Figure
fig = plt.figure('Quotients', figsize=[10, 10])
# Run plot function
ax, pic_name = ep.quots(
fig.add_subplot(1, 1, 1),
model=model_name,
which_methods=which_methods_sorted,
ensemble_sizes=ensemble_sizes,
ensemble_size=ensemble_size,
figpos=[0.14, 0.14, 0.8, 0.8],
is_text=True,
)
# Save
if is_save:
plt.savefig(pic_name)
print('Saved as ' + pic_name)
# Show
if is_show:
plt.show()
else:
plt.clf()
# Backup
if is_backup:
pm.py_backup(
pm.python_scripts_dir,
ea.tag,
"runplot_figure_2_c",
"ipy",
sc.specl(model_name,
'_'.join([str(i) for i in which_methods_sorted])[:],
'2018_08_10')
)