From 52e376f3682c0cca32d0fbd781980558f38f47ee Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 21 Jul 2017 23:53:44 +0800 Subject: utils/cosmology.py: Add property "baryon_fraction" XXX: assumed to be independent of redshifts! Signed-off-by: Aaron LI --- fg21sim/utils/cosmology.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- cgit v1.2.2