Skip to content

Commit f78d54d

Browse files
committed
Fixing all failing doctests. Some more cleaning may be necessary
1 parent 6bd18b4 commit f78d54d

File tree

3 files changed

+94
-98
lines changed

3 files changed

+94
-98
lines changed

docs/jplhorizons/jplhorizons.rst

Lines changed: 46 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ respective id number or record number as ``id`` and use ``id_type=None``:
112112

113113
>>> from astroquery.jplhorizons import Horizons
114114
>>> print(Horizons(id='Encke').ephemerides())
115+
Traceback (most recent call last):
115116
...
116117
ValueError: Ambiguous target name; provide unique id:
117118
Record # Epoch-yr Primary Desig >MATCH NAME<
@@ -121,7 +122,7 @@ respective id number or record number as ``id`` and use ``id_type=None``:
121122
90000035 1796 2P Encke
122123
90000036 1805 2P Encke
123124
... ... ... ...
124-
>>> print(Horizons(id='90000034', id_type=None).ephemerides())
125+
>>> print(Horizons(id='90000034', id_type=None).ephemerides()) # doctest: +IGNORE_OUTPUT
125126
targetname datetime_str datetime_jd ... RA_3sigma DEC_3sigma
126127
--- --- d ... arcsec arcsec
127128
---------- ------------------------ ----------------- ... --------- ----------
@@ -153,15 +154,15 @@ ephemerides of asteroid (1) Ceres for a range of dates as seen from Mauna Kea:
153154
... 'step':'10d'})
154155
>>> eph = obj.ephemerides()
155156
>>> print(eph)
156-
targetname datetime_str datetime_jd ... GlxLat RA_3sigma DEC_3sigma
157-
--- --- d ... deg arcsec arcsec
158-
---------- ----------------- ----------- ... --------- --------- ----------
159-
1 Ceres 2010-Jan-01 00:00 2455197.5 ... 24.120057 0.0 0.0
160-
1 Ceres 2010-Jan-11 00:00 2455207.5 ... 20.621496 0.0 0.0
161-
1 Ceres 2010-Jan-21 00:00 2455217.5 ... 17.229529 0.0 0.0
162-
1 Ceres 2010-Jan-31 00:00 2455227.5 ... 13.97264 0.0 0.0
163-
1 Ceres 2010-Feb-10 00:00 2455237.5 ... 10.877201 0.0 0.0
164-
1 Ceres 2010-Feb-20 00:00 2455247.5 ... 7.976737 0.0 0.0
157+
targetname datetime_str datetime_jd ... alpha_true PABLon PABLat
158+
--- --- d ... deg deg deg
159+
----------------- ----------------- ----------- ... ---------- -------- ------
160+
1 Ceres (A801 AA) 2010-Jan-01 00:00 2455197.5 ... 12.3609 238.2494 4.5532
161+
1 Ceres (A801 AA) 2010-Jan-11 00:00 2455207.5 ... 14.1057 241.3339 4.2832
162+
1 Ceres (A801 AA) 2010-Jan-21 00:00 2455217.5 ... 15.7313 244.3394 4.0089
163+
1 Ceres (A801 AA) 2010-Jan-31 00:00 2455227.5 ... 17.2067 247.2518 3.7289
164+
1 Ceres (A801 AA) 2010-Feb-10 00:00 2455237.5 ... 18.5029 250.0576 3.4415
165+
1 Ceres (A801 AA) 2010-Feb-20 00:00 2455247.5 ... 19.5814 252.7383 3.1451
165166
>>> # The following fields are available for each ephemerides query:
166167
>>> print(eph.columns)
167168
<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')>
@@ -221,10 +222,10 @@ asteroid (433) Eros for a given date relative to the Sun:
221222
... epochs=2458133.33546)
222223
>>> el = obj.elements()
223224
>>> print(el)
224-
targetname datetime_jd ... Q P
225-
--- d ... AU d
226-
------------------ ------------- ... ------------- ------------
227-
433 Eros (A898 PA) 2458133.33546 ... 1.78244263804 642.93873484
225+
targetname datetime_jd ... Q P
226+
--- d ... AU d
227+
------------------ ------------- ... ----------------- -----------------
228+
433 Eros (A898 PA) 2458133.33546 ... 1.782442696867877 642.9387350660577
228229
>>> # The following fields are queried:
229230
>>> print(el.columns)
230231
<TableColumns names=('targetname','datetime_jd','datetime_str','H','G','e','q','incl','Omega','w','Tp_jd','n','M','nu','a','Q','P')>
@@ -261,23 +262,18 @@ epochs:
261262
... 'step':'10m'})
262263
>>> vec = obj.vectors()
263264
>>> print(vec)
264-
targetname datetime_jd ... range range_rate
265-
--- d ... AU AU / d
266-
---------- ------------- ... --------------- -----------------
267-
(2012 TC4) 2458027.5 ... 0.0429332099306 -0.00408018711862
268-
(2012 TC4) 2458027.50694 ... 0.0429048742906 -0.00408040726527
269-
(2012 TC4) 2458027.51389 ... 0.0428765385796 -0.00408020747595
270-
(2012 TC4) 2458027.52083 ... 0.0428482057142 -0.0040795878561
271-
(2012 TC4) 2458027.52778 ... 0.042819878607 -0.00407854931543
272-
(2012 TC4) 2458027.53472 ... 0.0427915601617 -0.0040770935665
273-
... ... ... ... ...
274-
(2012 TC4) 2458028.45833 ... 0.0392489462501 -0.00405496595173
275-
(2012 TC4) 2458028.46528 ... 0.03922077771 -0.00405750632914
276-
(2012 TC4) 2458028.47222 ... 0.039192592935 -0.00405964084539
277-
(2012 TC4) 2458028.47917 ... 0.039164394759 -0.00406136516755
278-
(2012 TC4) 2458028.48611 ... 0.0391361860433 -0.00406267574646
279-
(2012 TC4) 2458028.49306 ... 0.0391079696711 -0.0040635698239
280-
(2012 TC4) 2458028.5 ... 0.0390797485422 -0.00406404543822
265+
targetname datetime_jd ... range range_rate
266+
--- d ... AU AU / d
267+
---------- ----------------- ... ------------------- ---------------------
268+
(2012 TC4) 2458027.5 ... 0.04293321014985829 -0.004080187136570278
269+
(2012 TC4) 2458027.506944444 ... 0.04290487450966027 -0.004080407283352606
270+
(2012 TC4) 2458027.513888889 ... 0.04287653879860514 -0.004080207494158422
271+
(2012 TC4) 2458027.520833333 ... 0.04284820593301306 -0.004079587874430119
272+
... ... ... ... ...
273+
(2012 TC4) 2458028.479166667 ... 0.03916439496172948 -0.004061365183433081
274+
(2012 TC4) 2458028.486111111 ... 0.03913618624590608 -0.004062675762467314
275+
(2012 TC4) 2458028.493055556 ... 0.03910796987365932 -0.004063569840032833
276+
(2012 TC4) 2458028.5 ... 0.03907974874463358 -0.004064045454467904
281277
Length = 145 rows
282278
>>> # The following fields are queried:
283279
>>> print(vec.columns)
@@ -348,7 +344,7 @@ We can get at list of all the columns in this table with:
348344
.. code-block:: python
349345
350346
>>> 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')>
347+
<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')>
352348
353349
354350
We can address each column individually by indexing it using its name as
@@ -378,24 +374,19 @@ We can select several columns at a time, for instance RA and DEC for each epoch
378374
.. code-block:: python
379375
380376
>>> 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
377+
datetime_str RA DEC
378+
--- deg deg
379+
----------------- --------- --------
380+
2010-Jan-01 00:00 345.50204 13.43621
381+
2011-Jan-01 00:00 78.77158 61.48831
382+
2012-Jan-01 00:00 119.85659 54.21955
383+
2013-Jan-01 00:00 136.60021 45.8241
384+
2014-Jan-01 00:00 147.44947 37.79876
385+
2015-Jan-01 00:00 156.58967 29.23058
386+
2016-Jan-01 00:00 166.32129 18.48174
387+
2017-Jan-01 00:00 180.6992 1.20453
388+
2018-Jan-01 00:00 232.11974 -37.9554
389+
2019-Jan-01 00:00 16.1066 45.50296
399390
400391
401392
We can use the same representation to do math with these columns. For instance,
@@ -417,7 +408,7 @@ in quadrature:
417408
14.775809055378625
418409
11.874886005626538
419410
7.183281978025435
420-
7.295600209387093
411+
7.295600636473737
421412
94.84824546372009
422413
23.952470898018017
423414

