Skip to content

Commit 162aad2

Browse files
tinuademargaretbsipocz
authored andcommitted
jplhorizons ssd.jpl.nasa.gov down
1 parent ffb6c52 commit 162aad2

File tree

1 file changed

+45
-44
lines changed

1 file changed

+45
-44
lines changed

docs/jplhorizons/jplhorizons.rst

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. doctest-skip-all
2-
31
.. _astroquery.jplhorizons:
42

53
***********************************************************************************
@@ -36,6 +34,7 @@ In order to query information for a specific Solar System body, a
3634
``Horizons`` object has to be instantiated:
3735

3836
.. code-block:: python
37+
.. doctest-remote-data::
3938

4039
>>> from astroquery.jplhorizons import Horizons
4140
>>> obj = Horizons(id='Ceres', location='568', epochs=2458133.33546)
@@ -62,17 +61,19 @@ location is on Earth if it has not been specifically set. The following example
6261
uses the coordinates of the `Statue of Liberty
6362
<https://www.google.com/maps/place/Statue+of+Liberty+National+Monument/@40.6892534,-74.0466891,17z/data=!3m1!4b1!4m5!3m4!1s0x89c25090129c363d:0x40c6a5770d25022b!8m2!3d40.6892494!4d-74.0445004>`_
6463
as the observer's location:
64+
.. code-block:: python
65+
.. doctest-remote-data::
6566

6667
>>> statue_of_liberty = {'lon': -74.0466891,
6768
... 'lat': 40.6892534,
6869
... 'elevation': 0.093}
6970
>>> obj = Horizons(id='Ceres',
7071
... location=statue_of_liberty,
7172
... epochs=2458133.33546)
73+
>>> print(obj)
7274
JPLHorizons instance "Ceres"; location={'lon': -74.0466891, 'lat': 40.6892534, 'elevation': 0.093}, epochs=[2458133.33546], id_type=None
7375

7476

