unyt.unit_systems module

Unit system class.

class unyt.unit_systems.UnitSystem(name, length_unit, mass_unit, time_unit, temperature_unit='K', angle_unit='rad', current_mks_unit='A', luminous_intensity_unit='cd', registry=None)[source]

Bases: object

Create a UnitSystem for facilitating conversions to a default set of units.

Parameters:
  • name (string) – The name of the unit system. Will be used as the key in the unit_system_registry dict to reference the unit system by.
  • length_unit (string) – The base length unit of this unit system.
  • mass_unit (string) – The base mass unit of this unit system.
  • time_unit (string) – The base time unit of this unit system.
  • temperature_unit (string, optional) – The base temperature unit of this unit system. Defaults to “K”.
  • angle_unit (string, optional) – The base angle unit of this unit system. Defaults to “rad”.
  • mks_system (boolean, optional) – Whether or not this unit system has SI-specific units. Default: False
  • current_mks_unit (string, optional) – The base current unit of this unit system. Defaults to “A”.
  • luminous_intensity_unit (string, optional) – The base luminous intensity unit of this unit system. Defaults to “cd”.
  • registry (yt.units.unit_registry.UnitRegistry object) – The unit registry associated with this unit system. Only useful for defining unit systems based on code units.
unyt.unit_systems.cgs_unit_system = cgs Unit System Base Units: length: cm mass: g time: s temperature: K angle: rad luminous_intensity: cd Other Units: energy: erg specific_energy: erg/g pressure: dyne/cm**2 force: dyne magnetic_field_cgs: gauss charge_cgs: esu current_cgs: statA power: erg/s

The CGS unit system

unyt.unit_systems.mks_unit_system = mks Unit System Base Units: length: m mass: kg time: s temperature: K angle: rad current_mks: A luminous_intensity: cd Other Units: energy: J specific_energy: J/kg pressure: Pa force: N magnetic_field_mks: T charge_mks: C power: W

The MKS unit system

unyt.unit_systems.imperial_unit_system = imperial Unit System Base Units: length: ft mass: lb time: s temperature: R angle: rad current_mks: A luminous_intensity: cd Other Units: force: lbf energy: ft*lbf pressure: lbf/ft**2 power: hp

The imperial unit system

unyt.unit_systems.galactic_unit_system = galactic Unit System Base Units: length: kpc mass: Msun time: Myr temperature: K angle: rad current_mks: A luminous_intensity: cd Other Units: energy: keV magnetic_field_cgs: uG

The galactic unit system

unyt.unit_systems.solar_unit_system = solar Unit System Base Units: length: AU mass: Mearth time: yr temperature: K angle: rad current_mks: A luminous_intensity: cd Other Units:

The solar unit system

unyt.unit_systems.geometrized_unit_system = geometrized Unit System Base Units: length: l_geom mass: m_geom time: t_geom temperature: K angle: rad current_mks: A luminous_intensity: cd Other Units:

Geometrized unit system

unyt.unit_systems.planck_unit_system = planck Unit System Base Units: length: l_pl mass: m_pl time: t_pl temperature: T_pl angle: rad current_mks: A luminous_intensity: cd Other Units: energy: E_pl charge_mks: q_pl

Planck unit system