Skip to content

Commit aecb5e8

Browse files
authored
Merge pull request #2134 from mkelley/document-jplhorizons-vector-frames
Document JPL Horizons vector coordinate reference frames.
2 parents a6806a1 + d370c61 commit aecb5e8

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

astroquery/jplhorizons/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,10 @@ def vectors_async(self, get_query_payload=False,
889889
Reference plane for all output quantities: ``'ecliptic'`` (ecliptic
890890
and mean equinox of reference epoch), ``'earth'`` (Earth mean
891891
equator and equinox of reference epoch), or ``'body'`` (body mean
892-
equator and node of date); default: ``'ecliptic'``
892+
equator and node of date); default: ``'ecliptic'``.
893+
894+
See :ref:`Horizons Reference Frames <jpl-horizons-reference-frames>`
895+
in the astroquery documentation for details.
893896
aberrations : string, optional
894897
Aberrations to be accounted for: [``'geometric'``,
895898
``'astrometric'``, ``'apparent'``]. Default: ``'geometric'``

docs/jplhorizons/jplhorizons.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,47 @@ might be truncated as URIs are typically expected to be shorter than
564564
is longer than this limit, a warning is given. In that case, please
565565
try using a range of dates instead of a list of individual dates.
566566

567+
.. _jpl-horizons-reference-frames:
568+
569+
Reference Frames
570+
----------------
571+
572+
The coordinate reference frame for Horizons output is controlled by the
573+
``refplane`` and ``refsystem`` keyword arguments. See the `Horizons
574+
documentation`_ for details. Some
575+
output reference frames are included in astropy's `~astropy.coordinates`
576+
577+
+----------------+--------------+----------------+----------------+---------------------------------+
578+
| Method | ``location`` | ``refplane`` | ``refsystem`` | astropy frame |
579+
+================+==============+================+================+=================================+
580+
| ``.vectors()`` | ``'@0'`` | ``'ecliptic'`` | N/A | ``'custombarycentricecliptic'`` |
581+
+----------------+--------------+----------------+----------------+---------------------------------+
582+
| ``.vectors()`` | ``'@0'`` | ``'earth'`` | N/A | ``'icrs'`` |
583+
+----------------+--------------+----------------+----------------+---------------------------------+
584+
| ``.vectors()`` | ``'@10'`` | ``'ecliptic'`` | N/A | ``'heliocentriceclipticiau76'`` |
585+
+----------------+--------------+----------------+----------------+---------------------------------+
586+
587+
For example, get the barycentric coordinates of Jupiter as an astropy
588+
`~astropy.coordinates.SkyCoord` object:
589+
590+
.. code-block:: python
591+
592+
>>> from astropy.coordinates import SkyCoord
593+
>>> from astropy.time import Time
594+
>>> from astroquery.jplhorizons import Horizons
595+
>>> epoch = Time('2021-01-01')
596+
>>> q = Horizons('599', id_type='majorbody', location='@0',
597+
... epochs=epoch.tdb.jd)
598+
>>> tab = q.vectors(refplane='earth')
599+
>>> c = SkyCoord(tab['x'].quantity, tab['y'].quantity, tab['z'].quantity,
600+
... representation_type='cartesian', frame='icrs',
601+
... obstime=epoch)
602+
>>> print(c)
603+
<SkyCoord (ICRS): (x, y, z) in AU
604+
[(3.03483263, -3.72503309, -1.67054586)]>
605+
606+
607+
567608
568609
Acknowledgements
569610
================

0 commit comments

Comments
 (0)