flux_conversion#
- jdaviz.utils.flux_conversion(values, original_units, target_units, spec=None, eqv=None, spectral_axis=None)[source]#
Convert flux or surface brightness values from original units to target units.
This function handles the conversion of flux or surface brightness values between different units, taking into account changes between flux and surface brightness. It supports complex conversions for Spectrum1D objects or cube image data.
- Parameters:
- valuesfloat array
Flux or surface brightness values in the original units.
- original_unitsstr
The flux or surface brightness units of the spec object or cube image.
- target_unitsstr
The units the flux or surface brightness will be converted to.
- spec
Spectrum1D
, optional The Spectrum1D object that will have converted flux or surface brightness units.
- eqvlist of Equivalencies, optional
A list of Astropy equivalencies necessary for complex unit conversions/translations.
- spectral_axis
astropy.units.Quantity
, optional Provide spectral axis associated with values array. Necessary for simple and complex unit conversions/translations that require spectral density equivalencies.
- Returns:
- resultfloat array
Flux or surface brightness values in the target units.