Skip to content

The Tractor: measuring astronomical sources via probabilistic inference


Notifications You must be signed in to change notification settings


Repository files navigation

the Tractor

Probabilistic astronomical source detection & measurement

Build status (CircleCI) Docs Coverage codecov

authors & license

Copyright 2011-2023 Dustin Lang (Perimeter Institute) & David W. Hogg (NYU/Flatiron)

Licensed under GPLv2; see LICENSE.


First, install the code. ( or You can do this by grabbing the code and using "make", or you can install the python code directly using pip:

pip install git+

Then grab the Tractor code:

git clone
cd tractor

# OR
python3 build_ext --inplace --with-ceres --with-cython

It is possible to run directly out of the checked-out tractor directory. But if you want to install it, you can use pip, optionally with flags to enable Ceres Solver (requires the Ceres library), and Cython:

pip install -v --install-option="--with-ceres" --install-option="--with-cython" .

There is a test script that renders SDSS images:

python examples/


  • scipy
  • numpy

Other packages used in various places include:


Horribly incomplete, but online at and


We are trying to move from a "Research code that only we use" phase to "Research code that other people can use". We are happy to hear your feedback; please feel free to file Issues. And naturally we will be pleased to see pull requests!