Skip to content

Commit

Permalink
Mention the transfer of units from wrapped to wrapper potential in th…
Browse files Browse the repository at this point in the history
…e documentation
  • Loading branch information
jobovy committed Apr 22, 2020
1 parent cfe4a18 commit 7c60fe4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 7 additions & 5 deletions doc/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ input to any galpy function that does not take a Quantity as an input
<https://github.com/jobovy/galpy/issues>`__.

.. WARNING::
If you combine potentials in a list, galpy uses the ``ro`` and ``vo`` scales from the first potential in the list for physical <-> internal unit conversion. galpy does **not** always check whether the unit systems of various objects are consistent when they are combined (but does check this for many common cases, e.g., integrating an Orbit in a Potential).
If you combine potentials by adding them (``comb_pot= pot1+pot2``), galpy uses the ``ro`` and ``vo`` scales from the first potential in the list for physical <-> internal unit conversion. If you add potentials using the '+' operator, galpy will check that the units are compatible. galpy does **not** always check whether the unit systems of various objects are consistent when they are combined (but does check this for many common cases, e.g., integrating an Orbit in a Potential, setting up an actionAngle object for a given potential, setting up a DF object for a given potential, etc.).

galpy can also return values with units as an astropy
Quantity. Whether or not this is done is specified by the
Expand Down Expand Up @@ -277,10 +277,12 @@ outputs will be in internal units

If you setup a Potential, Orbit, etc. object without specifying the
parameters as a Quantity, the default is to return output in natural
units, except when ``ro=`` and ``vo=`` scales are specified. ``ro=``
and ``vo=`` can always be given as a Quantity themselves. ``ro=``
and ``vo=`` can always also be specified on a method-by-method basis,
overwriting an object's default. For example
units, except when ``ro=`` and ``vo=`` scales are specified
(exception: when you wrap a potential that has physical outputs on,
the wrapped potential will also have them on). ``ro=`` and ``vo=`` can
always be given as a Quantity themselves. ``ro=`` and ``vo=`` can
always also be specified on a method-by-method basis, overwriting an
object's default. For example

>>> mp.vcirc(10.*units.kpc,ro=12.*units.kpc)
# 0.69273212489609337
Expand Down
4 changes: 4 additions & 0 deletions doc/source/potential.rst
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ potential grown as above would be
.. TIP::
To simply adjust the amplitude of a Potential instance, you can multiply the instance with a number or divide it by a number. For example, ``pot= 2.*LogarithmicHaloPotential(amp=1.)`` is equivalent to ``pot= LogarithmicHaloPotential(amp=2.)``. This is useful if you want to, for instance, quickly adjust the mass of a potential.

.. WARNING::
When wrapping a potential that has :ref:`physical outputs turned on <physunits>`, the wrapper object inherits the units of the wrapped potential and automatically turns them on, even when you do not explictly set ``ro=`` and ``vo=``.


Close-to-circular orbits and orbital frequencies
-------------------------------------------------

Expand Down

0 comments on commit 7c60fe4

Please sign in to comment.