Exemple #1
0
i_age = 170
p.plot(ssp_wave, ssp_flux[i_age], hold=False)
p.xlim(1800., 11000.)

# Pick out some wavelength range of interest:
# Nah, not worth it...
#lam_lo = 1750.
#lam_hi = 11000.
#ilam_lo = min(n.where(ssp_wave >= lam_lo)[0])
#ilam_hi = max(n.where(ssp_wave <= lam_hi)[0])

# Does a blur matrix at this stage give us something tractable?
vdisp = 225.  # (in km/s)
c_in_km_per_s = 299792.458
sigconv = ssp_wave * vdisp / c_in_km_per_s
ssp_bound = pxs.cen2bound(ssp_wave)
gblur = pxs.gauss_blur_matrix(ssp_bound, sigconv)

ssp_blur = gblur * ssp_flux[i_age]
p.plot(ssp_wave, ssp_flux[i_age], hold=False)
p.plot(ssp_wave, ssp_blur, hold=True)
p.xlim(1800., 11000.)

# Looks good.
# Now let's bin it down to the BOSS coadd resoultion
# and dial in the wavelength range we want.
sspSpline = pxs.PixelSpline(ssp_bound, ssp_blur)

ssp_coeff0 = 3.225
ssp_coeff1 = 0.0001
ssp_naxis1 = 2**13
Exemple #2
0
p.plot(ssp_wave, ssp_flux[i_age], hold=False)
p.xlim(1800.,11000.)


# Pick out some wavelength range of interest:
# Nah, not worth it...
#lam_lo = 1750.
#lam_hi = 11000.
#ilam_lo = min(n.where(ssp_wave >= lam_lo)[0])
#ilam_hi = max(n.where(ssp_wave <= lam_hi)[0])

# Does a blur matrix at this stage give us something tractable?
vdisp = 225. # (in km/s)
c_in_km_per_s = 299792.458
sigconv = ssp_wave * vdisp / c_in_km_per_s
ssp_bound = pxs.cen2bound(ssp_wave)
gblur = pxs.gauss_blur_matrix(ssp_bound, sigconv)

ssp_blur = gblur * ssp_flux[i_age]
p.plot(ssp_wave, ssp_flux[i_age], hold=False)
p.plot(ssp_wave, ssp_blur, hold=True)
p.xlim(1800.,11000.)

# Looks good.
# Now let's bin it down to the BOSS coadd resoultion
# and dial in the wavelength range we want.
sspSpline = pxs.PixelSpline(ssp_bound, ssp_blur)

ssp_coeff0 = 3.225
ssp_coeff1 = 0.0001
ssp_naxis1 = 2**13
wave = 10.**loglam

#i = -1L
#i+=1
#p.plot(wave, flux[i], hold=False)

# Choose a particular spectrum that you like, and have a look at it:
istar = 40
p.plot(wave, flux[istar], hold=False, drawstyle='steps-mid')

# Now initialize a "pixelspline" object for this spectrum.
# If the units are f-lambda, then we really should use wavelength
# and not log-wavelength as the baseline to initialize.
# First convert the log-lambda pixel-center baseline
# to a log-lambda pixel-boundary baseline:
logbound = pxs.cen2bound(loglam)
wavebound = 10.**logbound
PS = pxs.PixelSpline(wavebound, flux[istar])

# Now let's try out a few of the methods...

# First, let's do a point-evaluation of the pixel spline
# over a finely gridded baseline:
nsub = 10
nfine = npix * nsub
# (The following line ensures that the first "nsub" points in logfine
# have a mean value equal to the first single point in loglam, and so on.)
logfine = coeff0 + coeff1 * (n.arange(nfine) - 0.5 * (nsub - 1)) / float(nsub)
wavefine = 10.**logfine
fluxfine = PS.point_evaluate(wavefine)