In [21]:
%matplotlib inline
%config InlineBackend.figure_format='retina'
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from m31hst.phatast import PhatAstTable
from palettable.cubehelix import perceptual_rainbow_16
In [22]:
ast = PhatAstTable()
xlim = (-0.5, 6.)
ylim = (26, 21.)
In [23]:
fig = plt.figure(figsize=(7, 7))
ax = fig.add_subplot(111)
hess, x_grid, y_grid = ast.completeness_hess(0, 'f475w',
('f475w', 'f814w'), 'f814w',
xlim, ylim, 0.5)
hess = np.ma.masked_invalid(hess, copy=True)
extent = [xlim[0], xlim[-1],
ylim[-1], ylim[0]]
_imshow = dict(cmap=perceptual_rainbow_16.mpl_colormap,
norm=None,
aspect='auto',
interpolation='bilinear',
extent=extent,
origin='lower',
alpha=None,
vmin=None,
vmax=None)
im = ax.imshow(hess, **_imshow)
cb = plt.colorbar(ax=ax, mappable=im)
cb.set_label('Completeness')
label = ast.fields[0]['label']
s = np.where(ast.labels == label)[0]
tt = ast.t[s]
ax.scatter(ast.t['f475w_in'] - ast.t['f814w_in'], ast.t['f475w_in'], s=1, marker='o')
ax.set_xlabel('F475W-F814W')
ax.set_ylabel('F475W')
ax.set_xlim(xlim)
ax.set_ylim(ylim)
fig.show()
In [24]:
fig = plt.figure(figsize=(7, 7))
ax = fig.add_subplot(111)
hess, x_grid, y_grid = ast.error_hess(0, 'f475w',
('f475w', 'f814w'), 'f814w',
xlim, ylim, 0.5)
hess = np.ma.masked_invalid(hess, copy=True)
extent = [xlim[0], xlim[-1],
ylim[-1], ylim[0]]
_imshow = dict(cmap=perceptual_rainbow_16.mpl_colormap,
norm=None,
aspect='auto',
interpolation='bilinear',
extent=extent,
origin='lower',
alpha=None,
vmin=None,
vmax=None)
im = ax.imshow(hess, **_imshow)
cb = plt.colorbar(ax=ax, mappable=im)
cb.set_label(r'$\sigma_\mathrm{F475W}$')
label = ast.fields[0]['label']
s = np.where(ast.labels == label)[0]
tt = ast.t[s]
ax.scatter(ast.t['f475w_in'] - ast.t['f814w_in'], ast.t['f475w_in'], s=1, marker='o')
ax.set_xlabel('F475W-F814W')
ax.set_ylabel('F475W')
ax.set_xlim(xlim)
ax.set_ylim(ylim)
fig.show()
In [ ]: