-
Notifications
You must be signed in to change notification settings - Fork 0
/
runplot_figure_9_b.ipy
90 lines (75 loc) · 2.04 KB
/
runplot_figure_9_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
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_plot = 1
is_save = 0
is_show = 1
is_backup = 0
model_name = 'wavewell'
which_methods = [101, 0, 102]
ensemble_sizes = [50, 70, 100, 250, 2000]
ensemble_size = 50
# 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],
lineyval=0.76,
ylims=[0.50, 1.00],
yticks=np.arange(0.5, 1.05, 0.1),
fontleg=20,
is_text=True,
text_x=2.5,
text_y=0.88,
legend_input=[r'EnKF $\sigma_{\mathrm{h}} = 1.0\, \mathrm{cm}$',
r'EnKF $\sigma_{\mathrm{h}} = 5.0\, \mathrm{cm}$,'
+ ' default',
r'EnKF $\sigma_{\mathrm{h}} = 10.0\,\mathrm{cm}$'],
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()
# Backup
if is_backup:
pm.py_backup(
pm.python_scripts_dir,
ea.tag,
"runplot_figure_9_b",
"ipy",
sc.specl(model_name,
'_'.join([str(i) for i in which_methods_sorted])[:],
'2018_08_10')
)