From 9cf5fef0f37149512f8855ec6945074bcc421d94 Mon Sep 17 00:00:00 2001 From: Takahiro Morishita Date: Tue, 22 Nov 2022 16:30:08 -0800 Subject: [PATCH] Update fitting.py --- gsf/fitting.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gsf/fitting.py b/gsf/fitting.py index 3cf6f36..1d34656 100644 --- a/gsf/fitting.py +++ b/gsf/fitting.py @@ -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'] @@ -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'] @@ -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) @@ -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.