Example #1
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
ssp_loglam = ssp_coeff0 + ssp_coeff1 * n.arange(ssp_naxis1)
Example #2
0
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
ssp_loglam = ssp_coeff0 + ssp_coeff1 * n.arange(ssp_naxis1)
Example #3
0
# the end conditions that we could control to get the residuals
# down even further, but it's in pretty good shape.

# Last thing, out of the pixelsplines module, but not
# a method of the PixelSpline class, is the convolution
# by variable resolution.  This works analytically,
# but on pixelized data rather than on any spline
# form of data.

# Let's say we want to convolve our spectrum by something
# with a sigma that would be 1 Angstrom at 3000 Ang,
# and 1 Ang at 1.2 micron, and 2 Ang at 7500 Ang, varying
# quadratically with wavelength.

sig_conv = 1. - (wave - 3000.) * (wave - 12000.) / (4500.**2)
blurmatrix = pxs.gauss_blur_matrix(wavebound, sig_conv)

# Apply the blur matrix to our test spectrum to see what the outcome looks like:
blurflux = blurmatrix * flux[istar]
p.plot(wave, flux[istar], drawstyle='steps-mid', hold=False)
p.plot(wave, blurflux, drawstyle='steps-mid', hold=True)

# Let's make a second blur matrix, and a third that is purportedly
# the quadrature-sum of the two, and see whether the composition
# of the first two is equal to the third in its action:

sig_conv_2 = 3. - sig_conv
sig_conv_3 = n.sqrt(sig_conv**2 + sig_conv_2**2)

blurmatrix_2 = pxs.gauss_blur_matrix(wavebound, sig_conv_2)
blurmatrix_3 = pxs.gauss_blur_matrix(wavebound, sig_conv_3)