convert: Convert Flux From per Wavelength to per Frequency

convert_fluxR Documentation

Convert Flux From per Wavelength to per Frequency

Description

Conversion routines that by default transform back and forth between spectral flux specified in erg/s / cm^2 / Angstrom units and erg/s / cm^2 / Hz units. The former is the more typical way to plot spectral flux (e.g. galaxy spectra etc), whilst the latter is what is actually needed in order to compute AB magnitudes, CGS flux and Janskys.

Usage

convert_wave2freq(flux_wave, wave, wavefac = 1e-10, freqfac = 1)
convert_freq2wave(flux_freq, wave, wavefac = 1e-10, freqfac = 1)

Arguments

flux_wave

Numeric vector; flux in erg/s / cm^2 / Wavelength spectral flux density units.

flux_freq

Numeric vector; flux in erg/s / cm^2 / Frequency spectral flux density units.

wave

Numeric vector; wavelength in units of wavefac.

wavefac

Numeric scalar; specified unit type converting 1m to chosen unit. Default of 1e-10 means Angstrom, whilst 1e-9 would be nm etc.

freqfac

Numeric scalar; specified unit type converting 1Hz to chosen unit. Default of 1 means Hz.

Value

Numeric vector; the converted spectral flux.

Author(s)

Aaron Robotham

See Also

photom, magABcalc, getfilt, SFHfunc

Examples

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'))

asgr/ProSpect documentation built on Feb. 21, 2025, 1:43 a.m.