Units

Contents

Units#

class pyathena.Units(kind='LV', muH=1.4271, units_dict=None)[source]#

Simple class for simulation unit.

Msun, Lsun, etc.: physical constants in code unit

Parameters
  • kind (str) – “LV” for (pc, km/s) or “LT” for (pc, Myr) or “cgs” for (cm, s), or “code” for code unit. For athena++ simulations, set to “custom” and provide units_dict (<units> block in athinput file)

  • muH (float) – Mean particle mass per H. Default value is 1.4271 (TIGRESS-classic). See examples for other cases.

  • units_dict (dict) – Dictionary containing <units> block in tigris athinput file.

Returns

u – Units instance

Return type

dict

Example

Athena-TIGRESS with classic cooling

>>> u = Units(kind='LV', muH=1.4271)

Athena-TIGRESS with NCR cooling

>>> u = Units(kind='LV', muH=1.4)

TIGRIS “ism” unit system or any other custom unit system

>>> units_dict = {'units_system': 'ism',
                  'mass_cgs': 4.91615563682836e+31,
                  'length_cgs': 3.085678e+18,
                  'time_cgs': 30856780000000,
                  'mean_mass_per_hydrogen': 2.34262e-24}
>>> u = Units('custom', units_dict=units_dict)