Fixed bug in CosmoPower/ Eisenstein & Hu

This commit is contained in:
Guilhem Lavaux 2015-02-24 17:41:30 +01:00
parent b7392204ad
commit 9629b24487
5 changed files with 44 additions and 19 deletions

View file

@ -44,7 +44,7 @@ cdef extern from "cosmopower.hpp" namespace "CosmoTool":
void setFunction(CosmoFunction)
void updateCosmology()
void updatePhysicalCosmology()
void normalize(double)
void normalize(double,double)
void setNormalization(double)
double power(double)
@ -74,8 +74,11 @@ cdef class CosmologyPower:
assert self.power.OMEGA_C > 0
self.power.updateCosmology()
def setNormalization(self,A):
self.power.setNormalization(A)
def normalize(self,s8,k_max=-1):
def normalize(self,s8,k_min=-1,k_max=-1):
"""normalize(self, sigma8)
Compute the normalization of the power spectrum using sigma8.
@ -84,7 +87,7 @@ cdef class CosmologyPower:
sigma8 (float): standard deviation of density field smoothed at 8 Mpc/h
"""
self.power.SIGMA8 = s8
self.power.normalize(k_max)
self.power.normalize(k_min, k_max)
def setFunction(self,funcname):