lofti_gaia is a basic orbit fitter designed to fit orbital parameters for one wide stellar binary relative to the other, when both objects are resolved in Gaia DR2. It takes as input only the Gaia EDR3 or DR2 source id of the two components, and their masses. It retrieves the relevant parameters from the Gaia archive, computes observational constraints for them, and fits orbital parameters to those measurements using a method based on Orbits for the Impatient (OFTI; Blunt et al. 2017). It assumes the two components are bound in an elliptical orbit.

Also included are some suggested basic statistics and plotting tools to examining the output from the fitter.

For questions email


  • It will give you answers, even if the two source ids you give it aren’t actually bound.

  • It will give you answers even if the two Gaia astrometric solutions are not of good quality.

Use with appropriate care and consideration of the reasonableness of your results! If you give it garbage, it will give you garbage in return!

For a detailed analysis of when using Gaia to constrain stellar binary orbits is and is not appropriate, see Pearce et al. (2020)


  • If you use this package in your work, please cite Pearce et al (2020) <…894..115P/abstract>

  • Please also cite Blunt et al (2017) <….153..229B/abstract> for the OFTI algorithm

  • If you use the plots generated by this package, please cite matplotlib as well.

User Guide:

Planned Updates:

  • New version at next Gaia data release

Change Log:

2.0.3 (09-21-2021)

  • Fixed typos in cross term

2.0.2 (09-21-2021)

  • Added ability to include proper motion in RA/Dec cross correlation term in Chi^2 calculation

2.0.1 (08-02-2021)

  • Changed name from lofti_gaiaDR2 to lofti_gaia

  • Moved Kepler’s equation solver to C for faster computation

  • Implemented OpenMPI for parallelized fitting

  • Added ability to pad proper motion errors

  • Implemented correction to proper motion for bright sources described in Cantat-Gaudin & Brandt (2021) (

1.1.2 (04-05-2021)

  • Added header to results text file for readability

1.1.1 (04-05-2021)

  • Corrected bug in writing orbit probabilities to text file

1.1.0 (01-11-2021)

  • Added ability for user to supply tables of astrometric and rv data.

  • Changed the default Gaia query to the Gaia EDR3 catalog, and also allow users to query the DR2 catalog by changing the keyword

1.0.2 (08-12-2020)

  • Changed ecc prior from np.random.uniform to np.random.random_sample to exclude 1.0 from prior

1.0.0 (07-22-2020)

  • Moved from fully functional to object oriented basic structure

0.0.3 (07-20-2019)

  • Initial release