decompose_mas_units

decompose_mas_units#

decompose_mas_units(quantity)[source]#

Decompose a quantity into the preferred MAS CGS base unit.

Calls astropy.units.Quantity.decompose() with FAVORED_UNITS as the allowed bases. Unlike compose_mas_units(), this always expands compound unit (e.g. Joule → erg) without attempting to find a compact composed form.

Parameters:
quantityu.Quantity

Input quantity in any unit system.

Returns:
outu.Quantity

Equivalent quantity with all units decomposed into the MAS-preferred CGS bases.

See also

compose_mas_units

Composes 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>