Commit daa4d341 authored by Antoine Berchet's avatar Antoine Berchet
Browse files

Modifying plots for article; improving convergence of M1QN3 for article

parent 553a8522
......@@ -61,8 +61,8 @@ def test_integration_inversion(dummy_config_inversion, settings, pytestconfig):
},
"maxiter": nsimmax,
"nsim": nsimmax,
"epsg": 0.02,
"df1": 0.00001
"epsg": 0.0002,
"df1": 0.5
},
"save_out_netcdf": True
}
......@@ -364,14 +364,13 @@ def test_integration_inversion(dummy_config_inversion, settings, pytestconfig):
# Plot matrix of uncertainty reduction
if hasattr(controlvect, "pa"):
# bfull = controlvect.build_b(controlvect)
pa = controlvect.pa
plt.figure(figsize=(21, 11))
ax0 = plt.axes([0.05, 0.05, 0.73, 0.87])
im = plt.imshow(pa[:int(controlvect.dim / 2),
:int(controlvect.dim / 2)],
vmin=-0.5, vmax=0.5)
vmin=-0.5, vmax=0.5, cmap="RdBu")
plt.xticks(fontsize=20)
plt.yticks(fontsize=20)
......@@ -386,6 +385,31 @@ def test_integration_inversion(dummy_config_inversion, settings, pytestconfig):
os.path.abspath(os.path.join(current_dir,
"../../figures_artifact/"))
Path(figure_dir).mkdir(parents=True, exist_ok=True)
plt.savefig("{}/uncertaintyreduc_matrix_{}_{}_{}.pdf"
plt.savefig("{}/posterior_matrix_{}_{}_{}.pdf"
.format(figure_dir, title, resol, nsimmax))
plt.close()
# Prior matrix
bfull = controlvect.build_b(controlvect)
plt.figure(figsize=(21, 11))
ax0 = plt.axes([0.05, 0.05, 0.73, 0.87])
im = plt.imshow(bfull[:int(controlvect.dim / 2),
:int(controlvect.dim / 2)],
vmin=-0.5, vmax=0.5, cmap="RdBu")
plt.xticks(fontsize=20)
plt.yticks(fontsize=20)
ax1 = plt.axes([0.74, 0.05, 0.05, 0.87])
cb1 = plt.colorbar(im, cax=ax1)
plt.yticks(fontsize=25)
plt.ylabel("Prior uncertainties (a.u.)", fontsize=30)
current_dir = os.path.abspath(
os.path.dirname(os.path.realpath(__file__)))
figure_dir = \
os.path.abspath(os.path.join(current_dir,
"../../figures_artifact/"))
Path(figure_dir).mkdir(parents=True, exist_ok=True)
plt.savefig("{}/prior_matrix_{}_{}_{}.pdf"
.format(figure_dir, title, resol, nsimmax))
plt.close()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment