From e3633289345b4fed057bdc381ab983a9dd510b2d Mon Sep 17 00:00:00 2001 From: David Kaplan Date: Fri, 17 Nov 2023 08:53:17 -0600 Subject: [PATCH] both examples mostly working; dont know where phase terms come in --- docs/examples/MCMC_walkthrough.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/docs/examples/MCMC_walkthrough.py b/docs/examples/MCMC_walkthrough.py index d54316218..16cf52ac2 100644 --- a/docs/examples/MCMC_walkthrough.py +++ b/docs/examples/MCMC_walkthrough.py @@ -118,7 +118,7 @@ ) phase = 1.0 - maxbin[0] / float(len(template)) print(f"Starting pulse likelihood: {like_start}") -print("Starting pulse phase: {phase}") +print(f"Starting pulse phase: {phase}") print("Pre-MCMC Values:") for name, val in zip(fitter.fitkeys, fitter.fitvals): print("%8s:\t%12.5g" % (name, val)) @@ -176,11 +176,6 @@ def lnprior_basic(ftr, theta): lnsum = 0.0 for val, key in zip(theta[:-1], ftr.fitkeys[:-1]): lnsum += getattr(ftr.model, key).prior_pdf(val, logpdf=True) - # print('%s:\t%f' % (key, val)) - # print('PHASE:\t%f' % theta[-1]) - # Add phase term - if theta[-1] > 1.0 or theta[-1] < 0.0: - return np.inf return lnsum @@ -199,7 +194,7 @@ def lnlikelihood_chi2(ftr, theta): # %% like_start = fitter2.lnlikelihood(fitter2, fitter2.get_parameters()) -print("Starting pulse likelihood: %f" % like_start) +print(f"Starting pulse likelihood: {like_start}") # %% fitter2.fit_toas(maxiter=nsteps2, pos=None)