galpy: A python Library for Galactic Dynamics
Abstract
I describe the design, implementation, and usage of galpy, a python package for galacticdynamics calculations. At its core, galpy consists of a general framework for representing galactic potentials both in python and in C (for accelerated computations); galpy functions, objects, and methods can generally take arbitrary combinations of these as arguments. Numerical orbit integration is supported with a variety of RungeKuttatype and symplectic integrators. For planar orbits, integration of the phasespace volume is also possible. galpy supports the calculation of actionangle coordinates and orbital frequencies for a given phasespace point for general spherical potentials, using stateoftheart numerical approximations for axisymmetric potentials, and making use of a recent general approximation for any static potential. A number of different distribution functions (DFs) are also included in the current release; currently, these consist of twodimensional axisymmetric and nonaxisymmetric disk DFs, a threedimensional disk DF, and a DF framework for tidal streams. I provide several examples to illustrate the use of the code. I present a simple model for the Milky Way's gravitational potential consistent with the latest observations. I also numerically calculate the Oort functions for different tracer populations of stars and compare them to a new analytical approximation. Additionally, I characterize the response of a kinematically warm disk to an elliptical m = 2 perturbation in detail. Overall, galpy consists of about 54,000 lines, including 23,000 lines of code in the module, 11,000 lines of test code, and about 20,000 lines of documentation. The test suite covers 99.6% of the code. galpy is available at http://github.com/jobovy/galpy with extensive documentation available at http://galpy.readthedocs.org/en/latest.
 Publication:

The Astrophysical Journal Supplement Series
 Pub Date:
 February 2015
 DOI:
 10.1088/00670049/216/2/29
 arXiv:
 arXiv:1412.3451
 Bibcode:
 2015ApJS..216...29B
 Keywords:

 galaxies: general;
 galaxies: kinematics and dynamics;
 Galaxy: fundamental parameters;
 Astrophysics  Astrophysics of Galaxies;
 Astrophysics  Instrumentation and Methods for Astrophysics
 EPrint:
 ApJS, in press