예제 #1
0
        f_obs_DIG__lr[k], f_obs_DIG_npts__lr[k] = K.radialProfile(
            v, R_bin__r, rad_scale=K.HLR_pix, mode='sum', return_npts=True)

    # sys.exit(1)

    N_cols = 3
    N_rows = 2
    f, axArr = plt.subplots(N_rows, N_cols, dpi=100, figsize=(15, 10))
    cmap = plt.cm.get_cmap('jet_r', 6)
    ((ax1, ax2, ax3), (ax4, ax5, ax6)) = axArr
    # AXIS 1
    img_file = '%s%s.jpg' % (img_dir, califaID)
    plot_gal_img_ax(ax1,
                    img_file,
                    califaID,
                    0.02,
                    0.98,
                    16,
                    K,
                    bins=[0.5, 1, 1.5, 2, 2.5, 3])
    # AXIS 2
    range = [-0.5, 3]
    im = ax2.imshow(np.ma.log10(
        K.zoneToYX(np.ma.masked_array(EWHa__z, mask=~sel_DIG__z),
                   extensive=False)),
                    vmin=range[0],
                    vmax=range[1],
                    **dflt_kw_imshow)
    the_divider = make_axes_locatable(ax2)
    color_axis = the_divider.append_axes('right', size='5%', pad=0)
    cb = plt.colorbar(im, cax=color_axis)
    cb.set_label(r'$\log$ W${}_{H\alpha}$')
예제 #2
0
 mask = x.mask | y.mask
 xm = np.ma.masked_array(x, mask = mask)
 ym = np.ma.masked_array(y, mask = mask)
 sc = ax.scatter(xm, ym, c = H.RbinCenter__r, cmap = 'jet_r', marker = 'o', s = 50, edgecolor = 'black', vmax = H.RbinFin, vmin = H.RbinIni)
 plotOLSbisectorAxis(ax, xm, ym, 0.98, 0.05, 23, color = 'b', rms = True)
 ax.plot(ALL_X, ALL_Y, c = 'grey', ls = '--', lw = 2)
 ##########################
 ax.set_xlim(xlim)
 ax.set_ylim(ylim)
 ax.xaxis.set_major_locator(MultipleLocator(0.5))
 ax.xaxis.set_minor_locator(MultipleLocator(0.125))
 ax.yaxis.set_major_locator(MultipleLocator(0.5))
 ax.yaxis.set_minor_locator(MultipleLocator(0.125))
 ax.grid(which = 'major')
 
 ax = plot_gal_img_ax(ax_img, '/Users/lacerda/CALIFA/images/%s.jpg' % gal, gal, 0.02, 0.98, 30)
 txt = '%s' % str(arg_sorted[i])
 plot_text_ax(ax, txt, 0.98, 0.02, 30, 'bottom', 'right', color = 'w')
 
 if i == NRows - 1 and j == 1:
     plt.setp(ax.get_xticklabels(), visible = True, rotation = 90)
     plt.setp(ax.get_yticklabels(), visible = True)
     
 if j == NCols - 1:
     if i == NRows - 1:
         i = 0
         newImage = True
         plt.subplots_adjust(wspace = 0, hspace = 0, left = 0.08, bottom = 0.05, right = 0.95, top = 0.95)
         f.savefig('%s_%s_%s_%02d.png' % (xname, yname, fname_suffix, k))
         plt.close(f)
         k += 1
예제 #3
0
    tau_V__yx = K.A_V__yx * AVtoTauV
    tau_V__r, tau_V_npts__r = K.radialProfile(prop=tau_V__yx, bin_r=R_bin__r, rad_scale=K.HLR_pix, return_npts=True)
    tau_V_me__r, tau_V_me_npts__r = K.radialProfile(prop=tau_V__yx, bin_r=R_bin__r, rad_scale=K.HLR_pix, mode='mean_exact', return_npts=True)
    fobs_norm__yx = K.zoneToYX(K.fobs_norm)
    fobs_norm_corr__yx = fobs_norm__yx * np.exp(tau_V__yx)
    aux0 = K.radialProfile(prop=fobs_norm__yx, bin_r=R_bin__r, rad_scale=K.HLR_pix, mode='sum')
    aux1 = K.radialProfile(prop=fobs_norm_corr__yx, bin_r=R_bin__r, rad_scale=K.HLR_pix, mode='sum')
    tau_V_L__r = np.log(aux1) - np.log(aux0)

    N_rows, N_cols = 1, 3
    f, axArr = plt.subplots(N_rows, N_cols)
    f.set_dpi(100)
    f.set_size_inches(15, 5)
    ax = axArr[0]
    img_file = '%s%s.jpg' % (img_dir, califaID)
    plot_gal_img_ax(ax, img_file, califaID, 0.02, 0.98, 16, K)
    ax = axArr[1]
    im = ax.imshow(tau_V__yx, **default_kwargs_imshow)
    DrawHLRCircle(ax, K)
    # print im.get_window_extent()
    print ax.__dict__.keys()
    print ax._current_image

    ax = axArr[2]

    ax.plot(R_bin_center__r, tau_V__r, ls='-', label='tau_V')
    ax.plot(R_bin_center__r, tau_V_me__r, ls='--', label='tau_V_me')
    ax.plot(R_bin_center__r, tau_V_L__r, ls=':', label='tau_V_L')
    ax.legend(loc='best')
    ax.set_xlabel('R')
    ax.set_ylabel(r'$\tau_V$')
예제 #4
0
    map__yx = np.ma.masked_all((K.N_y, K.N_x))
    map__yx[sel_DIG__yx] = 1
    map__yx[sel_COMP__yx] = 2
    map__yx[sel_HII__yx] = 3

    distance_range = [0, 3]
    N_cols = 2
    N_rows = 2
    f, axArr = plt.subplots(N_rows, N_cols, dpi=200, figsize=(15, 5))
    cmap = cmap_discrete()
    ax1, ax2, ax3 = axArr
    # AXIS 1
    plot_gal_img_ax(ax1,
                    P.get_image_file(califaID),
                    califaID,
                    0.02,
                    0.98,
                    16,
                    K,
                    bins=[0.5, 1, 1.5, 2, 2.5, 3])
    # AXIS 2
    im = ax2.imshow(map__yx, cmap=cmap, **dflt_kw_imshow)
    the_divider = make_axes_locatable(ax2)
    color_axis = the_divider.append_axes('right', size='5%', pad=0)
    cb = plt.colorbar(im, cax=color_axis, ticks=[1. + 2 / 6., 2, 3 - 2 / 6.])
    cb.set_ticklabels(['DIG', 'COMP', 'HII'])
    DrawHLRCircle(ax2, K, color='k', lw=1, bins=[0.5, 1, 1.5, 2, 2.5, 3])
    # AXIS 3
    x = K.pixelDistance__yx / K.pixelsPerHLR
    y = np.ma.log10(SB_obs__lyx['6563'] / SB_obs__lyx['4861'])
    ax3.scatter(np.ma.ravel(x),
                np.ma.ravel(y),