l = l1
 while l < l2:
     if t['flag'][l] == 0:
         break
     l += 1
 else:
     print 'Only flagged stuff in the interval [%d:%d]' % (fit_l_obs[l1], fit_l_obs[l2])
     l = l1
 wl = fit_l_obs[l]
 x0 = t['x0'][l] - 1
 y0 = t['y0'][l] - 1
 bulge_im = c.bulge.f_obs[l] * flux_unit
 disk_im = c.disk.f_obs[l] * flux_unit
 total_im = c.total.f_obs[l] * flux_unit
 mask = ~np.isnan(total_im)
 pa, ba = getEllipseParams(total_im, x0, y0, mask=mask)
 bulge_r = radialProfile(bulge_im, bin_r, x0, y0, pa, ba, rad_scale=1.0)
 disk_r = radialProfile(disk_im, bin_r, x0, y0, pa, ba, rad_scale=1.0)
 total_r = radialProfile(total_im, bin_r, x0, y0, pa, ba, rad_scale=1.0, mask=mask)
 ax.plot(bin_c, np.log10(total_r), 'k', label='observed')
 ax.plot(bin_c, np.log10(disk_r + bulge_r), 'k:', label='model')
 ax.plot(bin_c, np.log10(disk_r), 'b:', label='disk model')
 ax.plot(bin_c, np.log10(bulge_r), 'r:', label='bulge model')
 ax.text(0.5, 0.85, r'$%d\ \AA$' % wl, transform=ax.transAxes)
 ax.set_ylim(-18, -15.5)
 ax.set_xlim(0, bin_c.max())
 if i == 0 and j == (N_rows - 1):
     ax.set_xlabel(r'radius $[arcsec]$')
     ax.set_ylabel(r'$\log F_\lambda\ [erg / s / cm^2 / \AA]$')
 else:
     ax.set_xticklabels([])
Exemple #2
0
    plt.colorbar()
    plt.show()


fill_flux[:, psfYrange, psfXrange] = np.ma.masked

if debug:
    plt.clf()
    plt.ioff()
    plt.imshow(fill_flux[i_plot])
    plt.colorbar()
    plt.show()

for i in xrange(fill_flux.shape[0]):
    print 'Filling %d of %d' % (i, fill_flux.shape[0])
    pa, ba = getEllipseParams(fill_flux[i], galaxycenter[galaxy][1], galaxycenter[galaxy][0])
    fill_flux[i] = fillImage(fill_flux[i], galaxycenter[galaxy][1], galaxycenter[galaxy][0], pa, ba)

psfbg = fill_flux[:, psfYrange, psfXrange]

if debug:
    plt.clf()
    plt.ioff()
    plt.imshow(fill_flux[i_plot])
    plt.colorbar()
    plt.show()
    
    plt.ioff()
    plt.clf()
    plt.imshow(psfflux[i_plot])
    plt.colorbar()