# galpy: A python LIBRARY FOR GALACTIC DYNAMICS

## Abstract

I describe the design, implementation, and usage of galpy, a python package for galactic-dynamics 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 Runge-Kutta-type and symplectic integrators. For planar orbits, integration of the phase-space volume is also possible. galpy supports the calculation of action-angle coordinates and orbital frequencies for a given phase-space point for general spherical potentials, using state-of-the-art 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 two-dimensional axisymmetric and non-axisymmetric disk DFs, a three-dimensional 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 themore »

- Authors:

- Institute for Advanced Study, Einstein Drive, Princeton, NJ 08540 (United States)

- Publication Date:

- OSTI Identifier:
- 22340088

- Resource Type:
- Journal Article

- Resource Relation:
- Journal Name: Astrophysical Journal, Supplement Series; Journal Volume: 216; Journal Issue: 2; Other Information: Country of input: International Atomic Energy Agency (IAEA)

- Country of Publication:
- United States

- Language:
- English

- Subject:
- 79 ASTROPHYSICS, COSMOLOGY AND ASTRONOMY; ANALYTIC FUNCTIONS; APPROXIMATIONS; AXIAL SYMMETRY; COMPUTER CALCULATIONS; DISTRIBUTION FUNCTIONS; DISTURBANCES; LIBRARIES; MILKY WAY; ORBITS; PHASE SPACE; SPHERICAL CONFIGURATION; STARS; THREE-DIMENSIONAL CALCULATIONS; TWO-DIMENSIONAL CALCULATIONS

### Citation Formats

```
Bovy, Jo, E-mail: bovy@ias.edu.
```*galpy: A python LIBRARY FOR GALACTIC DYNAMICS*. United States: N. p., 2015.
Web. doi:10.1088/0067-0049/216/2/29.

```
Bovy, Jo, E-mail: bovy@ias.edu.
```*galpy: A python LIBRARY FOR GALACTIC DYNAMICS*. United States. doi:10.1088/0067-0049/216/2/29.

```
Bovy, Jo, E-mail: bovy@ias.edu. Sun .
"galpy: A python LIBRARY FOR GALACTIC DYNAMICS". United States.
doi:10.1088/0067-0049/216/2/29.
```

```
@article{osti_22340088,
```

title = {galpy: A python LIBRARY FOR GALACTIC DYNAMICS},

author = {Bovy, Jo, E-mail: bovy@ias.edu},

abstractNote = {I describe the design, implementation, and usage of galpy, a python package for galactic-dynamics 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 Runge-Kutta-type and symplectic integrators. For planar orbits, integration of the phase-space volume is also possible. galpy supports the calculation of action-angle coordinates and orbital frequencies for a given phase-space point for general spherical potentials, using state-of-the-art 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 two-dimensional axisymmetric and non-axisymmetric disk DFs, a three-dimensional 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.},

doi = {10.1088/0067-0049/216/2/29},

journal = {Astrophysical Journal, Supplement Series},

number = 2,

volume = 216,

place = {United States},

year = {Sun Feb 01 00:00:00 EST 2015},

month = {Sun Feb 01 00:00:00 EST 2015}

}