The idea in this notebook is to fit exoplanet signals to the radial velocities of the star HD 38529. This system was observed several times and in various different instruments, which means we have plenty of data to work with. There are two confirmed exoplanets orbiting HD 38529.
The code radvel is somewhat non-Pythonic in the fact that you run it from the command line instead of using scripts -- which means that, in practice, you don't need this Jupyter notebook to run it; so you could simply run these commands in the terminal if you prefer.
In the following line, we use the cell magic command %%bash to run radvel as if we were on the terminal. The syntax of running radvel is quite simple: we use the subcommand fit to perform the RV fitting and the option -s to use a setup file, which is included in the codes folder.
This command will compute the maximum likelihood of the orbital parameters and instrumental parameters, and then produce some outputs in this "terminal" session, as well as a subfolder of our star in the notebooks folder.
In [ ]:
%%bash
radvel fit -s ../codes/HD38529.py
This output folder contains a .pkl file, which is a pickle-able binary file that is not meant to be human-readable. But we can make a plot of the best-fit solution computed by radvel.
In [ ]:
%%bash
radvel plot -t rv -s ../codes/HD38529.py
Again, because radvel works in this non-Pythonic way, the plot does not appear in the notebook. But you can check it inside the output folder. You will notice that some datasets seem to have large uncertainties; that is probably because of an overestimated jitter term.
Now that we have the maximum likelihood, we need to compute the uncertainties of the fit. This is done by running a Markov Chain Monte Carlo (MCMC) simulation.
Warning: Running a MCMC simulation requires a lot of computation time, so be prepared to wait for several minutes if you start it. Also, your computer will probably heat up, so I don't recommend running MCMC with it in your lap.
In [ ]:
%%bash
radvel mcmc -s ../codes/HD38529.py
With the uncertainties computed from the MCMC, we can plot this results along with the corner (posterior distributions of the parameters) and the trends (emcee chains).
In [ ]:
%%bash
radvel plot -t rv corner trend -s ../codes/HD38529.py
And finally, radvel can also output a PDF file containing all the results of our computations.
In [ ]:
%%bash
radvel report -s ../codes/HD38529.py