photom | R Documentation |
These functions can manipulate restframe spectra in useful ways, e.g. placing it at a target redshift with the correct observed luminosity and band stretching.
photom_flux(wave, flux, outtype = 'mag', filters = "all")
photom_lum(wave, lum, outtype = 'mag', filters = "all", z = 0.1, H0 = 67.8,
OmegaM = 0.308, OmegaL = 1 - OmegaM, ref, LumDist_Mpc = NULL)
Lum2Flux(wave, lum, z = 0.1, H0 = 67.8, OmegaM = 0.308, OmegaL = 1 - OmegaM,
ref, LumDist_Mpc = NULL)
Flux2Lum(wave, flux, z = 0.1, H0 = 67.8, OmegaM = 0.308, OmegaL = 1 - OmegaM,
ref, LumDist_Mpc = NULL)
Lum2FluxFactor(z = 0.1, H0 = 67.8, OmegaM = 0.308, OmegaL = 1 - OmegaM, ref,
LumDist_Mpc = NULL)
wave |
Numeric vector; the spectral wavelength in Angstroms. For convenience, if a two column matrix or data frame is supplied then the first column is taken to be wave and the second is taken to be lum. |
flux |
Numeric vector; flux density in erg/s / cm^2 / Angstrom spectral units. |
lum |
Numeric vector; the spectral luminosity in Lsol / Angstrom (BC03lr / BC03hr and EMILES format). |
outtype |
Character scalar; specifies the type of photometry computed, must be one of 'mag' / 'magAB' (for AB magnitudes, the default), 'Jansky' / 'Jy' (for Jansky fluxes) or 'CGS' (for CGS fluxes). See |
filters |
Character vector; names of filters to use. See |
z |
Numeric scalar; cosmological redshift. If z <= 0 then the source will be placed at 10 Parsecs, i.e. this is what you want if you are aiming to compute Absolute Magnitudes. |
H0 |
Numeric scalar; Hubble constant as defined at z=0 (default is H0=100 (km/s)/Mpc). |
OmegaM |
Numeric scalar; Omega Matter today (default is 0.3). |
OmegaL |
Numeric scalar; Omega Lambda today (default is for a flat Universe with OmegaL = 1-OmegaM-OmegaR = 0.7). |
ref |
The name of a reference cosmology to use, one of 137 / 737 / Planck / Planck13 / Planck15 / Planck18 / WMAP / WMAP9 / WMAP7 / WMAP5 / WMAP3 / WMAP1 / Millennium / GiggleZ. Planck = Planck18 and WMAP = WMAP9. The usage is case insensitive, so wmap9 is an allowed input. This overrides any other settings for H0, OmegaM and OmegaL. If OmegaR is missing from the reference set then it is inherited from the function input (0 by default). See |
LumDist_Mpc |
Numeric scalar; Luminosity distance computed in units of cm. Default is NULL. The luminosity distance can be supplied for repeated computations when the redshift of the object is constant. This should be supplied using the "correct" cosmology (as near as possible), i.e. using H0 ~ 70 km/s/Mpc (not 100). |
photom_lum
is a useful utility function since it fully converts between an intrinsic spectrum (e.g. of the type created when integrating a star formation history over differ stellar population models) all the way to a band-pass magnitude in AB mags (or Jy or CGS). The latter is how many surveys represent their photometry, so this is usually a sensible unit space to use for feature fitting etc. In some circumstances fluxes (CGS or Jansky type) might be more appropriate, espeically when signal to noise is low a meaurements might be negative.
photom_flux |
Numeric vector; output flux (AB mag by default). |
photom_lum |
Numeric vector; output flux (AB mag by default). |
Lum2Flux |
Numeric Matrix; first column is observed wavelength (Angstroms) and second column is observed flux (erg/s/cm^2/Angstrom). |
Flux2Lum |
Numeric Matrix; first column is observed wavelength (Angstroms) and second column is observed luminosity (Lsol / Ang). |
Lum2FluxFactor |
Numeric scalar; the scaling factor to convert between intrinsic Lsol/Angstrom and erg/s/cm^2/Angstrom. |
Aaron Robotham
Bruzual and Charlot, 2003, MNRAS, 344, 1000
SFHfunc
data('cenwave')
#Make a 10^10 solar mass SSP that is 5 Grys old and solar metallicity:
#First with BC03lr:
BC03lr$Age[161]
photoBC03=photom_lum(BC03lr$Wave, BC03lr$Zspec[[5]][161,]*1e10)
plot(cenwave[,2], photoBC03, log='x', ylim=c(26,17), xlab=BC03lr$Labels$Wavelab,
ylab='Mag', col=rev(rainbow(34, end=2/3)), pch=16)
#Next with EMILES
EMILES$Age[35]
photoEMILES=photom_lum(EMILES$Wave, EMILES$Zspec[[9]][35,]*1e10)
plot(cenwave[,2], photoEMILES, log='x', ylim=c(26,17), xlab=BC03lr$Labels$Wavelab,
ylab='Mag', col=rev(rainbow(34, end=2/3)), pch=16)
#We can show the flux directly too:
fluxBC03=Lum2Flux(BC03lr$Wave, BC03lr$Zspec[[5]][161,]*1e10)
plot(fluxBC03, log='xy', xlab=BC03lr$Labels$Wavelab, ylab='Flux / erg/s/cm^2/Angstrom',
type='l')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.