Commit 06b39731 authored by Jakob Knollmueller's avatar Jakob Knollmueller

stuff

parent 0c5937f2
......@@ -16,7 +16,10 @@ if __name__ == '__main__':
sh = power_synthesize(sp)
s = FFT.adjoint_times(sh)
u = Field(s_space, val = -12)
# u = np.random.exponential(10,1024)
# u = log(Field(s_space, val = u))
u = Field(s_space, val = -12.)
u.val[200] = 1
u.val[300] = 3
u.val[500] = 4
......
......@@ -6,6 +6,8 @@ rc('font',**{'family':'serif','serif':['Palatino']})
rc('text', usetex=True)
from matplotlib import pyplot as plt
from matplotlib.colors import LogNorm
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mpl_toolkits.axes_grid1 import AxesGrid
np.random.seed(42)
......@@ -22,28 +24,95 @@ if __name__ == '__main__':
size = 15
vmin = data.min()+0.01
vmax = 0.1*data.max()
vmax = 0.01*data.max()
plt.figure()
plt.imshow(np.exp(myEnergy.s.val),norm=LogNorm(vmin=vmin, vmax=vmax))
cbar = plt.colorbar()
cbar.set_label('flux', size=size)
plt.title('diffuse emission', size=size)
plt.axis('off')
ax = plt.gca()
im = ax.imshow(np.exp(myEnergy.s.val),norm=LogNorm(vmin=vmin, vmax=vmax))
divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="5%", pad=0.05)
cbar = plt.colorbar(im, cax=cax)
cbar.set_label('flux', size=size)
plt.tight_layout()
plt.savefig('hubble_diffuse.pdf')
plt.figure()
plt.imshow(np.exp(myEnergy.u.val), norm=LogNorm(vmin=vmin, vmax=vmax))
cbar = plt.colorbar()
cbar.set_label('flux', size=size)
plt.title('point-like emission', size=size)
plt.axis('off')
ax = plt.gca()
im = ax.imshow(np.exp(myEnergy.u.val), norm=LogNorm(vmin=vmin, vmax=vmax))
divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="5%", pad=0.05)
cbar = plt.colorbar(im, cax=cax)
cbar.set_label('flux', size=size)
plt.tight_layout()
plt.savefig('hubble_point.pdf')
plt.figure()
plt.imshow(data, norm=LogNorm(vmin=vmin, vmax=vmax))
cbar = plt.colorbar()
cbar.set_label('flux', size=size)
plt.title('data', size=size)
plt.axis('off')
ax = plt.gca()
im = ax.imshow(data, norm=LogNorm(vmin=vmin, vmax=vmax))
divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="5%", pad=0.05)
cbar = plt.colorbar(im, cax=cax)
cbar.set_label('flux', size=size)
plt.tight_layout()
plt.savefig('hubble_data.pdf')
plt.close()
plt.figure()
fig, ax = plt.subplots(1, 3, figsize=(6, 4))
plt.suptitle('zoomed in section', size=size)
# fig.tight_layout()
vmin = data.min() + 0.0001
vmax = 0.001*data.max()
im = ax[0].imshow(data[600:700,650:750],norm=LogNorm(vmin=vmin, vmax=vmax))
ax[0].set_title('data',size = 15)
ax[0].axis('off')
ax[1].imshow(exp(myEnergy.s).val[600:700, 650:750],norm=LogNorm(vmin=vmin, vmax=vmax))
ax[1].set_title('diffuse',size = 15)
ax[1].axis('off')
ax[2].imshow(exp(myEnergy.u).val[600:700, 650:750],norm=LogNorm(vmin=vmin, vmax=vmax))
ax[2].set_title('point-like',size = 15)
ax[2].axis('off')
# cax = fig.add_axes([0., 0.9, 0.03, 0.8])
cb = fig.colorbar(im, ax=ax.ravel().tolist(), orientation='horizontal', pad = 0.01)
cb.set_label('flux', size = 15)
fig.subplots_adjust(left=None, bottom=None, right=None, top=None,
wspace=0.01, hspace=None)
plt.savefig('hubble_zoom.pdf')
fig = plt.figure()
grid = AxesGrid(fig, 111, # similar to subplot(142)
nrows_ncols=(1, 3),
axes_pad=0.1,
share_all=True,
label_mode="1",
cbar_location="bottom",
cbar_mode="single",
cbar_pad=0.1
)
im = grid[0].imshow(data[600:700,650:750],norm=LogNorm(vmin=vmin, vmax=vmax))#, extent=extent, interpolation="not")
im = grid[1].imshow(exp(myEnergy.s).val[600:700, 650:750],norm=LogNorm(vmin=vmin, vmax=vmax))#, extent=extent, interpolation="not")
im = grid[2].imshow(exp(myEnergy.u).val[600:700, 650:750],norm=LogNorm(vmin=vmin, vmax=vmax))#, extent=extent, interpolation="not")
grid[0].axis('off')
grid[1].axis('off')
grid[2].axis('off')
grid[0].set_label('data')
#plt.colorbar(im, cax = grid.cbar_axes[0])
cb = grid.cbar_axes[0].colorbar(im)
for cax in grid.cbar_axes:
cax.toggle_label(True)
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