-
Notifications
You must be signed in to change notification settings - Fork 0
/
runplot_figure_8_b.ipy
120 lines (100 loc) · 2.62 KB
/
runplot_figure_8_b.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
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.tools.run.pythonmodule as pm
# Switches
is_read = 1
is_sort = 0
is_plot = 1
is_quot = 0
is_save = 0
is_show = 1
is_backup = 0
model_name = 'wavereal'
which_methods = [142, 4, 141]
# Difference between input alpha and manuscript beta
ensemble_sizes = [50, 70, 100, 250]
ensemble_size = 2000
# 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)
which_methods_sorted = which_methods
# Plot
if is_plot:
# Figure
fig = plt.figure('Errorplot', figsize=[10, 8])
# Run plot function
ax, pic_name = ep.plot(
fig.add_subplot(1, 1, 1),
model=model_name,
which_methods=which_methods_sorted,
ensemble_sizes=ensemble_sizes,
axistitle='',
figpos=[0.20, 0.3, 0.75, 0.6],
ylims=[0.29, 0.36],
yticks=np.arange(0.3, 0.5, 0.02),
fontleg=20,
is_text=True,
text_x=1.0,
text_y=0.34,
legend_input=[r'Hybrid EnKF $\beta = 0.25$',
r'Hybrid EnKF $\beta = 0.5$, default',
r'Hybrid EnKF $\beta = 0.75$'],
xlim_min=0.8,
xlim_max=4.0,
xdiff_nens=0.3,
ylabel=r'RMSE $\log_{10}(K/\mathrm{m}^2)$'
)
# Save
if is_save:
plt.savefig(pic_name)
print('Saved as ' + pic_name)
# Show
if is_show:
plt.show()
else:
plt.clf()
# 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],
# axistitle=model_name.upper()+r', $N_{e}$: '+str(ensemble_size),
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_8_b",
"ipy",
sc.specl(model_name,
'_'.join([str(i) for i in which_methods_sorted])[:],
'2018_08_10')
)