compose_mas_units

compose_mas_units#

compose_mas_units(quantity)[source]#

Express a quantity in the preferred MAS CGS units basis.

Calls astropy.units.UnitBase.compose() with FAVORED_UNITS as the allowed unit set. The first (simplest) composed unit that astropy returns is used.

Parameters:
quantityu.Quantity

Input quantity in any unit system.

Returns:
outu.Quantity

Equivalent quantity expressed in the MAS-preferred CGS units basis (erg, cm, s, K, Gauss, g, rad).

See also

decompose_mas_units

Decomposes to CGS base unit rather than composing.

Examples

>>> import astropy.units as u
>>> from psi_io._units import compose_mas_units, FN_P
>>> compose_mas_units(1.0 * u.Pa)
<Quantity ... erg / cm3>