handle_squared_flux_unit_conversions#
- jdaviz.core.unit_conversion_utils.handle_squared_flux_unit_conversions(value, original_unit=None, target_unit=None, equivalencies=None)[source]#
Handles conversions between squared flux or surface brightness units that cannot be directly converted, even with the correct equivalencies.
This function is specifically designed to address cases where squared units, such as (MJy/sr)**2 to (Jy/sr)**2, appear in contexts like variance columns of aperture photometry output tables. When additional equivalencies are required, direct conversion may fail, so this workaround. is required.
- Parameters:
- valuearray or float
The numerical values to be converted.
- original_unit
astropy.units.Unit
or str The unit of the input values before conversion.
- target_unit
astropy.units.Unit
or str The desired unit for the converted values.
- equivalencieslist of equivalencies
Unit equivalencies to apply during the conversion.
- Returns:
- converted
Quantity
The converted values, expressed in the
target_unit
.
- converted