Commit 92d60ada authored by Goran Jelic-Cizmek's avatar Goran Jelic-Cizmek
Browse files

Added omega_cdm along with omega_m

Hopefully everything is being changed consistently now.
parent df4665b2
......@@ -211,7 +211,24 @@ cdef class Coffe:
setattr(self, key, value[key])
# TODO how do we update the other omegas here (like omega_m)?
@property
def omega_cdm(self):
"""
Fraction of cold dark matter today.
"""
return self._parameters.Omega0_cdm
@omega_cdm.setter
def omega_cdm(self, value):
_check_parameter('omega_cdm', value, (int, float), 0, 1)
if not np.allclose(value, self.omega_cdm):
# we set the value, rebalance the Omega budget, and free memory
self._parameters.Omega0_cdm = value
self._parameters.Omega0_m = self._parameters.Omega0_cdm + self._parameters.Omega0_baryon
self._balance_content()
self._free_except_parameters()
@property
def omega_m(self):
"""
......@@ -243,6 +260,7 @@ cdef class Coffe:
if not np.allclose(value, self.omega_baryon):
# we set the value, rebalance the Omega budget, and free memory
self._parameters.Omega0_baryon = value
self._parameters.Omega0_m = self._parameters.Omega0_cdm + self._parameters.Omega0_baryon
self._balance_content()
self._free_except_parameters()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment