예제 #1
0
mpl.rcParams['xtick.labelsize'] = 10
mpl.rcParams['ytick.labelsize'] = 10 
mpl.rcParams['font.family'] = 'serif'
mpl.rcParams['font.serif'] = 'Times New Roman'

if __name__ == '__main__':
    import h5py
    from CALIFAUtils.scripts import get_h5_data_masked
    baseCode = 'Bzca6e'
    #baseCode = 'Bgsd6e'
    
    h5 = h5py.File('/Users/lacerda/dev/astro/SFRRadialProfiles/SFRSDRadialProfiles_minpopx0.05_%s.h5' % baseCode)
    
    N_T = h5['HEADER/N_T'].value.astype(np.int)
    tSF__T = h5['HEADER/tSF__T'].value.astype(np.float_)
    SFR__Tg = [ get_h5_data_masked(h5, 'SFR__Tg/%d'%iT, **dict(dtype = np.float_)) for iT in xrange(N_T) ]
    SFRSD__Tg = [ get_h5_data_masked(h5, 'SFRSD__Tg/%d'%iT, **dict(dtype = np.float_)) for iT in xrange(N_T) ]
    SFR_Ha__Tg = [ get_h5_data_masked(h5, 'SFR_Ha__Tg/%d'%iT, **dict(dtype = np.float_)) for iT in xrange(N_T) ]
    SFRSD_Ha__Tg = [ get_h5_data_masked(h5, 'SFRSD_Ha__Tg/%d'%iT, **dict(dtype = np.float_)) for iT in xrange(N_T) ]
    
    f = plt.figure()
    page_size_inches = [10, 8]
    f.set_size_inches(page_size_inches)
    f.suptitle(r'%s  %d gals  minpopx 5%%' % (baseCode, h5['HEADER/N_gals'].value.astype(np.int)))
    default_sc_kwargs = dict(marker = 'o', s = 10, alpha = 0.8, edgecolor = 'none', label = '')
    default_ols_plot_kwargs = dict(c = 'r', ls = '--', lw = 2, label = 'OLS')
    default_ols_kwargs = dict(c = 'r', pos_x = 0.98, pos_y = 0.01, fs = 12, rms = True, text = True, kwargs_plot = default_ols_plot_kwargs)

    grid_shape = (2, 2)
    xlabel = r'$\log\ SFR^\star(t_\star)\ [M_\odot yr^{-1}]$'
    ylabel = r'$\log\ SFR^{neb}\ [M_\odot yr^{-1}]$'
예제 #2
0
from matplotlib import pyplot as plt
from CALIFAUtils.scripts import get_h5_data_masked
from CALIFAUtils.plots import plotOLSbisectorAxis

mpl.rcParams['font.size'] = 12
mpl.rcParams['axes.labelsize'] = 10
mpl.rcParams['axes.titlesize'] = 12
mpl.rcParams['xtick.labelsize'] = 10
mpl.rcParams['ytick.labelsize'] = 10
mpl.rcParams['font.family'] = 'serif'
mpl.rcParams['font.serif'] = 'Times New Roman'

h5file = sys.argv[1]
h5 = h5py.File(h5file, 'r')

SFR_int = get_h5_data_masked(h5, 'SFR_int__Tg', **dict(dtype = np.float_))
SFR_Ha_int = get_h5_data_masked(h5, 'SFR_Ha_int__Tg', **dict(dtype = np.float_))
SFR_Ha_int_masked = get_h5_data_masked(h5, 'SFR_Ha_int_masked__Tg', **dict(dtype = np.float_))
O3N2_int_masked = get_h5_data_masked(h5, 'O3N2M13_int_masked__Tg', **dict(dtype = np.float_))
O3N2_int = np.array(h5['data/O3N2M13_int__g'].value, dtype = np.float_)
O3N2_int = np.ma.masked_array(O3N2_int, mask = np.isnan(O3N2_int))

sc_kwargs = dict(marker = 'o', s = 50, edgecolor = 'none', label = '')
kwargs_ols_plot = dict(c = 'r', ls = '--', lw = 2, label = 'OLS')
kwargs_ols = dict(c = 'k', pos_x = 0.98, pos_y = 0.01, fs = 12, rms = True, text = True, kwargs_plot = kwargs_ols_plot)

f = plt.figure()
grid_shape = (1, 2)
ax1 = plt.subplot2grid(grid_shape, loc = (0, 0))
ax2 = plt.subplot2grid(grid_shape, loc = (0, 1))
xm1, ym1 = C.ma_mask_xyz(x = O3N2_int, y = np.ma.log10(SFR_int[1]) - np.ma.log10(SFR_Ha_int[1]))
예제 #3
0
    try:
        h5file = sys.argv[1]
    except IndexError:
        print 'usage: %s HDF5FILE' % (sys.argv[0])
        exit(1)
    
    h5 = h5py.File(h5file, 'r')
    
    RbinCenter__r = h5['HEADER/RbinCenter__r'].value
    rbinstep = h5['HEADER/RbinStep'].value
    tSF__T = h5[ 'HEADER/tSF__T'].value 
    NRbins = h5['HEADER/N_rbins'].value
    N_gals = h5['HEADER/N_gals']
    N_T = h5['HEADER/N_T'].value
    gals = h5['HEADER/gals'].value
    morf__g = get_h5_data_masked(h5, 'morf__g', **dict(dtype = np.float_))
    aSFRSD__Trg = get_h5_data_masked(h5, 'aSFRSD__Trg', **dict(dtype = np.float_))
    aSFRSD_Ha__Trg = get_h5_data_masked(h5, 'aSFRSD_Ha__Trg', **dict(dtype = np.float_))
    N_zones_notmasked__Tg = get_h5_data_masked(h5, 'N_zones_notmasked__Tg', **dict(dtype = np.float_))

    colortipo = ['brown', 'red', 'orange', 'green', '#00D0C9', '#0076C9', 'blue']
    Ntype = len(colortipo)
    mtypes = [ -2, -1, 0, 1, 2, 3, 4 ]
    #mtypes = [ 0, 1, 2, 3, 4, 5, 6 ]
    mtype_labels = [ 'E', 'S0', 'Sa', 'Sb', 'Sbc', 'Sc', 'Sd' ]
    halfbinstep = np.diff(mtypes)[0]/2.
    tickpos = np.linspace(mtypes[0] + halfbinstep, mtypes[-1] - halfbinstep, Ntype)
            
    aSFRSD__Ttr = np.empty((N_T, Ntype, NRbins), dtype = np.float_)
    aSFRSD_Ha__Ttr = np.empty((N_T, Ntype, NRbins), dtype = np.float_)
    nbinelem_aSFRSD__Ttr = np.empty((N_T, Ntype, NRbins), dtype = np.int_)