Skip to content

Commit 2f0a2bb

Browse files
committed
Better bounds; add rectangle to error plot
1 parent e2b0937 commit 2f0a2bb

File tree

7 files changed

+6
-7
lines changed

7 files changed

+6
-7
lines changed

results/1d_herten_conditioned.pdf

69 Bytes
Binary file not shown.
-63.3 KB
Binary file not shown.
-53.4 KB
Binary file not shown.

results/2d_herten_difference.pdf

-82.5 KB
Binary file not shown.

results/herten_T_obs.pdf

-93.4 KB
Binary file not shown.

results/herten_variogram.pdf

121 Bytes
Binary file not shown.

src/01_herten.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ def add_colorbar(im, aspect=20, pad_fraction=0.5, **kwargs):
3737

3838
# imshow plotting settings
3939
extent = [min(x_s), max(x_s), min(y_s), max(y_s)]
40-
kw1 = dict(origin="lower", extent=extent)
40+
kw = dict(origin="lower", extent=extent)
41+
kw1 = dict(vmin=0.2, vmax=0.8, **kw)
4142

4243
idx_x, idx_y = np.mgrid[40:170:10, 40:170:10]
4344
idx_x, idx_y = idx_x.flatten(), idx_y.flatten()
@@ -107,9 +108,6 @@ def add_colorbar(im, aspect=20, pad_fraction=0.5, **kwargs):
107108
# Plotting ####################################################################
108109
###############################################################################
109110

110-
vmin = min(np.min(herten_T), np.min(herten_ens))
111-
vmax = max(np.max(herten_T), np.max(herten_ens))
112-
kw2 = dict(vmin=vmin, vmax=vmax, **kw1)
113111
c = sns.color_palette()
114112

115113
# compare Original field with one realization #################################
@@ -119,7 +117,7 @@ def add_colorbar(im, aspect=20, pad_fraction=0.5, **kwargs):
119117
rect = pat.Rectangle(*rect_dim, edgecolor='k', facecolor='none')
120118

121119
fig, ax = plt.subplots(1)
122-
im = ax.imshow(herten_T.T, **kw2)
120+
im = ax.imshow(herten_T.T, **kw1)
123121
cbar = add_colorbar(im)
124122
cbar.set_label(r"$T$ / m s$^{-1}$")
125123
ax.set_xlabel(r"$x$ / m")
@@ -131,7 +129,7 @@ def add_colorbar(im, aspect=20, pad_fraction=0.5, **kwargs):
131129
fig.show()
132130

133131
fig, ax = plt.subplots(1)
134-
im = ax.imshow(herten_ens[0].T, **kw2)
132+
im = ax.imshow(herten_ens[0].T, **kw1)
135133
cbar = add_colorbar(im)
136134
cbar.set_label(r"$T$ / m s$^{-1}$")
137135
ax.set_xlabel(r"$x$ / m")
@@ -145,12 +143,13 @@ def add_colorbar(im, aspect=20, pad_fraction=0.5, **kwargs):
145143
# plot absolute difference ####################################################
146144

147145
fig, ax = plt.subplots()
148-
im2 = ax.imshow(np.abs(herten_T.T - herten_ens[0].T), cmap="YlOrRd", **kw1)
146+
im2 = ax.imshow(np.abs(herten_T.T - herten_ens[0].T), cmap="YlOrRd", **kw)
149147
ax.set_aspect("equal")
150148
cbar = add_colorbar(im2)
151149
cbar.set_label(r"Absolute Difference $T$ / m s$^{-1}$")
152150
ax.set_xlabel(r"$x$ / m")
153151
ax.set_ylabel(r"$y$ / m")
152+
ax.add_patch(copy.copy(rect))
154153

155154
fig.tight_layout()
156155
fig.savefig(Path("../results/2d_herten_difference.pdf"), dpi=300)

0 commit comments

Comments
 (0)