def from_fluxd(cls, wave_or_freq, fluxd, aper, eph, Tscale=1.1,
T=None):
"""Initialize from flux density.
Assumes the small angle approximation.
Parameters
----------
wave_or_freq : `~astropy.units.Quantity`
Wavelengths or frequencies of the observation.
fluxd : `~astropy.units.Quantity`
Flux density per unit wavelength or frequency.
aper : `~astropy.units.Quantity`, `~Aperture`
Aperture of the observation as a circular radius (length
or angular units), or as an sbpy `Aperture` class.
eph : dictionary-like or `~Ephem`
Ephemerides of the comet, describing heliocentric and
geocentric distances as `~astropy.units.Quantity` via
keywords `rh` and `delta`. `rh` is not required when `aper`
is in units of length.
Tscale : float, optional
Blackbody temperature scale factor. Ignored if `T` is
provided.
T : `~astropy.units.Quantity`, optional
Use this temperature for the Planck function.
Example
-------
>>> from sbpy.activity import Efrho
>>> import astropy.units as u
>>> wave = 15.8 * u.um
>>> fluxd = 6.52 * u.mJy
>>> aper = 11.1 * u.arcsec
>>> eph = {'rh': 4.42 * u.au, 'delta': 4.01 * u.au}
>>> efrho = Efrho.from_fluxd(wave, fluxd, aper, eph=eph)
>>> efrho.cm # doctest: +FLOAT_CMP
120.00836963059808
"""
fluxd1cm = Efrho(1 * u.cm).fluxd(wave_or_freq, aper, eph=eph,
Tscale=Tscale, T=T)
fluxd1cm = fluxd1cm.to(fluxd.unit, u.spectral_density(wave_or_freq))
return Efrho((fluxd / fluxd1cm).decompose() * u.cm)
评论列表
文章目录