From ae1ffdaa01cf072e5e1aa69228ea7514ae8db23c Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 4 Oct 2017 12:07:15 +0800 Subject: utils/cosmology: Add scalar spectral index "ns" --- fg21sim/utils/cosmology.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'fg21sim/utils') diff --git a/fg21sim/utils/cosmology.py b/fg21sim/utils/cosmology.py index ab9637d..0ec8f8f 100644 --- a/fg21sim/utils/cosmology.py +++ b/fg21sim/utils/cosmology.py @@ -63,7 +63,9 @@ class Cosmology: Ode0 : float Density parameter of dark energy at present day sigma8 : float - Present-day rms density fluctuation on a scale of 8 h^-1 [Mpc]. + Present-day rms density fluctuation on a scale of 8 h^-1 [Mpc] + ns : float + Scalar spectral index Internal attributes ------------------- @@ -75,15 +77,15 @@ class Cosmology: # Present day (z=0) growth factor _growth_factor0 = None - def __init__(self, H0=71.0, Om0=0.27, Ob0=0.046, sigma8=0.81): - self.setup(H0=H0, Om0=Om0, Ob0=Ob0, sigma8=sigma8) + def __init__(self, H0=71.0, Om0=0.27, Ob0=0.046, sigma8=0.81, ns=0.96): + self.setup(H0=H0, Om0=Om0, Ob0=Ob0, sigma8=sigma8, ns=ns) def setup(self, **kwargs): """ Setup/update the parameters of the cosmology model. """ for key, value in kwargs.items(): - if key in ["H0", "Om0", "Ob0", "sigma8"]: + if key in ["H0", "Om0", "Ob0", "sigma8", "ns"]: setattr(self, key, value) else: raise ValueError("unknown parameter: %s" % key) -- cgit v1.2.2