def test_transient_MCMC_t0_tau(self): theta = { **self.basic_theta, "transient_tstart": { "type": "unif", "lower": self.Writer.tstart, "upper": self.Writer.tend - 2 * self.Writer.Tsft, }, "transient_duration": { "type": "unif", "lower": 2 * self.Writer.Tsft, "upper": self.Writer.duration - 2 * self.Writer.Tsft, }, } self.search = pyfstat.MCMCTransientSearch( label=self.label, outdir=self.outdir, theta_prior=theta, tref=self.tref, sftfilepattern=self.Writer.sftfilepath, **self.MCMC_params, transientWindowType=self.transientWindowType, ) self.search.run(plot_walkers=False) self.search.print_summary() self._check_twoF_predicted() self._check_mcmc_quantiles(transient=True) self._test_plots()
} ntemps = 2 log10beta_min = -1 nwalkers = 100 nsteps = [100, 100] transientWindowType = "rect" mcmc = pyfstat.MCMCTransientSearch( label="transient_search", outdir=data.outdir, sftfilepattern=os.path.join(data.outdir, "*simulated_transient_signal*sft"), theta_prior=theta_prior, tref=inj["tref"], nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps, log10beta_min=log10beta_min, transientWindowType=transientWindowType, ) mcmc.run(walker_plot_args={"plot_det_stat": True, "injection_parameters": inj}) mcmc.print_summary() mcmc.plot_corner(add_prior=True, truths=inj) mcmc.plot_prior_posterior(injection_parameters=inj) # plot cumulative 2F, first building a dict as required for PredictFStat d, maxtwoF = mcmc.get_max_twoF() for key, val in mcmc.theta_prior.items(): if key not in d:
"transient_tstart": minStartTime, "transient_duration": { "type": "halfnorm", "loc": 0.001 * Tspan, "scale": 0.5 * Tspan, }, } ntemps = 2 log10beta_min = -1 nwalkers = 100 nsteps = [100, 100] mcmc = pyfstat.MCMCTransientSearch( label="transient_search", outdir="data_l", sftfilepattern="data_l/*simulated_transient_signal*sft", theta_prior=theta_prior, tref=tref, minStartTime=minStartTime, maxStartTime=maxStartTime, nsteps=nsteps, nwalkers=nwalkers, ntemps=ntemps, log10beta_min=log10beta_min, transientWindowType="rect", ) mcmc.run() mcmc.plot_corner(label_offset=0.7) mcmc.print_summary()