Galactic Dynamics in python
galpy is a Python package for galactic dynamics. It supports orbit integration in a variety of potentials, evaluating and sampling various distribution functions, and the calculation of action-angle coordinates for all static potentials.
galpy is an astropy affiliated package and provides full support for astropy’s Quantity framework for variables with units.
Jo Bovy - bovy at astro dot utoronto dot ca
for a full list of contributors.
If you find this code useful in your research, please let me know. If
you use galpy in a publication, please cite Bovy
(2015) and link to
http://github.com/jobovy/galpy. See the acknowledgement documentation
for a more detailed guide to citing parts of the code. Thanks!
LOOKING FOR HELP?
The latest documentation can be found
here. You can also join the
galpy slack community for any questions
If you find any bug in the code, please report these using the Issue
Tracker or by joining the galpy
If you are having issues with the installation of
galpy, please first
consult the Installation
PYTHON VERSIONS AND DEPENDENCIES
galpy supports Python 3. Specifically, galpy supports Python 3.7,
3.8, 3.9, 3.10. It should also work on earlier Python 3.* versions,
but this is not extensively tested on an ongoing basis and because
galpy depends on are dropping earlier Python 3.*
galpy itself likely doesn't fully work on them. GitHub
Actions CI builds regularly check support for Python 3.10 (and of 3.7,
3.8, and 3.9 using a more limited, core set of tests) on Linux and
Windows (and 3.10 on Mac OS); Appveyor builds regularly check support
for Python 3.10 on Windows. Python 2.7 is no longer supported.
This package requires Numpy,
Matplotlib. Certain advanced
features require the GNU Scientific Library
(GSL), with action calculations
requiring version 1.14 or higher. Other optional dependencies include:
- Support for providing inputs and getting outputs as Quantities with units is provided through
- Querying SIMBAD for the coordinates of an object in the
Orbit.from_name initialization method requires
- Displaying a progress bar for certain operations (e.g., orbit integration of multiple objects at once) requires
- Plotting arbitrary functions of Orbit attributes requires
- Speeding up the evaluation of certain functions in the C code requires
- Constant-anisotropy DFs in
- Use of
Other parts of the code may require additional packages and you will be alerted by the code if they are
CONTRIBUTING TO GALPY
If you are interested in contributing to galpy's development, take a
look at this brief
on the wiki. This will hopefully help you get started!
Some further development notes can be found on the
wiki. This includes a list of
small and larger extensions of galpy that would be useful
well as a longer-term roadmap
here. Please let the main
developer know if you need any help contributing!
DISK DF CORRECTIONS
The dehnendf and shudf disk distribution functions can be corrected to
follow the desired surface-mass density and radial-velocity-dispersion
profiles more closely (see
Calculating these corrections is expensive, and a large set of
precalculated corrections can be found
[tar.gz archive]. Install these by downloading them and unpacking them
into the galpy/df/data directory before running the setup.py
curl -O https://github.s3.amazonaws.com/downloads/jobovy/galpy/galpy-dfcorrections.tar.gz
tar xvzf galpy-dfcorrections.tar.gz -C ./galpy/df/data/