Skip to content

Commit

Permalink
Clean up fluvial example II
Browse files Browse the repository at this point in the history
  • Loading branch information
prisae committed Jul 11, 2024
1 parent 886a44a commit 7664cb1
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions examples/fluvialreservoir.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

# For reproducibility, we instantiate a random number generator with a fixed
# seed. For production, remove the seed!
rng = np.random.default_rng(1324)
rng = np.random.default_rng(1513)

# Adjust this path to a folder of your choice.
data_path = os.path.join("..", "download", "")
Expand Down Expand Up @@ -73,7 +73,6 @@
clim=[-0.5, 2.5], origin="lower"
)
fig.colorbar(im, ax=axs, ticks=[0, 1, 2], label="Facies code")
fig.show()


###############################################################################
Expand All @@ -100,8 +99,7 @@
fig.suptitle("Permeabilities")
for i in range(ne):
im = axs[i].imshow(permeabilities[i, ...], origin="lower")
fig.colorbar(im, ax=axs)
fig.show()
fig.colorbar(im, ax=axs, label="Log10 Permeability (mD)")


###############################################################################
Expand Down Expand Up @@ -208,20 +206,25 @@ def restrict_permeability(x):

# Plot posterior
fig, axs = plt.subplots(
2, 2, figsize=(6, 6), sharex=True, sharey=True, constrained_layout=True)
axs[0, 0].set_title("Prior Mean")
axs[0, 0].imshow(perm_prior.mean(axis=0).T, vmin=perm_min, vmax=perm_max)
axs[0, 1].set_title("'Truth'")
axs[0, 1].imshow(perm_true.T, vmin=perm_min, vmax=perm_max)
1, 3, figsize=(8, 4), sharex=True, sharey=True, constrained_layout=True)

par = {"vmin": perm_min, "vmax": perm_max, "origin": "lower"}

axs[1, 0].set_title("Post Mean without localization")
axs[1, 0].imshow(nl_perm_post.mean(axis=0).T, vmin=perm_min, vmax=perm_max)
axs[1, 1].set_title("Post Mean with localization")
axs[1, 1].imshow(wl_perm_post.mean(axis=0).T, vmin=perm_min, vmax=perm_max)
axs[1, 1].contour(loc_mat.sum(axis=2).T, levels=[2.0, ], colors="w")
axs[0].set_title("Prior Mean")
im = axs[0].imshow(perm_prior.mean(axis=0).T, **par)

for ax in axs.ravel():

axs[1].set_title("Post Mean; No localization")
axs[1].imshow(nl_perm_post.mean(axis=0).T, **par)

axs[2].set_title("Post Mean: Localization")
axs[2].imshow(wl_perm_post.mean(axis=0).T, **par)
axs[2].contour(loc_mat.sum(axis=2).T, levels=[2.0, ], colors="w")

fig.colorbar(im, ax=axs, label="Log10 Permeabilities (mD)",
orientation="horizontal")

for ax in axs:
for well in wells:
ax.plot(well[0], well[1], ["C3v", "C1^"][int(well[2] == 120)])

Expand All @@ -235,6 +238,7 @@ def restrict_permeability(x):
2, 3, figsize=(8, 5), sharex=True, sharey=True, constrained_layout=True)
fig.suptitle("Prior and posterior data")
for i, ax in enumerate(axs[0, :]):
ax.set_title(f"Well ({ox[i]}; {oy[i]})")
ax.plot(time*24*60*60, data_prior[..., i::3].T, color=".6", alpha=0.5)
ax.plot(time*24*60*60, nl_data_post[..., i::3].T, color="C0", alpha=0.5)
ax.plot(time*24*60*60, data_obs[0, i::3], "C3o")
Expand Down

0 comments on commit 7664cb1

Please sign in to comment.