Skip to content

Commit

Permalink
Merge 5d580c2 into 950f06f
Browse files Browse the repository at this point in the history
  • Loading branch information
jobovy committed Jun 4, 2019
2 parents 950f06f + 5d580c2 commit 907211f
Show file tree
Hide file tree
Showing 81 changed files with 11,396 additions and 9,782 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ environment:
MINICONDA: C:\\Miniconda36-x64

matrix:
- TEST_FILES: "tests\\ --ignore=tests\\test_actionAngleTorus.py --ignore=tests\\test_snapshotpotential.py --ignore=tests\\test_qdf.py --ignore=tests\\test_pv2qdf.py --ignore=tests\\test_diskdf.py --ignore=tests\\test_orbit.py --ignore=tests\\test_streamdf.py --ignore=tests\\test_streamgapdf.py --ignore=tests\\test_evolveddiskdf.py --ignore=tests\\test_quantity.py --ignore=tests\\test_nemo.py --ignore=tests\\test_coords.py"
- TEST_FILES: "tests\\ --ignore=tests\\test_actionAngleTorus.py --ignore=tests\\test_snapshotpotential.py --ignore=tests\\test_qdf.py --ignore=tests\\test_pv2qdf.py --ignore=tests\\test_diskdf.py --ignore=tests\\test_orbit.py --ignore=tests\\test_orbits.py --ignore=tests\\test_streamdf.py --ignore=tests\\test_streamgapdf.py --ignore=tests\\test_evolveddiskdf.py --ignore=tests\\test_quantity.py --ignore=tests\\test_nemo.py --ignore=tests\\test_coords.py"
ADDL_CONDA_PKGS:
COMPILE_NOOPENMP:

- TEST_FILES: tests\test_orbit.py
- TEST_FILES: tests\test_orbit.py tests\test_orbits.py
ADDL_CONDA_PKGS: astropy astroquery
COMPILE_NOOPENMP: "--no-openmp"

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.o
*.so
*.pyc
*.pyd