75-
7677
``epochs`` is either a scalar or list of Julian dates (floats or strings) in the
7778
case of discrete epochs, or, in the case of a range of epochs, a dictionary that
7879
has to include the keywords ``start``, ``stop`` (both using the following format
@@ -105,7 +106,9 @@ In the case of ambiguities in the name resolution, a list of matching objects
105106
will be provided. In order to select an object from this list, provide the
106107
respective id number or record number as ``id`` and use ``id_type=None``:
107108

109+
108110
.. code-block:: python
111+
.. doctest-remote-data::
109112

110113
>>> from astroquery.jplhorizons import Horizons
111114
>>> print(Horizons(id='Encke').ephemerides())
@@ -142,6 +145,7 @@ for a given observer location (``location``) and epoch or range of epochs
142145
ephemerides of asteroid (1) Ceres for a range of dates as seen from Mauna Kea:
143146

144147
.. code-block:: python
148+
.. doctest-remote-data::
145149

146150
>>> from astroquery.jplhorizons import Horizons
147151
>>> obj = Horizons(id='Ceres', location='568',
@@ -158,12 +162,7 @@ ephemerides of asteroid (1) Ceres for a range of dates as seen from Mauna Kea:
158162
1 Ceres 2010-Jan-31 00:00 2455227.5 ... 13.97264 0.0 0.0
159163
1 Ceres 2010-Feb-10 00:00 2455237.5 ... 10.877201 0.0 0.0
160164
1 Ceres 2010-Feb-20 00:00 2455247.5 ... 7.976737 0.0 0.0
161-
162-
163-
The following fields are available for each ephemerides query:
164-
165-
.. code-block:: python
166-
165+
>>> # The following fields are available for each ephemerides query:
167166
>>> print(eph.columns)
168167
<TableColumns names=('targetname','datetime_str','datetime_jd','H','G','solar_presence','flags','RA','DEC','RA_app','DEC_app','RA_rate','DEC_rate','AZ','EL','AZ_rate','EL_rate','sat_X','sat_Y','sat_PANG','siderealtime','airmass','magextinct','V','surfbright','illumination','illum_defect','sat_sep','sat_vis','ang_width','PDObsLon','PDObsLat','PDSunLon','PDSunLat','SubSol_ang','SubSol_dist','NPole_ang','NPole_dist','EclLon','EclLat','r','r_rate','delta','delta_rate','lighttime','vel_sun','vel_obs','elong','elongFlag','alpha','lunar_elong','lunar_illum','sat_alpha','sunTargetPA','velocityPA','OrbPlaneAng','constellation','TDB-UT','ObsEclLon','ObsEclLat','NPole_RA','NPole_DEC','GlxLon','GlxLat','solartime','earth_lighttime','RA_3sigma','DEC_3sigma','SMAA_3sigma','SMIA_3sigma','Theta_3sigma','Area_3sigma','RSS_3sigma','r_3sigma','r_rate_3sigma','SBand_3sigma','XBand_3sigma','DoppDelay_3sigma','true_anom','hour_angle','alpha_true','PABLon','PABLat')>
169168

@@ -215,6 +214,7 @@ an astropy table. The following example queries the osculating elements of
215214
asteroid (433) Eros for a given date relative to the Sun:
216215

217216
.. code-block:: python
217+
.. doctest-remote-data::
218218

219219
>>> from astroquery.jplhorizons import Horizons
220220
>>> obj = Horizons(id='433', location='500@10',
@@ -225,12 +225,7 @@ asteroid (433) Eros for a given date relative to the Sun:
225225
--- d ... AU d
226226
------------------ ------------- ... ------------- ------------
227227
433 Eros (A898 PA) 2458133.33546 ... 1.78244263804 642.93873484
228-
229-
230-
The following fields are queried:
231-
232-
.. code-block:: python
233-
228+
>>> # The following fields are queried:
234229
>>> print(el.columns)
235230
<TableColumns names=('targetname','datetime_jd','datetime_str','H','G','e','q','incl','Omega','w','Tp_jd','n','M','nu','a','Q','P')>
236231

@@ -258,6 +253,7 @@ vector of asteroid 2012 TC4 as seen from Goldstone for a range of
258253
epochs:
259254

260255
.. code-block:: python
256+
.. doctest-remote-data::
261257

262258
>>> from astroquery.jplhorizons import Horizons
263259
>>> obj = Horizons(id='2012 TC4', location='257',
@@ -283,9 +279,7 @@ epochs:
283279
(2012 TC4) 2458028.49306 ... 0.0391079696711 -0.0040635698239
284280
(2012 TC4) 2458028.5 ... 0.0390797485422 -0.00406404543822
285281
Length = 145 rows
286-
287-
The following fields are queried:
288-
282+
>>> # The following fields are queried:
289283
>>> print(vec.columns)
290284
<TableColumns names=('targetname','datetime_jd','datetime_str','H','G','x','y','z','vx','vy','vz','lighttime','range','range_rate')>
291285

@@ -315,18 +309,15 @@ JPL Horizons ephemerides query of near-Earth asteroid (3552) Don Quixote since
315309
its year of Discovery:
316310

317311
.. code-block:: python
312+
.. doctest-remote-data::
318313

319314
>>> from astroquery.jplhorizons import Horizons
320315
>>> obj = Horizons(id='3552', location='568',
321316
... epochs={'start':'2010-01-01', 'stop':'2019-12-31',
322317
... 'step':'1y'})
323318
>>> eph = obj.ephemerides()
324-
325-
As we have seen before, we can display a truncated version of table
326-
``eph`` by simply using
327-
328-
.. code-block:: python
329-
319+
>>> # As we have seen before, we can display a truncated version of table
320+
>>> # ``eph`` by simply using
330321
>>> print(eph)
331322
targetname datetime_str ... PABLon PABLat
332323
--- --- ... deg deg
@@ -356,16 +347,17 @@ We can get at list of all the columns in this table with:
356347

357348
.. code-block:: python
358349
359-
>>> print(eph.columns)
360-
<TableColumns names=('targetname','datetime_str','datetime_jd','H','G','solar_presence','flags','RA','DEC','RA_app','DEC_app','RA_rate','DEC_rate','AZ','EL','AZ_rate','EL_rate','sat_X','sat_Y','sat_PANG','siderealtime','airmass','magextinct','V','surfbright','illumination','illum_defect','sat_sep','sat_vis','ang_width','PDObsLon','PDObsLat','PDSunLon','PDSunLat','SubSol_ang','SubSol_dist','NPole_ang','NPole_dist','EclLon','EclLat','r','r_rate','delta','delta_rate','lighttime','vel_sun','vel_obs','elong','elongFlag','alpha','lunar_elong','lunar_illum','sat_alpha','sunTargetPA','velocityPA','OrbPlaneAng','constellation','TDB-UT','ObsEclLon','ObsEclLat','NPole_RA','NPole_DEC','GlxLon','GlxLat','solartime','earth_lighttime','RA_3sigma','DEC_3sigma','SMAA_3sigma','SMIA_3sigma','Theta_3sigma','Area_3sigma','RSS_3sigma','r_3sigma','r_rate_3sigma','SBand_3sigma','XBand_3sigma','DoppDelay_3sigma','true_anom','hour_angle','alpha_true','PABLon','PABLat')>
350+
>>> print(eph.columns) # doctest: +REMOTE_DATA
351+
<TableColumns names=('targetname','datetime_str','datetime_jd','H','G','solar_presence','flags','RA','DEC','RA_rate','DEC_rate','AZ','EL','airmass','magextinct','V','surfbright','illumination','EclLon','EclLat','r','r_rate','delta','delta_rate','lighttime','elong','elongFlag','alpha','sunTargetPA','velocityPA','ObsEclLon','ObsEclLat','GlxLon','GlxLat','RA_3sigma','DEC_3sigma')>
352+
361353
362354
We can address each column individually by indexing it using its name as
363355
provided in this list. For instance, we can get all RAs for Don Quixote by using
364356

365357
.. code-block:: python
366358
367-
>>> print(eph['RA'])
368-
RA
359+
>>> print(eph['RA']) # doctest: +REMOTE_DATA
360+
RA
369361
deg
370362
---------
371363
345.50204
@@ -385,27 +377,34 @@ We can select several columns at a time, for instance RA and DEC for each epoch
385377

386378
.. code-block:: python
387379
388-
>>> print(eph['datetime_str', 'RA', 'DEC'])
389-
datetime_str RA DEC
390-
--- deg deg
391-
----------------- --------- --------
392-
2010-Jan-01 00:00 345.50204 13.43621
393-
2011-Jan-01 00:00 78.77158 61.48831
394-
2012-Jan-01 00:00 119.85659 54.21955
395-
2013-Jan-01 00:00 136.60021 45.82409
396-
2014-Jan-01 00:00 147.44947 37.79876
397-
2015-Jan-01 00:00 156.58967 29.23058
398-
2016-Jan-01 00:00 166.32129 18.48174
399-
2017-Jan-01 00:00 180.6992 1.20453
400-
2018-Jan-01 00:00 232.11974 -37.9554
401-
2019-Jan-01 00:00 16.1066 45.50296
380+
>>> print(eph['datetime_str', 'RA', 'DEC']) # doctest: +REMOTE_DATA
381+
datetime_str RA DEC
382+
--- deg deg
383+
----------------- --------- ---------
384+
1983-Jan-01 00:00 209.43762 -25.92118
385+
1984-Jan-01 00:00 357.85696 28.74791
386+
1985-Jan-01 00:00 86.22996 60.90524
387+
1986-Jan-01 00:00 122.10393 53.19306
388+
1987-Jan-01 00:00 137.91137 44.95184
389+
1988-Jan-01 00:00 148.42444 37.01774
390+
... ... ...
391+
2013-Jan-01 00:00 136.60019 45.82408
392+
2014-Jan-01 00:00 147.44945 37.79874
393+
2015-Jan-01 00:00 156.58965 29.23058
394+
2016-Jan-01 00:00 166.32128 18.48173
395+
2017-Jan-01 00:00 180.69918 1.20453
396+
2018-Jan-01 00:00 232.11974 -37.95539
397+
2019-Jan-01 00:00 16.10662 45.50296
398+
Length = 37 rows
402399
403400
404401
We can use the same representation to do math with these columns. For instance,
405402
let's calculate the total rate of the object by summing 'RA_rate' and 'DEC_rate'
406403
in quadrature:
407404

405+
408406
.. code-block:: python
407+
.. doctest-remote-data::
409408

410409
>>> import numpy as np
411410
>>> print(np.sqrt(eph['RA_rate']**2 + eph['DEC_rate']**2))
@@ -435,6 +434,7 @@ available, too, e.g., the ``RA_rate`` column is expressed in ``arcsec /
435434
h`` - arcseconds per hour:
436435

437436
.. code-block:: python
437+
.. doctest-remote-data::
438438

439439
>>> print(eph['RA_rate'])
440440
RA_rate
@@ -456,6 +456,7 @@ The unit of this column can be easily converted to any other unit describing the
456456
same dimensions. For instance, we can turn ``RA_rate`` into ``arcsec / s``:
457457

458458
.. code-block:: python
459+
.. doctest-remote-data::
459460

460461
>>> eph['RA_rate'].convert_unit_to('arcsec/s')
461462
>>> print(eph['RA_rate'])
@@ -493,8 +494,8 @@ Horizons server can be obtained from the
493494
:class:`~astroquery.jplhorizons.HorizonsClass` object after a query has been
494495
performed (before the query only ``None`` would be returned):
495496

496-
>>> print(obj.uri)
497-
https://ssd.jpl.nasa.gov/api/horizons.api?format=text&EPHEM_TYPE=OBSERVER&QUANTITIES=%271%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10%2C11%2C12%2C13%2C14%2C15%2C16%2C17%2C18%2C19%2C20%2C21%2C22%2C23%2C24%2C25%2C26%2C27%2C28%2C29%2C30%2C31%2C32%2C33%2C34%2C35%2C36%2C37%2C38%2C39%2C40%2C41%2C42%2C43%27&COMMAND=%223552%22&SOLAR_ELONG=%220%2C180%22&LHA_CUTOFF=0&CSV_FORMAT=YES&CAL_FORMAT=BOTH&ANG_FORMAT=DEG&APPARENT=AIRLESS&REF_SYSTEM=ICRF&EXTRA_PREC=NO&CENTER=%27568%27&START_TIME=%222010-01-01%22&STOP_TIME=%222019-12-31%22&STEP_SIZE=%221y%22&SKIP_DAYLT=NO
497+
>>> print(obj.uri) # doctest: +REMOTE_DATA
498+
https://ssd.jpl.nasa.gov/horizons_batch.cgi?batch=1&TABLE_TYPE=VECTORS&OUT_UNITS=AU-D&COMMAND=%222012+TC4%3B%22&CENTER=%27257%27&CSV_FORMAT=%22YES%22&REF_PLANE=ECLIPTIC&REF_SYSTEM=J2000&TP_TYPE=ABSOLUTE&LABELS=YES&OBJ_DATA=YES&START_TIME=2017-10-01&STOP_TIME=2017-10-02&STEP_SIZE=10m
498499

499500
If your query failed, it might be useful for you to put the URI into a web
500501
browser to get more information why it failed. Please note that ``uri`` is an

0 commit comments

Comments
 (0)