flux_conversion#
- jdaviz.utils.flux_conversion(values, original_units, target_units, spec=None, eqv=None, slice=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
astropy.units.equivalencies, optional A list of Astropy equivalencies necessary for complex unit conversions/translations.
- slice
astropy.units.Quantity, optional The current slice of a data cube, with units. Necessary for complex unit conversions/translations that require spectral density equivalencies.
- Returns:
- resultfloat array
Flux or surface brightness values in the target units.