Fast and flexible orbit fitting
Project description
octofitterpy
octofitterpy is a python package for performing Bayesian inference against a wide variety of exoplanet / binary star data. It uses the Octofitter.jl julia package under the hood (just like eg numpy uses C).
octofitterpy can access almost all functionality of Octofitter.jl, but only a subset (relative and absolute astrometry fitting) have yet been given convenient wrappers.
The extensive Julia documentation is available here.
The examples
directory and demo notebook provide examples in Python.
Installation
In an anaconda based environment, run:
pip install -U octofitterpy
Example
import octofitterpy as octo
# See demo.ipynb for more details
astrom_like = octo.PlanetRelAstromLikelihood(
epoch = [50000,50120],
sep = [505.7,600.1],
pa = [0.0,0.4,],
σ_sep = [10,10],
σ_pa = [0.01,0.01],
cor= [0,0.2]
)
planet_b = octo.Planet(
name="b",
basis="Visual{KepOrbit}",
priors=
"""
a ~ LogUniform(0.1, 500)
e ~ Uniform(0.0, 0.99)
i ~ Sine()
ω ~ UniformCircular()
Ω ~ UniformCircular()
θ ~ UniformCircular()
tp = θ_at_epoch_to_tperi(system,b,50000) # use MJD epoch of your data here!!
""",
likelihoods=[astrom_like]
)
sys = octo.System(
name="HIP100123",
priors =
"""
M ~ truncated(Normal(1.2, 0.1), lower=0)
plx ~ truncated(Normal(50.0, 0.02), lower=0)
""",
likelihoods=[],
companions=[planet_b]
)
model = octo.LogDensityModel(sys)
chain = octo.octofit(model)
octo.octoplot(model,chain)
octo.octocorner(model,chain,small=True)
Read the paper
In addition to these documentation and tutorial pages, you can read the paper published in the Astronomical Journal (open-access).
Attribution
- If you use Octofitter in your work, please cite Thompson et al:
@article{Thompson_2023,
doi = {10.3847/1538-3881/acf5cc},
url = {https://dx.doi.org/10.3847/1538-3881/acf5cc},
year = {2023},
month = {sep},
publisher = {The American Astronomical Society},
volume = {166},
number = {4},
pages = {164},
author = {William Thompson and Jensen Lawrence and Dori Blakely and Christian Marois and Jason Wang and Mosé Giordano and Timothy Brandt and Doug Johnstone and Jean-Baptiste Ruffio and S. Mark Ammons and Katie A. Crotts and Clarissa R. Do Ó and Eileen C. Gonzales and Malena Rice},
title = {Octofitter: Fast, Flexible, and Accurate Orbit Modeling to Detect Exoplanets},
journal = {The Astronomical Journal},
}
- If you use the pairplot functionality, please cite:
@misc{Thompson2023,
author = {William Thompson},
title = {{PairPlots.jl} Beautiful and flexible visualizations of high dimensional data},
year = {2023},
howpublished = {\url{https://sefffal.github.io/PairPlots.jl/dev}},
}
-
The python wrapper octofitterpy is based on the excellent PySR by Miles Cranmer.
-
See the documentation for a list of additional papers to consider citing.
Ready?
Start by following this tutorial.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file octofitterpy-2.3.1.tar.gz
.
File metadata
- Download URL: octofitterpy-2.3.1.tar.gz
- Upload date:
- Size: 4.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3071dc2425f0de87ed272ed0d4b38189e4dc43f4270ca3002577d0f039cab3a |
|
MD5 | 094b46f58a68f35d194d8eee4fa26af8 |
|
BLAKE2b-256 | 044a4aa888b2879a377eb18240eea2899dcc99202b37bf3cf2d0f6fe375361cf |
File details
Details for the file octofitterpy-2.3.1-py3-none-any.whl
.
File metadata
- Download URL: octofitterpy-2.3.1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 325ac642520095794b77a15385c0485624f1def190c7fa9bcd906f9fdcc59b8b |
|
MD5 | bea9c0dd674d8b4aa024d46dc7ecd47c |
|
BLAKE2b-256 | 4417000fc15d96308f19097999ba8ebd2523904064b9faf1009ccd598abfbd58 |