decompose_mas_units#
- decompose_mas_units(quantity)[source]#
Decompose a quantity into the preferred MAS CGS base unit.
Calls
astropy.units.Quantity.decompose()withFAVORED_UNITSas the allowed bases. Unlikecompose_mas_units(), this always expands compound unit (e.g. Joule → erg) without attempting to find a compact composed form.- Parameters:
- quantity
u.Quantity Input quantity in any unit system.
- quantity
- Returns:
- out
u.Quantity Equivalent quantity with all units decomposed into the MAS-preferred CGS bases.
- out
See also
compose_mas_unitsComposes to a simpler combined CGS units where possible.
Examples
>>> import astropy.units as u >>> from psi_io._units import decompose_mas_units >>> decompose_mas_units(1.0 * u.J) <Quantity 1.e+07 erg>