Exemplo n.º 1
0
wave_rebin_hi = 10850.
coeff1 = rebin_dloglam
coeff0 = coeff1 * n.floor(n.log10(wave_rebin_lo) / coeff1)
naxis1 = int(n.ceil(1. + (n.log10(wave_rebin_hi) - coeff0) / coeff1))

loglam_rebin = coeff0 + coeff1 * n.arange(naxis1)
logbound_rebin = pxs.cen2bound(loglam_rebin)
wavebound_rebin = 10.**logbound_rebin

# Initialize array for rebinned blurred SSPs:
ssp_rebin = n.zeros((nsub_age, naxis1), dtype=float)

# Do the rebinning:
for i_age in xrange(nsub_age):
    print(i_age)
    pxspline = pxs.PixelSpline(ssp_wavebound,
                               rebin_blur * ssp_flam[idx[i_age]])
    ssp_rebin[i_age] = pxspline.resample(wavebound_rebin)

baselines = [n.log10(ssp_agegyr[idx])]

this_class = 'ssp_hires_galaxy'
this_version = 'v001'

infodict = {
    'par_names': n.asarray(['log10-age']),
    'par_units': n.asarray(['log10-Gyr']),
    'par_axistype': n.asarray(['regular']),
    'coeff0': coeff0,
    'coeff1': coeff1,
    'fluxunit': '10^' + str(exp_div) + ' erg/s/Ang/M_sun_init',
    'filename': 'ndArch-' + this_class + '-' + this_version + '.fits'
Exemplo n.º 2
0
coeff1 = sdss_dloglam
coeff0 = coeff1 * n.floor(n.log10(wave_sdss_lo) / coeff1)
naxis1 = int(n.ceil(1. + (n.log10(wave_sdss_hi) - coeff0) / coeff1))

loglam_sdss = coeff0 + coeff1 * n.arange(naxis1)
logbound_sdss = pxs.cen2bound(loglam_sdss)
wavebound_sdss = 10.**logbound_sdss

# Initialize array for rebinned blurred SSPs:
ssp_sdssbin = n.zeros((nsub_age, log_vnum, naxis1), dtype=float)

# Do the rebinning:
for i_age in xrange(nsub_age):
    print(i_age)
    for j_logv in xrange(log_vnum):
        pxspline = pxs.PixelSpline(ssp_wavebound, ssp_vblur[i_age,j_logv])
        ssp_sdssbin[i_age,j_logv] = pxspline.resample(wavebound_sdss)

#i = -1L

#i +=1
#p.plot(10.**loglam_sdss, ssp_sdssbin[i,0], drawstyle='steps-mid', hold=False)
#p.plot(10.**loglam_sdss, ssp_sdssbin[i,1], drawstyle='steps-mid', hold=True)
#p.plot(10.**loglam_sdss, ssp_sdssbin[i,2], drawstyle='steps-mid', hold=True)
#p.plot(10.**loglam_sdss, ssp_sdssbin[i,3], drawstyle='steps-mid', hold=True)
#p.title(str(n.log10(ssp_agegyr[idx[i]])))


# Now to get the emission-line fluxes:
emfile = 'lineratios.fits'
linedata = fits.getdata(emfile,1)
Exemplo n.º 3
0
coeff1 = sdss_dloglam
coeff0 = coeff1 * n.floor(n.log10(wave_sdss_lo) / coeff1)
naxis1 = int(n.ceil(1. + (n.log10(wave_sdss_hi) - coeff0) / coeff1))

loglam_sdss = coeff0 + coeff1 * n.arange(naxis1)
logbound_sdss = pxs.cen2bound(loglam_sdss)
wavebound_sdss = 10.**logbound_sdss

# Initialize array for rebinned blurred stars:
cap_sdssbin = n.zeros((npars, naxis1), dtype=float)

# Do the blurring and rebinning:
for i in xrange(npars):
    print(i)
    blurspec = sdss_blur * data_flat[i]
    pxspline = pxs.PixelSpline(hires_wavebound, sdss_blur * data_flat[i])
    cap_sdssbin[i] = pxspline.resample(wavebound_sdss)

#i = -1L
#
#i += 1
#p.plot(10.**loglam_sdss, cap_sdssbin[i], drawstyle='steps-mid', hold=False)

# reshape the array:
out_shape = data[..., 0].shape + (naxis1, )
cap_sdssbin.resize(out_shape)

out_infodict = copy.deepcopy(infodict)
out_infodict['version'] = infodict['version'] + '_lr'
out_infodict['filename'] = 'ndArch-' + out_infodict[
    'class'] + '-' + out_infodict['version'] + '.fits'