Exemplo n.º 1
0
        lgage = table['log-age']
        lgsfr = np.log10(table['SFR'])
        lgms = np.log10(table['M*_tot'])
        lgsfr_interp = np.interp(lgAges, lgage, lgsfr)
        lgms_interp = np.interp(lgAges, lgage, lgms)
        print 10**lgms_interp
        lgMs = np.append(lgMs, lgms_interp)
        lgSSFR = np.append(lgSSFR, lgsfr_interp - lgms_interp)
    lgsSFR = lgSSFR.reshape((13, 7))[None, :, :, None, None]
else:
    lgsSFR = np.log10(models.SFR.value) - 9

#==============================================================================
# Mock Observation
#==============================================================================
eazy_library = LoadEAZYFilters(
    'C:\Users\mac\Documents\Python Scripts\SPS\FILTER.RES.CANDELS')

print eazy_library.filternames

filters = FilterSet()
filters.addEAZYFilter(eazy_library, range(len(eazy_library.filternames)))
# FUV, NUV, U, B, V, R, I, J, H, K

synphot = Observe(models, filters, redshift=0.001)

mags = synphot.AB[0]
U_V = mags[2] - mags[4]
V_J = mags[4] - mags[7]
FUV_R = mags[0] - mags[5]
R_K = mags[5] - mags[9]
Exemplo n.º 2
0
#==============================================================================
# Renormalization
#==============================================================================
use_bc = False
if use_bc:
    BC03_out = asc.read('Lilly/CSP result.txt')
    lgMs = BC03_out['lgM*'].reshape((M_seed.size, Ages.size)).T
    lgSSFR = BC03_out['lgsSFR'].reshape((M_seed.size, Ages.size)).T
    Ms = 10**lgMs
    SSFR = 10**lgSSFR

#==============================================================================
# Mock Observation
#==============================================================================
eazy_library = LoadEAZYFilters('FILTER.RES.CANDELS')

print eazy_library.filternames

filters = FilterSet()
filters.addEAZYFilter(eazy_library, range(len(eazy_library.filternames)))
Names = ['FUV', 'NUV', 'U', 'B', 'V', 'R', 'I', 'J', 'H', 'K']
synphot = Observe(models, filters, redshift=0.001)

mags = synphot.AB[0]
FUV_V = mags[0] - mags[4]
NUV_V = mags[1] - mags[4]
U_V = mags[2] - mags[4]
V_J = mags[4] - mags[7]
V_K = mags[4] - mags[9]
NUV_R = mags[1] - mags[5]
Exemplo n.º 3
0
with quantity_support():
    Fix, axes = plt.subplots(SFH.size, 1, figsize=(8, 8))
    for i, tau in enumerate(SFH):
        ax = axes[i]
        for j, T in enumerate(Ages):
            key = '%s-%s' % (str(i), str(j))
            ax.semilogy(models[key].wave,
                        np.squeeze(models[key].SED),
                        label='T = {0:.1f}'.format(T))
        ax.set_ylim([1e3, 1e9])
        ax.set_xlim([0, 1e4])
        ax.legend(loc='best', ncol=2)
        ax.set_title(r'$\tau = ${0:.1f}'.format(tau), fontsize=15)
    plt.tight_layout()

eazy_library = LoadEAZYFilters('data/FILTER.RES.v8')
eazy_library.search('J')

filters = FilterSet()
filters.addEAZYFilter(eazy_library, [139, 141, 125])  # U, V, J
filters.addTophatFilter(centre=1500 * u.AA, width=150 * u.AA)  # FUV

UV = np.empty((SFH.size, Ages.size))
VJ = np.empty((SFH.size, Ages.size))

for i, tau in enumerate(SFH):
    for j, T in enumerate(Ages):
        key = '%s-%s' % (str(i), str(j))

        synphot = Observe(models[key], filters, redshift=0.)