Beispiel #1
0
def do_it_all(outdir):
    with bz2.BZ2File('../../Kepler/chain.npy.bz2', 'r') as inp:
        chain = np.load(inp)
    tchain = ac.emcee_thinned_chain(chain)
    candidates = dp.load_candidate_properties('../../Kepler/candidates.dat.bz2')
    systems = dp.load_system_properties('../../Kepler/systems.dat.bz2')
    logpost = pos.Posterior(candidates, systems)
    eas = eta_earths(logpost, tchain)
    setup()
    paper_plots(logpost, tchain, eas, outdir)
Beispiel #2
0
    parser.add_argument('--candidates', required=True, help='candidate file')
    parser.add_argument('--systems', required=True, help='system file')

    parser.add_argument('--outdir', default='.', help='output directory')

    parser.add_argument('--threads', type=int, default=15, help='number of threads')
    parser.add_argument('--walkers', type=int, default=100, help='number of walkers')

    parser.add_argument('--nstep', type=int, default=100, help='steps between saves')
    parser.add_argument('--nthin', type=int, default=10, help='steps between stored samples')

    parser.add_argument('--fburnin', type=float, default=0.1, help='fraction of samples to discard as burnin')

    args = parser.parse_args()

    candidates = dp.load_candidate_properties(args.candidates)
    systems = dp.load_system_properties(args.systems)

    logpost = posterior.Posterior(candidates, systems)

    sampler = emcee.EnsembleSampler(args.walkers, logpost.nparams,
                                    logpost, threads=args.threads)

    with bz2.BZ2File(op.join(args.outdir, 'chain.npy.bz2'), 'r') as inp:
        chain = np.load(inp)
    with bz2.BZ2File(op.join(args.outdir, 'lnprob.npy.bz2'), 'r') as inp:
        lnprob = np.load(inp)

    sampler._chain = chain
    sampler._lnprob = lnprob