bandpass | R Documentation |
Put a spectrum through a filter response, returning either the modified spectrum or the integrated flux.
bandpass(wave, flux, filter, flux_in = 'freq', flux_out = 'freq',
detect_type = 'photon')
wave |
Observed wavelength in Angstroms by default (see wavefac). 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 flux. |
flux |
Numeric vector; flux spectral density in erg/s / cm^2 / Hz or erg/s / cm^2 / Ang units (see flux_in and flux_out and conversion in the Example). |
filter |
Two column matrix; column one must be flux in Angstroms, column two must be a filter response. These are the type returned by |
flux_in |
Character scalar; the input type of flux spectral density used. Should be either 'freq' (default, power per Hz) or 'wave' (power per Ang) |
flux_out |
Character scalar; the output type of flux spectral density desired. Should be either 'freq' (default, power per Hz) or 'wave' (power per Ang) |
detect_type |
Character scalar; the type of detector used for the photometric system. Should be either 'photon' (default) or 'energy'. See Details. |
This is a lower level function that might be useful to use directly. For most use cases a direct conversion using e.g. magABcalc
is probably more useful.
The type of detector is important to ensure the correct sort of filter operation is made to calculate the average flux at the effective wavelength.
For photon counters we must use (where R is the filter response/transmission):
F(\lambda_{eff}) = \frac{\int R(\lambda) F(\lambda) \lambda d\lambda}{\int R(\lambda) \lambda d\lambda}
For energy counters we must use:
F(\lambda_{eff}) = \frac{\int R(\lambda) F(\lambda) d\lambda}{\int R(\lambda) d\lambda}
Note the F(\lambda) \lambda d\lambda
parts can be directly replaced by F(\nu) \lambda d\nu
.
Returns the mean weighted flux across the filter.
Aaron Robotham
photom
, magABcalc
, getfilt
, SFHfunc
fluxBC03=Lum2Flux(BC03lr$Wave, BC03lr$Zspec[[5]][161,]*1e10)
#The below should give the same answers (6.515128e-28):
CGScalc(fluxBC03)
bandpass(fluxBC03[,1], (1e-10*fluxBC03[,2]*fluxBC03[,1]^2)/299792458,
filter=getfilt('r_VST'))
bandpass(fluxBC03[,1], convert_wave2freq(fluxBC03[,2], fluxBC03[,1]),
filter=getfilt('r_VST'))
bandpass(fluxBC03[,1], fluxBC03[,2], flux_in='wave', filter=getfilt('r_VST'))
#Alternatively we can output in <F_lambda> and use the pivot wavelength of r_VST
#(6312.451 Ang) to convert to <F_freq>:
bandpass(fluxBC03[,1], fluxBC03[,2], flux_in='wave', flux_out='wave',
filter=getfilt('r_VST')) * (6312.451^2)*1e-10/299792458
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.