# Packages #
############
Expand Down
21 changes: 11 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ env: #split tests
- REQUIRES_ASTROQUERY=false
- PYTHON_COVREPORTS_VERSION=3.7 # Version for which reports are uploaded
matrix:
- TEST_FILES='tests/ --ignore=tests/test_qdf.py --ignore=tests/test_pv2qdf.py --ignore=tests/test_diskdf.py --ignore=tests/test_orbit.py --ignore=tests/test_streamdf.py --ignore=tests/test_streamgapdf.py --ignore=tests/test_evolveddiskdf.py --ignore=tests/test_quantity.py --ignore=tests/test_nemo.py --ignore=tests/test_coords.py --ignore=tests/test_jeans.py' REQUIRES_PYNBODY=true
- TEST_FILES='tests/ --ignore=tests/test_qdf.py --ignore=tests/test_pv2qdf.py --ignore=tests/test_diskdf.py --ignore=tests/test_orbit.py --ignore=tests/test_streamdf.py --ignore=tests/test_streamgapdf.py --ignore=tests/test_evolveddiskdf.py --ignore=tests/test_quantity.py --ignore=tests/test_nemo.py --ignore=tests/test_coords.py --ignore=tests/test_jeans.py --ignore=tests/test_orbits.py' REQUIRES_PYNBODY=true
- TEST_FILES='tests/test_quantity.py tests/test_coords.py' REQUIRES_ASTROPY=true # needs to be separate for different config
- TEST_FILES='tests/test_orbit.py' REQUIRES_PYNBODY=true REQUIRES_ASTROPY=true REQUIRES_ASTROQUERY=true
- TEST_FILES='tests/test_orbit.py tests/test_orbits.py' REQUIRES_PYNBODY=true REQUIRES_ASTROPY=true REQUIRES_ASTROQUERY=true
- TEST_FILES='tests/test_evolveddiskdf.py tests/test_jeans.py'
- TEST_FILES='tests/test_diskdf.py'
- TEST_FILES='tests/test_qdf.py tests/test_pv2qdf.py tests/test_streamgapdf.py'
- TEST_FILES='tests/test_streamdf.py'
matrix: # only run crucial tests for python 3.6
include:
- python: "3.6"
env: TEST_FILES='tests/test_orbit.py' REQUIRES_PYNBODY=true REQUIRES_ASTROPY=true REQUIRES_ASTROQUERY=true
env: TEST_FILES='tests/test_orbit.py tests/test_orbits.py' REQUIRES_PYNBODY=true REQUIRES_ASTROPY=true REQUIRES_ASTROQUERY=true
addons:
apt:
packages:
Expand Down Expand Up @@ -75,21 +75,22 @@ install:
- if [[ $TRAVIS_PYTHON_VERSION == $PYTHON_COVREPORTS_VERSION ]]; then easy_install --upgrade coveralls; fi
- if $REQUIRES_PYNBODY; then pip install git+git://github.com/pynbody/pynbody.git; fi
# clone my version of the torus code, don't do this for one test, to make sure the code installs without the torus code
- if [[ $TEST_FILES != 'tests/test_evolveddiskdf.py' ]]; then git clone https://github.com/jobovy/Torus.git galpy/actionAngle/actionAngleTorus_c_ext/torus; fi
- if [[ $TEST_FILES != 'tests/test_evolveddiskdf.py' ]]; then cd galpy/actionAngle/actionAngleTorus_c_ext/torus; fi
- if [[ $TEST_FILES != 'tests/test_evolveddiskdf.py' ]]; then git checkout galpy; fi
- if [[ $TEST_FILES != 'tests/test_evolveddiskdf.py' ]]; then cd -; fi
- if [[ $TEST_FILES != 'tests/test_evolveddiskdf.py tests/test_jeans.py' ]]; then git clone https://github.com/jobovy/Torus.git galpy/actionAngle/actionAngleTorus_c_ext/torus; fi
- if [[ $TEST_FILES != 'tests/test_evolveddiskdf.py tests/test_jeans.py' ]]; then cd galpy/actionAngle/actionAngleTorus_c_ext/torus; fi
- if [[ $TEST_FILES != 'tests/test_evolveddiskdf.py tests/test_jeans.py' ]]; then git checkout galpy; fi
- if [[ $TEST_FILES != 'tests/test_evolveddiskdf.py tests/test_jeans.py' ]]; then cd -; fi
- if $REQUIRES_ASTROPY && [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then conda install astropy --no-deps; fi
- if $REQUIRES_ASTROPY && [[ $TRAVIS_PYTHON_VERSION != 2.7 ]]; then conda install astropy --no-deps; fi
- if $REQUIRES_ASTROQUERY; then pip install astroquery; fi
- python setup.py build_ext --coverage --single_ext --inplace
# Compile w/o OpenMP for one, to make sure that works
- if [[ $TRAVIS_PYTHON_VERSION != $PYTHON_COVREPORTS_VERSION ]] && [[ $TEST_FILES == 'tests/test_evolveddiskdf.py tests/test_jeans.py' ]]; then python setup.py build_ext --coverage --single_ext --inplace --no-openmp; else python setup.py build_ext --coverage --single_ext --inplace; fi
- python setup.py develop --single_ext
# Following tests that we can start from an incomplete configuration file
- if [[ $TEST_FILES == 'tests/test_evolveddiskdf.py' ]]; then echo -e '[normalization]' > $HOME/.galpyrc && echo -e 'ro = 8.' >> $HOME/.galpyrc && echo -e 'vo = 220.' >> $HOME/.galpyrc; fi
- if [[ $TEST_FILES == 'tests/test_evolveddiskdf.py tests/test_jeans.py' ]]; then echo -e '[normalization]' > $HOME/.galpyrc && echo -e 'ro = 8.' >> $HOME/.galpyrc && echo -e 'vo = 220.' >> $HOME/.galpyrc; fi
- if [[ $TEST_FILES == 'tests/test_diskdf.py' ]]; then echo -e '[normalization]' > $HOME/.galpyrc && echo -e 'ro = 8.' >> $HOME/.galpyrc && echo -e '[astropy]' >> $HOME/.galpyrc && echo -e 'astropy-units = False' >> $HOME/.galpyrc && echo -e '[plot]' >> $HOME/.galpyrc && echo -e 'seaborn-bovy-defaults = True' >> $HOME/.galpyrc && echo -e '[warnings]' >> $HOME/.galpyrc && echo -e 'verbose = True' >> $HOME/.galpyrc; fi
script:
# only wait longer for orbit integrations
- if [[ $TEST_FILES == 'tests/test_orbit.py' ]]; then travis_wait 40 pytest -v $TEST_FILES --cov galpy --cov-config .coveragerc_travis --disable-pytest-warnings; else pytest -v $TEST_FILES --cov galpy --cov-config .coveragerc_travis --disable-pytest-warnings; fi
- if [[ $TEST_FILES == 'tests/test_orbit.py tests/test_orbits.py' ]]; then travis_wait 40 pytest -v $TEST_FILES --cov galpy --cov-config .coveragerc_travis --disable-pytest-warnings; else pytest -v $TEST_FILES --cov galpy --cov-config .coveragerc_travis --disable-pytest-warnings; fi
after_success:
# Generate lcov output
- if [[ $TRAVIS_PYTHON_VERSION == $PYTHON_COVREPORTS_VERSION ]]; then lcov --capture --base-directory . --directory build/temp.linux-x86_64-3.7/galpy/ --no-external --output-file coverage_full.info; fi
Expand Down
5 changes: 5 additions & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
v1.5 (????-??-??)
=================

- Added support for holding multiple objects in an Orbit instance,
with efficient handling of multiple objects and parallelized
integration and action-angle-related functions. Orbit instances can
now have arbitrary shapes. Full re-write of Orbit class (PR #384).

- Added support for 1D orbit integration in C (PR #354).

- Added potential.toVerticalPotential to convert any 3D potential to a
Expand Down
57 changes: 40 additions & 17 deletions doc/source/actionAngle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ preferred method for accessing them is through the routines in this
module. There is also some support for accessing the actionAngle
routines as methods of the ``Orbit`` class.

.. TIP::
If you want to quickly and easily compute actions, angles, or frequencies using the Staeckel approximation, using the ``Orbit`` interface as described in :ref:`this section <aaorbit>` is recommended. Especially if you are starting from observed coordinates, as ``Orbit`` instances can easily be initialized using these.

Since v1.2, galpy can also compute positions and velocities
corresponding to a given set of actions and angles for axisymmetric
potentials using the TorusMapper code of `Binney & McMillan (2016)
Expand Down Expand Up @@ -830,14 +833,16 @@ action-angle API page for computing Hessians and Jacobians of the
transformation between action-angle and configuration space
coordinates.

.. _aaorbit:

Accessing action-angle coordinates for Orbit instances
----------------------------------------------------------
------------------------------------------------------

While the recommended way to access the actionAngle routines is
While the most flexible way to access the actionAngle routines is
through the methods in the ``galpy.actionAngle`` modules, action-angle
coordinates can also be calculated for ``galpy.orbit.Orbit``
instances. This is illustrated here briefly. We initialize an Orbit
instance
coordinates can also be calculated for ``galpy.orbit.Orbit`` instances
and this is often more convenient. This is illustrated here
briefly. We initialize an Orbit instance

>>> from galpy.orbit import Orbit
>>> from galpy.potential import MWPotential2014
Expand All @@ -847,52 +852,70 @@ and we can then calculate the actions (default is to use the staeckel
approximation with an automatically-estimated delta parameter, but
this can be adjusted)

>>> o.jr(MWPotential2014), o.jp(MWPotential2014), o.jz(MWPotential2014)
>>> o.jr(pot=MWPotential2014), o.jp(pot=MWPotential2014), o.jz(pot=MWPotential2014)
# (0.018194068808944613,1.1,0.01540155584446606)

``o.jp`` here gives the azimuthal action (which is the *z* component
of the angular momentum for axisymmetric potentials). We can also use
the other methods described above or adjust the parameters of the
approximation (see above):

>>> o.jr(MWPotential2014,type='staeckel',delta=0.4), o.jp(MWPotential2014,type='staeckel',delta=0.4), o.jz(MWPotential2014,type='staeckel',delta=0.4)
>>> o.jr(pot=MWPotential2014,type='staeckel',delta=0.4), o.jp(pot=MWPotential2014,type='staeckel',delta=0.4), o.jz(pot=MWPotential2014,type='staeckel',delta=0.4)
# (0.019221672966336707, 1.1, 0.015276825017286827)
>>> o.jr(MWPotential2014,type='adiabatic'), o.jp(MWPotential2014,type='adiabatic'), o.jz(MWPotential2014,type='adiabatic')
>>> o.jr(pot=MWPotential2014,type='adiabatic'), o.jp(pot=MWPotential2014,type='adiabatic'), o.jz(pot=MWPotential2014,type='adiabatic')
# (0.016856430059017123, 1.1, 0.015897730620467752)
>>> o.jr(MWPotential2014,type='isochroneApprox',b=0.8), o.jp(MWPotential2014,type='isochroneApprox',b=0.8), o.jz(MWPotential2014,type='isochroneApprox',b=0.8)
>>> o.jr(pot=MWPotential2014,type='isochroneApprox',b=0.8), o.jp(pot=MWPotential2014,type='isochroneApprox',b=0.8), o.jz(pot=MWPotential2014,type='isochroneApprox',b=0.8)
# (0.019066091295488922, 1.1, 0.015280492319332751)

These two methods give very precise actions for this orbit (both are
converged to about 1%) and they agree very well

>>> (o.jr(MWPotential2014,type='staeckel',delta=0.4)-o.jr(MWPotential2014,type='isochroneApprox',b=0.8))/o.jr(MWPotential2014,type='isochroneApprox',b=0.8)
>>> (o.jr(pot=MWPotential2014,type='staeckel',delta=0.4)-o.jr(pot=MWPotential2014,type='isochroneApprox',b=0.8))/o.jr(pot=MWPotential2014,type='isochroneApprox',b=0.8)
# 0.00816012408818143
>>> (o.jz(MWPotential2014,type='staeckel',delta=0.4)-o.jz(MWPotential2014,type='isochroneApprox',b=0.8))/o.jz(MWPotential2014,type='isochroneApprox',b=0.8)
>>> (o.jz(pot=MWPotential2014,type='staeckel',delta=0.4)-o.jz(pot=MWPotential2014,type='isochroneApprox',b=0.8))/o.jz(pot=MWPotential2014,type='isochroneApprox',b=0.8)
# 0.00023999894566772273

.. WARNING:: Once an action, frequency, or angle is calculated for a given type of calculation (e.g., staeckel), the parameters for that type are fixed in the Orbit instance. Call o.resetaA() to reset the action-angle instance used when using different parameters (i.e., different ``delta=`` for staeckel or different ``b=`` for isochroneApprox.

We can also calculate the frequencies and the angles. This requires
using the Staeckel or Isochrone approximations, because frequencies
and angles are currently not supported for the adiabatic
approximation. For example, the radial frequency

>>> o.Or(MWPotential2014,type='staeckel',delta=0.4)
>>> o.Or(pot=MWPotential2014,type='staeckel',delta=0.4)
# 1.1131779637307115
>>> o.Or(MWPotential2014,type='isochroneApprox',b=0.8)
>>> o.Or(pot=MWPotential2014,type='isochroneApprox',b=0.8)
# 1.1134635974560649

and the radial angle

>>> o.wr(MWPotential2014,type='staeckel',delta=0.4)
>>> o.wr(pot=MWPotential2014,type='staeckel',delta=0.4)
# 0.37758086786371969
>>> o.wr(MWPotential2014,type='isochroneApprox',b=0.8)
>>> o.wr(pot=MWPotential2014,type='isochroneApprox',b=0.8)
# 0.38159809018175395

which again agree to 1%. We can also calculate the other frequencies,
angles, as well as periods using the functions ``o.Op``, ``o.oz``,
``o.wp``, ``o.wz``, ``o.Tr``, ``o.Tp``, ``o.Tz``.

All of the functions above also work for ``Orbit`` instances that
contain multiple objects. This is particularly convenient if you have
data in observed coordinates (e.g., RA, Dec, etc.), for example,

>>> numpy.random.seed(1)
>>> nrand= 30
>>> ras= numpy.random.uniform(size=nrand)*360.*u.deg
>>> decs= 90.*(2.*numpy.random.uniform(size=nrand)-1.)*u.deg
>>> dists= numpy.random.uniform(size=nrand)*10.*u.kpc
>>> pmras= 2.*(2.*numpy.random.uniform(size=nrand)-1.)*u.mas/u.yr
>>> pmdecs= 2.*(2.*numpy.random.uniform(size=nrand)-1.)*u.mas/u.yr
>>> vloss= 200.*(2.*numpy.random.uniform(size=nrand)-1.)*u.km/u.s
>>> co= SkyCoord(ra=ras,dec=decs,distance=dists,
pm_ra_cosdec=pmras,pm_dec=pmdecs,
radial_velocity=vloss,
frame='icrs')
>>> orbits= Orbit(co)
>>> orbits.jr(pot=MWPotential2014)
# [2363.7957, 360.12445, 690.32238, 1046.2924, 132.9572, 86.989812, 272.06487, 360.73566, 55.568238, 698.18447, 24.783574, 21.889352, 16.148216, 3870.4286, 743.63456, 317.66551, 325.93816, 183.86429, 56.087796, 180.42838, 1121.8019, 8700.8335, 977.8525, 7.569396, 8.2847477, 210.72127, 160.9785, 680.63864, 1093.7413, 87.629873]kmkpcs

Example: Evidence for a Lindblad resonance in the Solar neighborhood
---------------------------------------------------------------------

Expand Down
8 changes: 5 additions & 3 deletions doc/source/basic_df.rst
Original file line number Diff line number Diff line change
Expand Up @@ -529,13 +529,15 @@ time-coordinates).

We initialize orbits on a grid in velocity space and integrate them

>>> ins=[[Orbit([1.,-0.7+1.4/100*jj,1.-0.6+1.2/100*ii,0.]) for jj in range(101)] for ii in range(101)]
>>> int=[[o.integrate(ts,[lp,dp]) for o in j] for j in ins]
>>> ins= Orbit(numpy.array([[[1.,-0.7+1.4/100*jj,1.-0.6+1.2/100*ii,0.] for jj in range(101)] for ii in range(101)]))
>>> ins.integrate(ts,[lp,dp])

We can then evaluate the weight of these orbits by assuming that the
disk was in a steady-state before bar-formation with a Dehnen
distribution function. We evaluate the Dehnen distribution function at
``dp.tform()`` for each of the orbits
``dp.tform()`` for each of the orbits (evaluating the distribution
function only works for an Orbit with a single object, so we need to
unpack the Orbit instance that contains all orbits)

>>> dfc= dehnendf(beta=0.,correct=True)
>>> out= [[dfc(o(dp.tform())) for o in j] for j in ins]
Expand Down
41 changes: 7 additions & 34 deletions doc/source/examples/dierickx_eccentricities.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,15 @@ def calc_eccentricity(args, options):
dierickx = ascii.read(table, readme=readme)
vxvv = np.dstack([dierickx['RAdeg'], dierickx['DEdeg'], dierickx['Dist']/1e3, dierickx['pmRA'], dierickx['pmDE'], dierickx['HRV']])[0]
ro, vo, zo = 8., 220., 0.025
ra, dec= vxvv[:,0], vxvv[:,1]
lb= bovy_coords.radec_to_lb(ra,dec,degree=True)
pmra, pmdec= vxvv[:,3], vxvv[:,4]
pmllpmbb= bovy_coords.pmrapmdec_to_pmllpmbb(pmra,pmdec,ra,dec,degree=True)
d, vlos= vxvv[:,2], vxvv[:,5]
rectgal= bovy_coords.sphergal_to_rectgal(lb[:,0],lb[:,1],d,vlos,pmllpmbb[:,0], pmllpmbb[:,1],degree=True)
vsolar= np.array([-10.1,4.0,6.7])
vsun= np.array([0.,1.,0.,])+vsolar/vo
X = rectgal[:,0]/ro
Y = rectgal[:,1]/ro
Z = rectgal[:,2]/ro
vx = rectgal[:,3]/vo
vy = rectgal[:,4]/vo
vz = rectgal[:,5]/vo
vsun= np.array([0.,1.,0.,])+vsolar/vo
Rphiz= bovy_coords.XYZ_to_galcencyl(X,Y,Z,Zsun=zo/ro)
vRvTvz= bovy_coords.vxvyvz_to_galcencyl(vx,vy,vz,Rphiz[:,0],Rphiz[:,1],Rphiz[:,2],vsun=vsun,Xsun=1.,Zsun=zo/ro,galcen=True)
orbits= Orbit(vxvv,radec=True,ro=ro,vo=vo,zo=zo,solarmotion='hogg')
#do the integration and individual analytic estimate for each object
ts= np.linspace(0.,20.,10000)
lp= LogarithmicHaloPotential(normalize=1.)
e_ana = numpy.zeros(len(vxvv))
e_int = numpy.zeros(len(vxvv))
print('Performing orbit integration and analytic parameter estimates for Dierickx et al. sample...')
for i in tqdm(range(len(vxvv))):
try:
orbit = Orbit(vxvv[i], radec=True, vo=220., ro=8.)
e_ana[i] = orbit.e(analytic=True, pot=lp, c=True)
except UnboundError:
e_ana[i] = np.nan
orbit.integrate(ts, lp)
e_int[i] = orbit.e(analytic=False)
e_ana= orbits.e(analytic=True,pot=lp,delta=1e-6)
ts= np.linspace(0.,20.,10000)
orbits.integrate(ts,lp)
e_int= orbits.e()
# Now plot everything
fig = plt.figure()
fig.set_size_inches(1.5*columnwidth, 1.5*columnwidth)
plt.scatter(e_int, e_ana, s=1, color='Black', lw=0.)
plt.xlabel(r'$\mathrm{galpy\ integrated}\ e$')
plt.ylabel(r'$\mathrm{galpy\ analytic}\ e$')
Expand All @@ -67,14 +43,12 @@ def calc_eccentricity(args, options):
fig.tight_layout()
plt.savefig(os.path.join(args[0],'dierickx-integratedeanalytice.png'), format='png', dpi=200)
fig = plt.figure()
fig.set_size_inches(1.5*columnwidth, 1.5*columnwidth)
plt.hist(e_int, bins=30)
plt.xlim(0.,1.)
plt.xlabel(r'$\mathrm{galpy}\ e$')
fig.tight_layout()
plt.savefig(os.path.join(args[0], 'dierickx-integratedehist.png'), format='png', dpi=200)
fig = plt.figure()
fig.set_size_inches(1.5*columnwidth, 1.5*columnwidth)
plt.scatter(dierickx['e'], e_int, s=1, color='Black', lw=0.)
plt.xlabel(r'$\mathrm{Dierickx\ et\ al.}\ e$')
plt.ylabel(r'$\mathrm{galpy\ integrated}\ e$')
Expand All @@ -83,7 +57,6 @@ def calc_eccentricity(args, options):
fig.tight_layout()
plt.savefig(os.path.join(args[0],'dierickx-integratedee.png'), format='png', dpi=200)
fig = plt.figure()
fig.set_size_inches(1.5*columnwidth, 1.5*columnwidth)
plt.scatter(dierickx['e'], e_ana, s=1, color='Black', lw=0.)
plt.xlabel(r'$\mathrm{Dierickx\ et\ al.}\ e$')
plt.ylabel(r'$\mathrm{galpy\ estimated}\ e$')
Expand Down Expand Up @@ -188,4 +161,4 @@ def get_options():
parser = get_options()
options, args= parser.parse_args()
get_table(args,options)
calc_eccentricity(args, options)
calc_eccentricity(args, options)
4 changes: 2 additions & 2 deletions doc/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ simple Miyamoto-Nagai potential, we initialize an orbit as follows

>>> from galpy.orbit import Orbit
>>> mp= MiyamotoNagaiPotential(a=0.5,b=0.0375,amp=1.,normalize=1.)
>>> o= Orbit(vxvv=[1.,0.1,1.1,0.,0.1])
>>> o= Orbit([1.,0.1,1.1,0.,0.1])

Since we gave ``Orbit()`` a five-dimensional initial condition
``[R,vR,vT,z,vz]``, we assume we are dealing with a three-dimensional
Expand All @@ -319,7 +319,7 @@ azimuth. We then integrate the orbit for a set of times ``ts``
>>> o.integrate(ts,mp,method='odeint')

.. TIP::
Like for the Miyamoto-Nagai example in the section above, the Orbit and integration times can also be specified in physical units, e.g., ``o= Orbit(vxvv=[8.*units.kpc,22.*units.km/units.s,242.*units.km/units.s.0.*units.pc,20.*units.km/s])`` and ``ts= numpy.linspace(0.,10.,10000)*units.Gyr``
Like for the Miyamoto-Nagai example in the section above, the Orbit and integration times can also be specified in physical units, e.g., ``o= Orbit([8.*units.kpc,22.*units.km/units.s,242.*units.km/units.s.0.*units.pc,20.*units.km/s])`` and ``ts= numpy.linspace(0.,10.,10000)*units.Gyr``

Now we plot the resulting orbit as

Expand Down
Binary file removed doc/source/images/lp-orbit-integration-EzJz.png
Binary file not shown.
Binary file added doc/source/images/lp-orbits-integration.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 907211f

Please sign in to comment.