aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/utils/units.py
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-06-23 10:25:54 +0800
committerAaron LI <aly@aaronly.me>2017-06-23 10:25:54 +0800
commit77e77c36b80be17b0abec00cd696b71922a01860 (patch)
treea04872f32dfff6ed3eaf5bac2182ce77bf96564b /fg21sim/utils/units.py
parenta5bb6d615e92d80bac82a95177238c3ebf144dc7 (diff)
downloadfg21sim-77e77c36b80be17b0abec00cd696b71922a01860.tar.bz2
utils/units.py: Add "rad2deg" and "k_B"
Diffstat (limited to 'fg21sim/utils/units.py')
-rw-r--r--fg21sim/utils/units.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/fg21sim/utils/units.py b/fg21sim/utils/units.py
index a7e4ef5..aea0f92 100644
--- a/fg21sim/utils/units.py
+++ b/fg21sim/utils/units.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2017 Weitian LI <liweitianux@live.com>
+# Copyright (c) 2017 Weitian LI <weitian@aaronly.me>
# MIT license
"""
@@ -48,6 +48,8 @@ class UnitConversions:
km2cm = au.km.to(au.cm)
# Energy
keV2erg = au.keV.to(au.erg)
+ # Angle
+ rad2deg = au.rad.to(au.deg)
class Constants:
@@ -66,6 +68,8 @@ class Constants:
G = ac.G.cgs.value # [cm^3/g/s^2]
# Electron charge
e = ac.e.gauss.value # [Fr] = [esu]
+ # Boltzmann constant
+ k_B = ac.k_B.cgs.value # [erg/K]
# Mean molecular weight
# Ref.: Ettori et al, 2013, Space Science Review, 177, 119-154, Eq.(6)