Commit 26b2dae0 authored by Rachel Gray's avatar Rachel Gray
Browse files

Merge branch '1_plus_redshift_term_review' into 'master'

Adding the 1+z term

See merge request lscsoft/gwcosmo!57
parents b9c1bdbc ccc7b704
Pipeline #313452 passed with stage
in 21 seconds
......@@ -333,7 +333,7 @@ class gwcosmoLikelihood(object):
tempdist = np.zeros([len(H0),len(zsmear)])
if len(zsmear)>0:
for k in range(len(H0)):
tempdist[k,:] = self.norms[k]*self.pz_xH0(zsmear,self.temps[k])*self.ps_z(zsmear)
tempdist[k,:] = self.norms[k]*self.pz_xH0(zsmear,self.temps[k])*self.ps_z(zsmear)/(1.+zsmear)
for n in range(len(zsmear)):
if self.weighted:
if self.Kcorr == True:
......@@ -404,7 +404,7 @@ class gwcosmoLikelihood(object):
prob = self.pdet.pD_dl_eval_basic(self.cosmo.dl_zH0(zsmear[n],H0)).flatten()
else:
prob = self.pdet.pD_zH0_eval(zsmear[n],H0).flatten()
deninner += prob*weight*self.ps_z(zsmear[n])
deninner += prob*weight*self.ps_z(zsmear[n])/(1.+zsmear[n])
normdeninner = deninner/nsmear
den += normdeninner
......@@ -867,7 +867,7 @@ class gwcosmoLikelihood(object):
tempdist = np.zeros([len(H0),len(zsmear)])
if len(zsmear)>0:
for k in range(len(H0)):
tempdist[k,:] = self.norms[k]*self.pz_xH0(zsmear,self.temps[k])*self.ps_z(zsmear)
tempdist[k,:] = self.norms[k]*self.pz_xH0(zsmear,self.temps[k])*self.ps_z(zsmear)/(1.+zsmear)
# loop over random draws from galaxies
for n in range(len(zsmear)):
if self.weighted:
......@@ -885,7 +885,7 @@ class gwcosmoLikelihood(object):
prob = self.pdet.pD_dl_eval_basic(self.cosmo.dl_zH0(zsmear[n],H0)).flatten()
else:
prob = self.pdet.pD_zH0_eval(zsmear[n],H0).flatten()
deninner += prob*weight*self.ps_z(zsmear[n])
deninner += prob*weight*self.ps_z(zsmear[n])/(1.+zsmear[n])
normnuminner = numinner/nsmear
num += normnuminner
normdeninner = deninner/nsmear
......
......@@ -71,12 +71,12 @@ class posterior_samples(object):
"""
if self.posterior_samples[-3:] == 'dat':
samples = np.genfromtxt(self.posterior_samples, names=True)
#try:
# self.distance = samples['dist']
#except KeyError:
try:
self.distance = samples['dist']
except KeyError:
try:
self.distance = samples['distance']
except KeyError:
except KeyError:
print("No distance samples found.")
self.ra = samples['ra']
self.dec = samples['dec']
......
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