| Home | Trees | Indices | Help |
|---|
48.599934377717773
'cosmolopy'
Convert between frequency and wavelength, nu to lambda or lambda to nu.
lambda returns 'nu' or
given nu returns lambda.Hz for nu and Ang for lambda.Works because nu = c/lambda and lambda = c/nu, and I use c
in units of Angs/s.
>>> from cosmolopy import magnitudes >>> nu = magnitudes.nu_lambda(1216.) >>> lam = magnitudes.nu_lambda(nu) >>> lam 1216.0
Convert f_nu to f_lambda or f_lambda to f_nu.
f_lambda and lambda returns f_nu and 'nu' or
given f_nu and nu returns f_lambda and lambda.erg s^-1 cm^-2 Hz^-1 for f_nu and
erg s^-1 cm^-2 Ang^-1 for f_lambda.Works because f_nu = f_lambda * lambda**2/c and f_lambda = f_nu
* nu**2/c, and I use c in units of Angs/s.
>>> from cosmolopy import magnitudes >>> fnu, nu = magnitudes.f_nu_lambda(2.0, 1216.) >>> flam, lam = magnitudes.f_nu_lambda(fnu, nu) >>> flam, lam (2.0, 1216.0)
Convert apparent magnitude into flux (erg s^-1 cm^-2 Hz^-1).
Check that the AB magnitude zero point is 3631 Jy:
>>> from cosmolopy import magnitudes >>> "%.4g" % (magnitudes.f_nu_from_magAB(0.0)/1e-23) '3631'
Convert absolute magnitude into luminosity (erg s^-1 Hz^-1).
Check that the AB magnitude zero point is 3631 Jy:
>>> from cosmolopy import magnitudes >>> import math >>> L_nu = magnitudes.L_nu_from_magAB(0.0) >>> "%.4g" % (L_nu/(1e-23 * 4. * math.pi * (10*cc.pc_cm)**2)) '3631'
Convert luminosity (erg s^-1 Hz^-1) into absolute magnitude.
Check that the AB magnitude zero point is 3631 Jy:
>>> import numpy, math >>> from cosmolopy import magnitudes, cc >>> L_nu = 3631e-23 * (4. * math.pi * (10*cc.pc_cm)**2) >>> "%.3f" % numpy.abs(magnitudes.magnitude_AB_from_L_nu(L_nu)) '0.000'
Distance modulus mu = m-M.
The distance modulus is the difference between the apparent and absolute magnitudes,
mu = 5 log(d/10 pc)
>>> from cosmolopy import fidcosmo, magnitudes >>> "mu(z=6) = %.4g" % magnitudes.distance_modulus(6.0, **fidcosmo) 'mu(z=6) = 48.86'
The apparent and absolute AB magnitude given a flux.
Returns ab (apparent), and AB (absolute) magnitudes.
Note that here you pass fluxes that are per unit wavelength, not per unit frequency. To get the absolute magnitude for a luminosity specified in units of erg s^-1 Ang^-1, set z=None.
Check that the AB magnitude zero point is 3631 Jy:
>>> from cosmolopy import fidcosmo, magnitudes, cc, cd >>> import numpy, math >>> L_nu = 3631e-23 * (4. * math.pi * (10*cc.pc_cm)**2) >>> nu = magnitudes.nu_lambda(1216.) >>> L_lambda, lamb = magnitudes.f_nu_lambda(L_nu, nu) >>> mAB, MAB = magnitudes.magnitude_AB(None, L_lambda, 1216., **fidcosmo) >>> "%.3f" % numpy.abs(MAB) '0.000'
Find the apparent (and absolute, which should be zero) magnitudes of a 3631 Jy source at z=6.0:
>>> from cosmolopy import fidcosmo, magnitudes, cc, cd >>> import numpy, math >>> L_nu = 3631e-23 * (4. * math.pi * (10*cc.pc_cm)**2) >>> nu = magnitudes.nu_lambda(1216.) >>> L_lambda, lamb = magnitudes.f_nu_lambda(L_nu, nu) >>> dl = cd.luminosity_distance(6.0, **fidcosmo) >>> f_lambda = L_lambda/(4. * math.pi * (dl*cc.Mpc_cm)**2 * (1. + 6.0)) >>> mAB, MAB = magnitudes.magnitude_AB(6.0, f_lambda, 7.*1216., **fidcosmo) >>> "%.3f, %.3f" % (mAB, MAB) '48.865, 0.000'
Extrapolate to the AB magnitude at 1450 Angstroms.
Apparent and absolute magnitudes extrapolated to 1450 Angstroms.
Follows Fan et al. 2003:
We extrapolate the continuum to rest-frame 1450A, assuming a continuum shape f_nu ~ nu^-0.5 to calculate AB_1450.
Find the apparent and absolute rest-frame 1450 Angstrom magnitudes of source with a flux of 3631 Jy at rest-frame 1216 Angstroms at z=6.0:
>>> from cosmolopy import fidcosmo, magnitudes, cc, cd >>> import numpy, math >>> L_nu = 3631e-23 * (4. * math.pi * (10*cc.pc_cm)**2) >>> nu = magnitudes.nu_lambda(1216.) >>> L_lambda, lamb = magnitudes.f_nu_lambda(L_nu, nu) >>> dl = cd.luminosity_distance(6.0, **fidcosmo) >>> f_lambda = L_lambda/(4. * math.pi * (dl*cc.Mpc_cm)**2 * (1. + 6.0)) >>> mAB, MAB = magnitudes.magnitude_AB1450(6.0, f_lambda, 7.*1216., ... **fidcosmo) >>> "%.3f, %.3f" % (mAB, MAB) '48.769, -0.096'
And is that offset from an absolute magnitude of zero consisten with our assumed powerlaw index?
>>> "%.3f" %(-2.5 * numpy.log10((1216./1450)**0.5)) '0.096'
| Home | Trees | Indices | Help |
|---|