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

cleanup

parent 324405dc
......@@ -281,7 +281,7 @@
}
},
"source": [
"### Create Power Spectra of Signal and Reconstruction"
"### Signal Reconstruction"
]
},
{
......@@ -294,39 +294,11 @@
},
"outputs": [],
"source": [
"s_power = ift.power_analyze(sh)\n",
"m_power = ift.power_analyze(m)\n",
"s_power_data = s_power.to_global_data()\n",
"m_power_data = m_power.to_global_data()\n",
"\n",
"# Get signal data and reconstruction data\n",
"s_data = HT(sh).to_global_data()\n",
"m_data = HT(m).to_global_data()\n",
"d_data = d.to_global_data()\n",
"\n",
"d_data = d.to_global_data()"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"### Signal Reconstruction"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"slideshow": {
"slide_type": "-"
}
},
"outputs": [],
"source": [
"plt.figure(figsize=(15,10))\n",
"plt.plot(s_data, 'r', label=\"Signal\", linewidth=3)\n",
"plt.plot(d_data, 'k.', label=\"Data\")\n",
......@@ -377,6 +349,8 @@
},
"outputs": [],
"source": [
"s_power_data = ift.power_analyze(sh).to_global_data()\n",
"m_power_data = ift.power_analyze(m).to_global_data()\n",
"plt.figure(figsize=(15,10))\n",
"plt.loglog()\n",
"plt.xlim(1, int(N_pixels/2))\n",
......@@ -628,15 +602,10 @@
"m_mean, m_var = ift.probe_with_posterior_samples(curv, HT, 20)\n",
"\n",
"# Get data\n",
"s_power = ift.power_analyze(sh)\n",
"m_power = ift.power_analyze(m)\n",
"s_power_data = s_power.to_global_data()\n",
"m_power_data = m_power.to_global_data()\n",
"s_data = HT(sh).to_global_data()\n",
"m_data = HT(m).to_global_data()\n",
"m_var_data = m_var.to_global_data()\n",
"d_data = d.to_global_data()\n",
"\n",
"uncertainty = np.sqrt(np.abs(m_var_data))"
]
},
......@@ -684,11 +653,11 @@
"ma = np.max(s_data)\n",
"\n",
"fig, axes = plt.subplots(3, 2, figsize=(15, 22.5))\n",
"samp1 = HT(curv.draw_sample()+m).to_global_data()\n",
"samp2 = HT(curv.draw_sample()+m).to_global_data()\n",
"sample = HT(curv.draw_sample()+m).to_global_data()\n",
"post_mean = (m_mean + HT(m)).to_global_data()\n",
"\n",
"data = [s_data, m_data, samp1, samp2, s_data - m_data, uncertainty]\n",
"caption = [\"Signal\", \"Reconstruction\", \"Sample 1\", \"Sample 2\", \"Residuals\", \"Uncertainty Map\"]\n",
"data = [s_data, m_data, post_mean, sample, s_data - m_data, uncertainty]\n",
"caption = [\"Signal\", \"Reconstruction\", \"Posterior mean\", \"Sample\", \"Residuals\", \"Uncertainty Map\"]\n",
"\n",
"for ax in axes.flat:\n",
" im = ax.imshow(data.pop(0), interpolation='nearest', cmap=cm, vmin=mi, vmax=ma)\n",
......
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