Quick StartΒΆ

This brief tutorial goes through the most minimal code you could write to do an orbit fit with orbitize!. It uses an input .csv that was placed on your computer when you installed orbitize!. The file lives here:

[1]:
import orbitize

path_to_file = '{}/GJ504.csv'.format(orbitize.DATADIR)

print(path_to_file)
/Users/bluez3303/miniconda3/envs/python3.6/orbitize_example_data/GJ504.csv

The input .csv file looks like this:

[3]:
from orbitize import read_input

read_input.read_file(path_to_file)
[3]:
Table length=7
epochobjectquant1quant1_errquant2quant2_errquant_type
float64int64float64float64float64float64bytes5
55645.9512479.016.0327.940.39seppa
55702.8912483.08.0327.450.19seppa
55785.01512481.033.0326.840.94seppa
55787.93512448.024.0325.820.66seppa
55985.1940018412483.015.0326.460.36seppa
56029.1140032312487.08.0326.540.18seppa
56072.3020045912499.026.0326.140.61seppa
[5]:
%matplotlib inline

from orbitize import driver

myDriver = driver.Driver(
    '{}/GJ504.csv'.format(orbitize.DATADIR), # data file
    'OFTI',        # choose from: ['OFTI', 'MCMC']
    1,             # number of planets in system
    1.22,          # total system mass [M_sun]
    56.95,         # system parallax [mas]
    mass_err=0.08, # mass error [M_sun]
    plx_err=0.26   # parallax error [mas]
)
orbits = myDriver.sampler.run_sampler(10000)

# plot the results
myResults = myDriver.sampler.results
orbit_figure = myResults.plot_orbits(
    start_mjd=myDriver.sampler.epochs[0] # minimum MJD for colorbar (choose first data epoch)
)
10000/10000 orbits found
../_images/tutorials_Quick-Start_5_1.png