Commit e28c51a3 authored by Ignacio Magana's avatar Ignacio Magana 💬

Merge branch 'predefine_abs_mag_limits' into 'master'

predefine absolute magnitude limit functions

See merge request lscsoft/gwcosmo!13
parents b0554478 607101c1
Pipeline #87306 passed with stages
in 1 minute and 57 seconds
......@@ -168,6 +168,15 @@ class gwcosmoLikelihood(object):
"""
return splev(dl, self.temp, ext=3)
def Mmin_max(self,H0):
"""
Schechter function lower and upper integration limits
as a function of H0
"""
Mmin = M_Mobs(H0,-22.96)
Mmax = M_Mobs(H0,-12.96)
return Mmin, Mmax
def px_H0G(self, H0):
"""
Returns p(x|H0,G) for given values of H0.
......@@ -323,8 +332,7 @@ class gwcosmoLikelihood(object):
# Mmin and Mmax currently corresponding to 10L* and 0.001L* respectively, to correspond with MDC
# Will want to change in future.
# TODO: test how sensitive this result is to changing Mmin and Mmax.
Mmin = M_Mobs(H0[i],-22.96)
Mmax = M_Mobs(H0[i],-12.96)
Mmin, Mmax = self.Mmin_max(H0[i])
num[i] = dblquad(I,Mmin,Mmax,lambda x: 0,lambda x: z_dlH0(dl_mM(self.mth,x),H0[i],linear=self.linear),epsabs=0,epsrel=1.49e-4)[0]
den[i] = dblquad(I,Mmin,Mmax,lambda x: 0,lambda x: self.zmax,epsabs=0,epsrel=1.49e-4)[0]
......@@ -385,8 +393,7 @@ class gwcosmoLikelihood(object):
else:
return temp
Mmin = M_Mobs(H0[i],-22.96)
Mmax = M_Mobs(H0[i],-12.96)
Mmin, Mmax = self.Mmin_max(H0[i])
if allsky == True:
distnum[i] = dblquad(Inum,Mmin,Mmax,lambda x: z_dlH0(dl_mM(self.mth,x),H0[i],linear=self.linear),lambda x: self.zmax,epsabs=0,epsrel=1.49e-4)[0]
else:
......@@ -453,8 +460,7 @@ class gwcosmoLikelihood(object):
else:
return temp
Mmin = M_Mobs(H0[i],-22.96)
Mmax = M_Mobs(H0[i],-12.96)
Mmin, Mmax = self.Mmin_max(H0[i])
if allsky == True:
den[i] = dblquad(I,Mmin,Mmax,lambda x: z_dlH0(dl_mM(self.mth,x),H0[i],linear=self.linear),lambda x: self.zmax,epsabs=0,epsrel=1.49e-4)[0]
self.pDnG = den*norm
......@@ -522,9 +528,7 @@ class gwcosmoLikelihood(object):
else:
return temp
Mmin = M_Mobs(H0[i],-22.96)
Mmax = M_Mobs(H0[i],-12.96)
Mmin, Mmax = self.Mmin_max(H0[i])
den[i] = dblquad(I,Mmin,Mmax,lambda x: 0.0,lambda x: self.zmax,epsabs=0,epsrel=1.49e-4)[0]
self.pDnG = den
......
Markdown is supported
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