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)
/home/sblunt/Projects/orbitize/orbitize/example_data/GJ504.csv

The input .csv file looks like this:

[2]:
from orbitize import read_input

read_input.read_file(path_to_file)
[2]:
Table length=7
epochobjectquant1quant1_errquant2quant2_errquant12_corrquant_typeinstrument
float64int64float64float64float64float64float64bytes5bytes5
55645.9512479.016.0327.940.39nanseppadefsp
55702.8912483.08.0327.450.19nanseppadefsp
55785.01512481.033.0326.840.94nanseppadefsp
55787.93512448.024.0325.820.66nanseppadefsp
55985.1940018412483.015.0326.460.36nanseppadefsp
56029.1140032312487.08.0326.540.18nanseppadefsp
56072.3020045912499.026.0326.140.61nanseppadefsp
[3]:
%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 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(1000)

# plot the results
myResults = myDriver.sampler.results
orbit_figure = myResults.plot_orbits(
    start_mjd=myDriver.system.data_table['epoch'][0] # minimum MJD for colorbar (choose first data epoch)
)


WARNING: ErfaWarning: ERFA function "d2dtf" yielded 1 of "dubious year (Note 5)" [astropy._erfa.core]
WARNING: ErfaWarning: ERFA function "dtf2d" yielded 1 of "dubious year (Note 6)" [astropy._erfa.core]
WARNING: ErfaWarning: ERFA function "utctai" yielded 1 of "dubious year (Note 3)" [astropy._erfa.core]
WARNING: ErfaWarning: ERFA function "taiutc" yielded 1 of "dubious year (Note 4)" [astropy._erfa.core]
WARNING: ErfaWarning: ERFA function "dtf2d" yielded 8 of "dubious year (Note 6)" [astropy._erfa.core]
<Figure size 1008x432 with 0 Axes>
../_images/tutorials_Quick-Start_5_3.svg