Example #1
0
# Load the input SFH, and set any bursts if desired (set f_burst=0
# to not add bursts)
filename = 'sfhs/ddo71.lowres.ben.v1.sfh'
f_burst, fwhm_burst, contrast = 0.5, 0.05 * 1e9, 5
sfh = load_angst_sfh(filename)
sfh['t1'] = 10.**sfh['t1']
sfh['t2'] = 10.**sfh['t2']
sfh['sfr'][0] *=  1 - (sfh['t1'][0]/sfh['t2'][0])
sfh[0]['t1'] = 0.
mtot = ((sfh['t2'] - sfh['t1']) * sfh['sfr']).sum()

# choose lookback times to generate
lookback_time = [0, 1e8]

# generate a high temporal resolution SFH, with bursts if f_burst > 0
lt, sfr, tb = bsp.burst_sfh(sfh=sfh, fwhm_burst=fwhm_burst, f_burst=f_burst, contrast=contrast)
# get the interpolation weights.  This does not have to be run in
# general (it is run interior to bursty_sps) unless you are
# debugging or for plotting purposes
aw = bsp.sfh_weights(lt, sfr, 10**sps.ssp_ages, lookback_time=lookback_time)
# get the intrinsic spectra at the lookback_times specified.
wave, spec, mstar, _ = bsp.bursty_sps(lt, sfr, sps, lookback_time=lookback_time)
# get reddened spectra, Calzetti foreground screen
wave, red_spec, _, lir = bsp.bursty_sps(lt, sfr, sps,
                                        lookback_time=lookback_time,
                                        dust_curve=attenuation.calzetti,
                                        av=1, dav=0)
# get reddened spectra, SexA differntial extinction plus SMC
dav = sexAmodel(davmax=1.0, ages=10**sps.ssp_ages)
wave, red_spec, _, lir = bsp.bursty_sps(lt, sfr, sps,
                                        lookback_time=lookback_time,
Example #2
0
# Load the input SFH, and set any bursts if desired (set f_burst=0
# to not add bursts)
filename = "sfhs/ddo71.lowres.ben.v1.sfh"
f_burst, fwhm_burst, contrast = 0.5, 0.05 * 1e9, 5
sfh = load_angst_sfh(filename)
sfh["t1"] = 10.0 ** sfh["t1"]
sfh["t2"] = 10.0 ** sfh["t2"]
sfh["sfr"][0] *= 1 - (sfh["t1"][0] / sfh["t2"][0])
sfh[0]["t1"] = 0.0
mtot = ((sfh["t2"] - sfh["t1"]) * sfh["sfr"]).sum()

# choose lookback times to generate
lookback_time = [0, 1e8]

# generate a high temporal resolution SFH, with bursts if f_burst > 0
lt, sfr, tb = bsp.burst_sfh(sfh=sfh, fwhm_burst=fwhm_burst, f_burst=f_burst, contrast=contrast)
# get the interpolation weights.  This does not have to be run in
# general (it is run interior to bursty_sps) unless you are
# debugging or for plotting purposes
aw = bsp.sfh_weights(lt, sfr, 10 ** sps.ssp_ages, lookback_time=lookback_time)
# get the intrinsic spectra at the lookback_times specified.
wave, spec, mstar, _ = bsp.bursty_sps(lt, sfr, sps, lookback_time=lookback_time)
# get reddened spectra, Calzetti foreground screen
wave, red_spec, _, lir = bsp.bursty_sps(
    lt, sfr, sps, lookback_time=lookback_time, dust_curve=attenuation.calzetti, av=1, dav=0
)
# get reddened spectra, SexA differntial extinction plus SMC
dav = sexAmodel(davmax=1.0, ages=10 ** sps.ssp_ages)
wave, red_spec, _, lir = bsp.bursty_sps(
    lt, sfr, sps, lookback_time=lookback_time, dust_curve=attenuation.smc, av=1, dav=dav
)
Example #3
0
objname = [os.path.basename(f).split('.')[0] for f in files]

pl.figure()
for i, filen in enumerate(files):
    
    av, dav = 0.1, 0.1
    #read the binned sfh, put in linear units
    sfh = utils.load_angst_sfh(filen)
    sfh['t1'] = 10.**sfh['t1']
    sfh['t2'] = 10.**sfh['t2']
    sfh['sfr'][0] *=  1 - (sfh['t1'][0]/sfh['t2'][0])
    sfh[0]['t1'] = 0.
    mtot = ((sfh['t2'] - sfh['t1']) * sfh['sfr']).sum()

    #convert into a high resolution sfh, with *no* intrabin sfr variations
    lt, sfr, fb = bsp.burst_sfh(fwhm_burst=0.05, f_burst=0., contrast=1.,
                                sfh=sfh, bin_res=20.)
    
    # Get the attenuated spectra
    #  and IR luminosities
    wave, spec, mass, lir = bsp.bursty_sps(lt, sfr, sps, lookback_time=t_lookback,
                                           av=av, dav=dav, nsplit=30)
    for j, jt in enumerate(t_lookback):
        pl.plot(wave, spec[j,:] * wave * bsp.to_cgs,
                label = '{0} @ {1}'.format(objname[i], tl[j]))
        
    # Project onto filters to get
    #   absolute magnitudes
    mags = observate.getSED(wave, spec * bsp.to_cgs, filterlist = filterlist)
    
    # Get the intrinsic spectrum and project onto filters
    wave, spec, mass, _ = bsp.bursty_sps(lt, sfr, sps, lookback_times=t_lookback,
Example #4
0
pl.figure()
for i, filen in enumerate(files):

    av, dav = 0.1, 0.1
    #read the binned sfh, put in linear units
    sfh = utils.load_angst_sfh(filen)
    sfh['t1'] = 10.**sfh['t1']
    sfh['t2'] = 10.**sfh['t2']
    sfh['sfr'][0] *= 1 - (sfh['t1'][0] / sfh['t2'][0])
    sfh[0]['t1'] = 0.
    mtot = ((sfh['t2'] - sfh['t1']) * sfh['sfr']).sum()

    #convert into a high resolution sfh, with *no* intrabin sfr variations
    lt, sfr, fb = bsp.burst_sfh(fwhm_burst=0.05,
                                f_burst=0.,
                                contrast=1.,
                                sfh=sfh,
                                bin_res=20.)

    # Get the attenuated spectra
    #  and IR luminosities
    wave, spec, mass, lir = bsp.bursty_sps(lt,
                                           sfr,
                                           sps,
                                           lookback_time=t_lookback,
                                           av=av,
                                           dav=dav,
                                           nsplit=30)
    for j, jt in enumerate(t_lookback):
        pl.plot(wave,
                spec[j, :] * wave * bsp.to_cgs,