@@ -447,7 +438,7 @@ h`` - arcseconds per hour:
447438
-12.107
448439
-9.32616
449440
-5.80004
450-
3.115853
441+
3.115854
451442
85.22719
452443
19.02548
453444

@@ -470,7 +461,7 @@ same dimensions. For instance, we can turn ``RA_rate`` into ``arcsec / s``:
470461
-0.0033630555555555553
471462
-0.0025905999999999998
472463
-0.0016111222222222222
473-
0.0008655147222222222
464+
0.0008655150000000001
474465
0.023674219444444443
475466
0.005284855555555556
476467

@@ -495,7 +486,8 @@ Horizons server can be obtained from the
495486
performed (before the query only ``None`` would be returned):
496487

497488
>>> 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
489+
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
490+
499491

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

docs/jplsbdb/jplsbdb.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ item:
158158
.. code-block:: python
159159
160160
>>> sbdb['orbit']['moid_jup'] # doctest: +REMOTE_DATA
161-
Unit("0.44 AU")
161+
<Quantity 0.435 AU>
162162
163163
Note that many of the items in the output dictionary are associated
164164
with `~astropy.units` which can be readily used for
@@ -169,7 +169,7 @@ orbit intersection distance of the target with respect to Jupiter
169169
.. code-block:: python
170170
171171
>>> print(sbdb['orbit']['moid_jup'].to('km')) # doctest: +REMOTE_DATA
172-
65823063.108
172+
65075073.754499994 km
173173
174174
The vast majority of parameter names are identical to those used in
175175
the `SBDB API documentation

0 commit comments

Comments
 (0)