-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import numpy as np | ||
|
||
import orbitize | ||
from orbitize import driver | ||
import multiprocessing as mp | ||
|
||
filename = "{}/GJ504.csv".format(orbitize.DATADIR) | ||
|
||
# system parameters | ||
num_secondary_bodies = 1 | ||
total_mass = 1.75 # [Msol] | ||
plx = 51.44 # [mas] | ||
mass_err = 0.05 # [Msol] | ||
plx_err = 0.12 # [mas] | ||
|
||
# MCMC parameters | ||
num_temps = 5 | ||
num_walkers = 20 | ||
num_threads = 2 # or a different number if you prefer, mp.cpu_count() for example | ||
|
||
|
||
my_driver = driver.Driver( | ||
filename, | ||
"MCMC", | ||
num_secondary_bodies, | ||
total_mass, | ||
plx, | ||
mass_err=mass_err, | ||
plx_err=plx_err, | ||
mcmc_kwargs={ | ||
"num_temps": num_temps, | ||
"num_walkers": num_walkers, | ||
"num_threads": num_threads, | ||
}, | ||
) | ||
total_orbits = 6000 # number of steps x number of walkers (at lowest temperature) | ||
burn_steps = 10 # steps to burn in per walker | ||
thin = 2 # only save every 2nd step | ||
|
||
my_driver.sampler.run_sampler(total_orbits, burn_steps=burn_steps, thin=thin) |