Commit d4a9bd66 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

cleanup

parent 324405dc
......@@ -171,34 +171,20 @@
m = D(j)
```
%% Cell type:markdown id: tags:
### Create Power Spectra of Signal and Reconstruction
### Signal Reconstruction
%% Cell type:code id: tags:
``` python
s_power = ift.power_analyze(sh)
m_power = ift.power_analyze(m)
s_power_data = s_power.to_global_data()
m_power_data = m_power.to_global_data()
# Get signal data and reconstruction data
s_data = HT(sh).to_global_data()
m_data = HT(m).to_global_data()
d_data = d.to_global_data()
```
%% Cell type:markdown id: tags:
### Signal Reconstruction
%% Cell type:code id: tags:
``` python
plt.figure(figsize=(15,10))
plt.plot(s_data, 'r', label="Signal", linewidth=3)
plt.plot(d_data, 'k.', label="Data")
plt.plot(m_data, 'k', label="Reconstruction",linewidth=3)
plt.title("Reconstruction")
......@@ -224,10 +210,12 @@
### Power Spectrum
%% Cell type:code id: tags:
``` python
s_power_data = ift.power_analyze(sh).to_global_data()
m_power_data = ift.power_analyze(m).to_global_data()
plt.figure(figsize=(15,10))
plt.loglog()
plt.xlim(1, int(N_pixels/2))
ymin = min(m_power_data)
plt.ylim(ymin, 1)
......@@ -391,19 +379,14 @@
# Uncertainty
m_mean, m_var = ift.probe_with_posterior_samples(curv, HT, 20)
# Get data
s_power = ift.power_analyze(sh)
m_power = ift.power_analyze(m)
s_power_data = s_power.to_global_data()
m_power_data = m_power.to_global_data()
s_data = HT(sh).to_global_data()
m_data = HT(m).to_global_data()
m_var_data = m_var.to_global_data()
d_data = d.to_global_data()
uncertainty = np.sqrt(np.abs(m_var_data))
```
%% Cell type:code id: tags:
......@@ -433,15 +416,15 @@
``` python
mi = np.min(s_data)
ma = np.max(s_data)
fig, axes = plt.subplots(3, 2, figsize=(15, 22.5))
samp1 = HT(curv.draw_sample()+m).to_global_data()
samp2 = HT(curv.draw_sample()+m).to_global_data()
sample = HT(curv.draw_sample()+m).to_global_data()
post_mean = (m_mean + HT(m)).to_global_data()
data = [s_data, m_data, samp1, samp2, s_data - m_data, uncertainty]
caption = ["Signal", "Reconstruction", "Sample 1", "Sample 2", "Residuals", "Uncertainty Map"]
data = [s_data, m_data, post_mean, sample, s_data - m_data, uncertainty]
caption = ["Signal", "Reconstruction", "Posterior mean", "Sample", "Residuals", "Uncertainty Map"]
for ax in axes.flat:
im = ax.imshow(data.pop(0), interpolation='nearest', cmap=cm, vmin=mi, vmax=ma)
ax.set_title(caption.pop(0))
......
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