.. galpy documentation master file, created by sphinx-quickstart on Sun Jul 11 15:58:27 2010. .. ifconfig:: not_on_rtd .. WARNING:: You are looking at the rarely updated, GitHub version of this documentation, **please go to** `galpy.readthedocs.io `_ **for the latest documentation**. Welcome to galpy's documentation ================================= `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. galpy is developed on GitHub. If you are looking to `report an issue `_, `join `_ the `galpy slack `_ community, or for information on how to `contribute to the code `_, please head over to `galpy's GitHub page `_ for more information. .. _try_galpy: Try ``galpy`` ------------- Give ``galpy`` a try in the interactive ``IPython``-like shell below! .. raw:: html

Plot the rotation curve of the Milky Way

>>> from galpy.potential import (plotRotcurve,
           MWPotential2014 as mwp14)
   >>> import matplotlib.pyplot as plt
   >>> plotRotcurve(mwp14)
   >>> plotRotcurve(mwp14[0],label='Bulge',overplot=True)
   >>> plotRotcurve(mwp14[1],label='Disk',overplot=True)
   >>> plotRotcurve(mwp14[2],label='Halo',overplot=True)
   >>> plt.legend()

or integrate the orbit of MW satellites

>>> from galpy.orbit import Orbit
   >>> from galpy.potential import MWPotential2014
   >>> import numpy
   >>> ts= numpy.linspace(0.,5.,2001)*u.Gyr
   >>> o= Orbit.from_name('MW satellite galaxies')
   >>> o.integrate(ts,MWPotential2014)
   >>> o.plot(xrange=[0.,100.],yrange=[-100.,100.])
   >>> o[o.name=='LMC'].plot(c='r',lw=5.,overplot=True)

or calculate the Sun's orbital actions, frequencies, and angles

>>> from galpy.orbit import Orbit
   >>> from galpy.potential import (
           MWPotential2014 as mwp14)
   >>> o= Orbit()
   >>> print(o.jr(pot=mwp14),o.Lz(),o.jz(pot=mwp14))
   >>> print(o.Or(pot=mwp14),o.Op(pot=mwp14),o.Oz(pot=mwp14))
   >>> print(o.wr(pot=mwp14),o.wp(pot=mwp14),o.wz(pot=mwp14))

and much more... Start your journey below


(This interactive shell runs using the pyodide Python kernel, a version of Python that runs in your browser. galpy runs in your browser at compiled-C-like speed! Please open an Issue for any problems that you find with the interactive session.)

Quick-start guide ----------------- .. toctree:: :maxdepth: 2 installation.rst whatsnew.rst getting_started.rst potential.rst orbit.rst basic_df.rst actionAngle.rst diskdf.rst streamdf.rst Library reference ----------------- .. toctree:: :maxdepth: 2 reference/orbit.rst reference/potential.rst reference/aa.rst reference/df.rst reference/util.rst Acknowledging galpy -------------------- If you use galpy in a publication, please cite the following paper * *galpy: A Python Library for Galactic Dynamics*, Jo Bovy (2015), *Astrophys. J. Supp.*, **216**, 29 (`arXiv/1412.3451 `_). and link to ``http://github.com/jobovy/galpy``. Some of the code's functionality is introduced in separate papers: * ``galpy.actionAngle.EccZmaxRperiRap`` and ``galpy.orbit.Orbit`` methods with ``analytic=True``: Fast method for computing orbital parameters from :ref:`this section `: please cite `Mackereth & Bovy (2018) `__. * ``galpy.actionAngle.actionAngleAdiabatic``: please cite `Binney (2010) `__. * ``galpy.actionAngle.actionAngleStaeckel``: please cite `Bovy & Rix (2013) `__ and `Binney (2012) `__. * ``galpy.actionAngle.actionAngleIsochroneApprox``: please cite `Bovy (2014) `__. * ``galpy.df.streamdf``: please cite `Bovy (2014) `__. * ``galpy.df.streamgapdf``: please cite `Sanders, Bovy, & Erkal (2016) `__. * ``galpy.df.streamspraydf``: please cite `Fardal et al. (2015) `__ for the method and `Qian et al. (2022) `__ for the ``galpy`` implementation * ``galpy.potential.ttensor`` and ``galpy.potential.rtide``: please cite `Webb et al. (2019a) `__. * ``galpy.potential.to_amuse``: please cite `Webb et al. (2019b) `_. Please also send me a reference to the paper or send a pull request including your paper in the list of galpy papers on this page (this page is at doc/source/index.rst). Thanks! Papers using galpy -------------------- .. raw:: html

galpy has been used in more than 200 scientific publications in the astrophysical literature. Covering topics as diverse as the properties of planetary systems around distant stars, the kinematics of pulsars and stars ejected from the Milky Way by supernova explosions, binary evolution in stellar clusters, chemo-dynamical modeling of stellar populations in the Milky Way, and the dynamics of satellites around external galaxies, galpy is widely used throughout astrophysics.

Check out the gallery below for examples:

Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search`