Commit 91463570 authored by Philipp Arras's avatar Philipp Arras
Browse files

Some plotting tweaks

parent 8b6cf6fc
Pipeline #27589 passed with stage
in 1 minute and 30 seconds
......@@ -3,6 +3,8 @@ import numpy as np
import matplotlib.pyplot as plt
from nifty4.sugar import create_power_operator
np.random.seed(42)
x_space = ift.RGSpace(1024)
h_space = x_space.get_default_codomain()
......@@ -69,23 +71,27 @@ plt.plot(d.val,'o', label="data")
plt.plot(s_x.val,label="original")
plt.plot(m_x.val, label="reconstruction")
plt.legend()
plt.show()
plt.savefig('Krylov_reconstruction.png')
plt.close()
pltdict = {'alpha': .2, 'linewidth': .2}
for i in range(N_samps):
plt.plot(sky(samps_old[i]).val, color = 'b')
plt.plot(sky(samps[i]).val, color = 'r')
plt.plot(sky(samps_old[i]).val, color='b', **pltdict)
plt.plot(sky(samps[i]).val, color='r', **pltdict)
plt.plot((s_x-m_x).val,color='k')
plt.legend()
plt.show()
plt.savefig('Krylov_samples.png')
plt.close()
D_hat_old = ift.Field.zeros(x_space).val
D_hat_new = ift.Field.zeros(x_space).val
for i in range(N_samps):
D_hat_old += sky(samps_old[i]).val**2
D_hat_new += sky(samps[i]).val**2
plt.plot(np.sqrt(D_hat_old/N_samps), color='b')
plt.plot(np.sqrt(D_hat_new/N_samps), color='r')
plt.plot(-np.sqrt(D_hat_old/N_samps), color='b')
plt.plot(-np.sqrt(D_hat_new/N_samps), color='r')
plt.plot((s_x-m_x).val, color='k')
plt.show()
plt.plot(np.sqrt(D_hat_old/N_samps), 'r--', label='Old uncertainty')
plt.plot(-np.sqrt(D_hat_old/N_samps), 'r--')
plt.fill_between(range(len(D_hat_new)), -np.sqrt(D_hat_new/N_samps), np.sqrt(D_hat_new/N_samps), facecolor='0.5', alpha=0.5, label='New unvertainty')
plt.plot((s_x-m_x).val, color='k', label='signal - mean')
plt.legend()
plt.savefig('Krylov_uncertainty.png')
plt.close()
Markdown is supported
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