DF (galpy.df)

galpy.df contains tools for dealing with distribution functions of stars in galaxies. It mainly contains a number of classes that define different types of distribution function, but galpy.df.jeans also has some tools for solving the Jeans equations for equilibrium systems.

Jeans modeling tools (galpy.df.jeans)

General instance routines for all df classes

NEW in v1.7 Spherical distribution functions

Isotropic and anisotropic distribution functions for spherical systems. Documentation of these is limited at this point, but generally, one can use them as:

from galpy import potential
from galpy.df import isotropicNFWdf
np= potential.NFWPotential(amp=1.2,a=2.3)
ndf= isotropicNFWdf(pot=np)
# sample
sam= ndf.sample(n=int(1e6))
print(numpy.std(sam[numpy.fabs(sam.r()-1.2) < 0.1].vr()))
# 0.2156787374302913
# Compute vel. dispersion
print(ndf.sigmar(1.2))
# 0.21985277878647172

or:

from galpy.df import kingdf
kdf= kingdf(M=2.3,rt=1.4,W0=3.)
sam= kdf.sample(n=int(1e6))
print(numpy.amax(sam.r()))
# 1.3883460662897116
print(numpy.std(sam[numpy.fabs(sam.r()-0.2) < 0.01].vr()))
# 1.081298923132113
print(kdf.sigmar(0.2))
# 1.0939934290993467

Various spherical DFs are explicitly implemented (e.g., Hernquist, NFW using a new approximation, King, Plummer) in isotropic and various anisotropic forms. General methods for computing isotropic, constant-beta anisotropic, and Osipkov-Merritt anisotropic for any potential/density pair are also included.

General instance routines

Sampling routines

Two-dimensional, axisymmetric disk distribution functions

Distribution function for orbits in the plane of a galactic disk.

Specific distribution functions

Two-dimensional, non-axisymmetric disk distribution functions

Distribution function for orbits in the plane of a galactic disk in non-axisymmetric potentials. These are calculated using the technique of Dehnen 2000, where the DF at the current time is obtained as the evolution of an initially-axisymmetric DF at time to in the non-axisymmetric potential until the current time.

Three-dimensional disk distribution functions

Distribution functions for orbits in galactic disks, including the vertical motion for stars reaching large heights above the plane. Currently only the quasi-isothermal DF.

Specific distribution functions

The distribution function of a gap in a tidal stream

From Sanders, Bovy, & Erkal 2015; see Modeling gaps in streams using action-angle coordinates. Implemented as a subclass of streamdf. No full implementation is available currently, but the model can be set up and sampled as in the above paper.

General instance routines

The distribution function of a tidal stream using a particle-spray technique

Model from Fardal et al. (2015) with full details of the galpy implementation given in Qian et al. (2022); see Particle-spray modeling of streams with streamspraydf.

General instance routines