Skip to content

Commit

Permalink
Update fitting.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mtakahiro committed Nov 23, 2022
1 parent ab9d84c commit 9cf5fef
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions gsf/fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,8 +929,14 @@ def fit_redshift(self, xm_tmp, fm_tmp, delzz=0.01, ezmin=0.01, zliml=0.01,
self.nmc_cz = int(self.inputs['NMCZ'])

# For z prior.
zliml = self.zmcmin
zlimu = self.zmcmax
if self.zmcmin != None:
zliml = self.zmcmin
else:
zliml = 0
if self.zmcmax != None:
zlimu = self.zmcmax
else:
zlimu = 20

# Observed data;
sn = self.dict['fy'] / self.dict['ey']
Expand Down Expand Up @@ -978,7 +984,6 @@ def fit_redshift(self, xm_tmp, fm_tmp, delzz=0.01, ezmin=0.01, zliml=0.01,
prior_s = np.exp(-0.5 * cprob_s)
prior_s /= np.sum(prior_s)
else:
#zz_prob = np.arange(0,zmax,delzz)
zz_prob = np.arange(zliml,zlimu,delzz)
if priors != None:
zprob = priors['z']
Expand All @@ -990,10 +995,7 @@ def fit_redshift(self, xm_tmp, fm_tmp, delzz=0.01, ezmin=0.01, zliml=0.01,
prior_s[con_pri] = 0
if f_norm:
prior_s /= np.sum(prior_s)
#prior_s /= np.sum(prior_s)

else:
# zz_prob = np.arange(0,zmax,delzz)
prior_s = zz_prob * 0 + 1.
prior_s /= np.sum(prior_s)

Expand Down Expand Up @@ -1069,7 +1071,6 @@ def fit_redshift(self, xm_tmp, fm_tmp, delzz=0.01, ezmin=0.01, zliml=0.01,
Czrec1 = scl_cz1[1]
Czrec2 = scl_cz2[1]
res_cz = None
#self.fitc_cz = z_cz[1]
fitc_cz = [99,99]

# If this label is being used, it means that the fit is failed.
Expand Down

0 comments on commit 9cf5fef

Please sign in to comment.