diff options
author | Aaron LI <aly@aaronly.me> | 2017-07-21 23:53:44 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-07-21 23:53:44 +0800 |
commit | 52e376f3682c0cca32d0fbd781980558f38f47ee (patch) | |
tree | 8eda6dc0fab389a5f0d3bf5900df50e85abcbc50 /fg21sim/utils | |
parent | 0a3555701177f7cb6e802317ba67516d5d865fd5 (diff) | |
download | fg21sim-52e376f3682c0cca32d0fbd781980558f38f47ee.tar.bz2 |
utils/cosmology.py: Add property "baryon_fraction"
XXX: assumed to be independent of redshifts!
Signed-off-by: Aaron LI <aly@aaronly.me>
Diffstat (limited to 'fg21sim/utils')
-rw-r--r-- | fg21sim/utils/cosmology.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fg21sim/utils/cosmology.py b/fg21sim/utils/cosmology.py index 9da3d80..e4979b1 100644 --- a/fg21sim/utils/cosmology.py +++ b/fg21sim/utils/cosmology.py @@ -199,6 +199,15 @@ class Cosmology: """ return self.Om0 * (1+z)**3 / self.E(z)**2 + @property + def baryon_fraction(self): + """ + The cosmological mean baryon fraction (w.r.t. matter). + + XXX: assumed to be *constant* regardless of redshifts! + """ + return self.Ob0 / self.Om0 + def overdensity_virial(self, z): """ Calculate the virial overdensity, which generally used to |