Skip to content

Commit 87d3601

Browse files
committed
Update formatting output for doctests w/astropy 5.1
1 parent 5437cba commit 87d3601

File tree

5 files changed

+84
-72
lines changed

5 files changed

+84
-72
lines changed

docs/exoplanet_orbit_database/exoplanet_orbit_database.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ to columns wherever possible.
1818
<QTable length=2>
1919
A AUPPER ... NAME_LOWERCASE sky_coord
2020
AU AU ... deg,deg
21-
float64 float64 ... str19 object
21+
float64 float64 ... str19 SkyCoord
2222
--------- ----------- ... -------------- -----------------------------------
2323
0.0780099 0.00130017 ... kepler-107d 297.0282083332539,48.20861111111111
2424
0.0344721 0.000675924 ... kepler-1049b 287.3467499971389,47.7729444445504
@@ -43,9 +43,9 @@ is also a special column of sky coordinates for each target, named ``sky_coord``
4343
>>> from astroquery.exoplanet_orbit_database import ExoplanetOrbitDatabase
4444
>>> hatp11b = ExoplanetOrbitDatabase.query_planet('HAT-P-11 b')
4545
>>> hatp11b['PER'] # Planet period
46-
<Quantity 4.8878162 d>
46+
<MaskedQuantity 4.8878162 d>
4747
>>> hatp11b['R'] # Planet radius
48-
<Quantity 0.422 jupiterRad>
48+
<MaskedQuantity 0.422 jupiterRad>
4949
>>> hatp11b['sky_coord'] # Position of host star
5050
<SkyCoord (ICRS): (ra, dec) in deg
5151
(297.70890417, 48.08029444)>

docs/heasarc/heasarc.rst

Lines changed: 29 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,12 @@ an object by name:
2727
>>> object_name = '3c273'
2828
>>> table = heasarc.query_object(object_name, mission=mission)
2929
>>> table[:3].pprint(max_width=120)
30-
SEQ_ID INSTRUMENT EXPOSURE NAME RA DEC START_TIME END_TIME SEARCH_OFFSET_
31-
S DEGREE DEGREE MJD MJD
32-
----------- ---------- -------- -------------------- -------- ------ ---------------- ---------------- ---------------
33-
RH701576N00 HRI 68154 3C 273 187.2800 2.0500 49704.3090856482 49724.6236226852 0.190 (3C273)
34-
<BLANKLINE>
35-
RP600242A01 PSPCB 24822 GIOVANELLI-HAYNES CL 186.9300 1.6000 48980.6468865741 48982.9284837963 34.236 (3C273)
36-
<BLANKLINE>
37-
RH700234N00 HRI 17230 3C 273 187.2800 2.0500 48629.2693055556 48632.4716782407 0.190 (3C273)
38-
<BLANKLINE>
30+
SEQ_ID INSTRUMENT EXPOSURE NAME ... DEC START_TIME END_TIME SEARCH_OFFSET_
31+
s ... deg mjd mjd
32+
---------------- ---------- -------- -------------------- ... ------ ---------------- ---------------- ----------------
33+
RH701576N00 HRI 68154 3C 273 ... 2.0500 49704.3090856482 49724.6236226852 0.190 (3c273)\n
34+
RP600242A01 PSPCB 24822 GIOVANELLI-HAYNES CL ... 1.6000 48980.6468865741 48982.9284837963 34.236 (3c273)\n
35+
RH700234N00 HRI 17230 3C 273 ... 2.0500 48629.2693055556 48632.4716782407 0.190 (3c273)\n
3936

4037
Alternatively, a query can also be conducted around a specific set of sky
4138
coordinates:
@@ -49,15 +46,12 @@ coordinates:
4946
>>> coords = SkyCoord('12h29m06.70s +02d03m08.7s', frame='icrs')
5047
>>> table = heasarc.query_region(coords, mission=mission, radius='1 degree')
5148
>>> table[:3].pprint(max_width=120)
52-
SEQ_ID INSTRUMENT EXPOSURE ... START_TIME END_TIME SEARCH_OFFSET_
53-
S ... MJD MJD
54-
----------- ---------- -------- ... ---------------- ---------------- ----------------------------------------------
55-
RH701576N00 HRI 68154 ... 49704.3090856482 49724.6236226852 0.191 (187.2779228198005,2.0524148595265435)
56-
<BLANKLINE>
57-
RP600242A01 PSPCB 24822 ... 48980.6468865741 48982.9284837963 34.237 (187.2779228198005,2.0524148595265435)
58-
<BLANKLINE>
59-
RH700234N00 HRI 17230 ... 48629.2693055556 48632.4716782407 0.191 (187.2779228198005,2.0524148595265435)
60-
<BLANKLINE>
49+
SEQ_ID INSTRUMENT EXPOSURE ... START_TIME END_TIME SEARCH_OFFSET_
50+
s ... mjd mjd
51+
---------------- ---------- -------- ... ---------------- ---------------- --------------------------------------
52+
RH701576N00 HRI 68154 ... 49704.3090856482 49724.6236226852 0.191 (187.2779228198,2.0524148595)\n
53+
RP600242A01 PSPCB 24822 ... 48980.6468865741 48982.9284837963 34.237 (187.2779228198,2.0524148595)\n
54+
RH700234N00 HRI 17230 ... 48629.2693055556 48632.4716782407 0.191 (187.2779228198,2.0524148595)\n
6155

6256
Note that the :meth:`~astroquery.heasarc.HeasarcClass.query_region` converts
6357
the passed coordinates to the FK5 reference frame before submitting the query.
@@ -82,14 +76,12 @@ specify which columns will be returned:
8276

8377
>>> table = heasarc.query_object(object_name='3c273', mission='rosmaster', fields='EXPOSURE,RA,DEC')
8478
>>> table[:3].pprint()
85-
EXPOSURE RA DEC SEARCH_OFFSET_
86-
S DEGREE DEGREE
87-
-------- -------- ------ ---------------
88-
68154 187.2800 2.0500 0.190 (3C273)
89-
<BLANKLINE>
90-
24822 186.9300 1.6000 34.236 (3C273)
91-
<BLANKLINE>
92-
17230 187.2800 2.0500 0.190 (3C273)
79+
EXPOSURE RA DEC SEARCH_OFFSET_
80+
s deg deg
81+
-------- -------- ------ ----------------
82+
68154 187.2800 2.0500 0.190 (3c273)\n
83+
24822 186.9300 1.6000 34.236 (3c273)\n
84+
17230 187.2800 2.0500 0.190 (3c273)\n
9385

9486
Note that the ``SEARCH_OFFSET_`` column will always be included in the results.
9587
If a column name is passed to the ``fields`` parameter which does not exist in
@@ -141,15 +133,12 @@ parameter. The following sorts the results by the value in the 'EXPOSURE' column
141133

142134
>>> table = heasarc.query_object(object_name, mission='rosmaster', sortvar='EXPOSURE')
143135
>>> table[:3].pprint()
144-
SEQ_ID INSTRUMENT EXPOSURE ... END_TIME SEARCH_OFFSET_
145-
S ... MJD
146-
----------- ---------- -------- ... ---------------- ---------------
147-
RH120001N00 HRI 0 ... 48079.8913773148 0.496 (3C273)
148-
<BLANKLINE>
149-
RH701979N00 HRI 354 ... 49726.0977083333 0.190 (3C273)
150-
<BLANKLINE>
151-
RP141520N00 PSPCB 485 ... 49540.0447569444 0.496 (3C273)
152-
<BLANKLINE>
136+
SEQ_ID INSTRUMENT EXPOSURE ... END_TIME SEARCH_OFFSET_
137+
s ... mjd
138+
---------------- ---------- -------- ... ---------------- ----------------
139+
RH120001N00 HRI 0 ... 48079.8913773148 0.496 (3c273)\n
140+
RH701979N00 HRI 354 ... 49726.0977083333 0.190 (3c273)\n
141+
RP141520N00 PSPCB 485 ... 49540.0447569444 0.496 (3c273)\n
153142

154143
Setting the ``resultmax`` parameter controls the maximum number of results to be
155144
returned. The following will store only the first 10 results:
@@ -167,12 +156,11 @@ It is also possible to select time range:
167156
>>> from astroquery.heasarc import Heasarc
168157
>>> heasarc = Heasarc()
169158
>>> table = heasarc.query_region('3C273', mission="numaster", radius='1 degree', time='2019-01-01 .. 2020-01-01')
170-
>>> table.pprint()
171-
NAME RA ... ISSUE_FLAG SEARCH_OFFSET_
172-
DEGREE ...
173-
----- -------- ... ---------- ----------------------------------------------
174-
3C273 187.2473 ... 0 2.077 (187.27792209362673,2.0523864234098044)
175-
<BLANKLINE>
159+
>>> table.pprint(max_width=120)
160+
NAME RA DEC ... ISSUE_FLAG SEARCH_OFFSET_
161+
deg deg ...
162+
-------------------------------------------------- -------- ------ ... ---------- -------------------------------------
163+
3C273 187.2473 2.0362 ... 0 2.077 (187.2779220931,2.0523864229)\n
176164

177165

178166
Getting list of available missions

docs/ipac/ned/ned.rst

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ instance if you want to query NGC 224
2727
>>> result_table = Ned.query_object("NGC 224")
2828
>>> print(result_table) # an astropy.table.Table
2929
No. Object Name RA ... Redshift Points Diameter Points Associations
30-
degrees ...
30+
degrees ...
3131
--- ----------- ---------- ... --------------- --------------- ------------
32-
1 MESSIER 031 10.68479 ... 37 13 2
32+
1 MESSIER 031 10.68479 ... 38 13 2
3333

3434

3535
Query a region
@@ -240,16 +240,28 @@ for the specified object. We look at a simple example:
240240
No. RA ... Published Frequence Mode Qualifiers
241241
...
242242
--- -------------- ... ------------------------ -------------------------
243-
0 12h29m06.6997s ...
243+
0 12h29m06.6997s ...
244244
1 12h29m06.7000s ... Uncertain origin
245245
2 12h29m06.7000s ... Uncertain origin
246246
3 12h29m06.7000s ... Uncertain origin
247+
4 12h29m06.7000s ... Uncertain origin
248+
5 12h29m06.7000s ... Uncertain origin
249+
6 12h29m06.7001s ... Uncertain origin
250+
7 12h29m06.6996s ... Uncertain origin
251+
8 12h29m06.7001s ... Uncertain origin
252+
9 12h29m06.7001s ... Uncertain origin
247253
... ... ... ... ...
248-
119 12h29m07.9s ... Uncertain origin
249-
120 12h29m04s ... Uncertain origin
250-
121 12h29m06s ... Uncertain origin
251-
122 12h29m08s ... Uncertain origin
252-
Length = 123 rows
254+
123 12h29m07.55s ... Broad-band measurement From reprocessed raw data
255+
124 12h29m06.05s ... Broad-band measurement From new, raw data
256+
125 12h29m06.5s ... Broad-band measurement From new, raw data
257+
126 12h29m06.5s ... Broad-band measurement From reprocessed raw data
258+
127 12h29m09.0s ... Uncertain origin
259+
128 12h29m08.9s ... Uncertain origin
260+
129 12h29m07.9s ... Uncertain origin
261+
130 12h29m04s ... Uncertain origin
262+
131 12h29m06s ... Uncertain origin
263+
132 12h29m08s ... Uncertain origin
264+
Length = 133 rows
253265

254266

255267
Reference/API

docs/jplhorizons/jplhorizons.rst

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ asteroid (433) Eros for a given date relative to the Sun:
220220
... epochs=2458133.33546)
221221
>>> el = obj.elements()
222222
>>> print(el)
223-
targetname datetime_jd ... Q P
224-
--- d ... AU d
225-
------------------ ------------- ... ----------------- -----------------
226-
433 Eros (A898 PA) 2458133.33546 ... 1.782442696867877 642.9387350660577
223+
targetname datetime_jd ... Q P
224+
--- d ... AU d
225+
------------------ ------------- ... ---------------- -----------------
226+
433 Eros (A898 PA) 2458133.33546 ... 1.78244269692907 642.9387351308188
227227

228228

229229
The following fields are queried:
@@ -263,18 +263,30 @@ epochs:
263263
... 'step':'10m'})
264264
>>> vec = obj.vectors()
265265
>>> print(vec)
266-
targetname datetime_jd ... range range_rate
267-
--- d ... AU AU / d
268-
---------- ----------------- ... ------------------- ---------------------
269-
(2012 TC4) 2458027.5 ... 0.04293321014985829 -0.004080187136570278
270-
(2012 TC4) 2458027.506944444 ... 0.04290487450966027 -0.004080407283352606
271-
(2012 TC4) 2458027.513888889 ... 0.04287653879860514 -0.004080207494158422
272-
(2012 TC4) 2458027.520833333 ... 0.04284820593301306 -0.004079587874430119
273-
... ... ... ... ...
274-
(2012 TC4) 2458028.479166667 ... 0.03916439496172948 -0.004061365183433081
275-
(2012 TC4) 2458028.486111111 ... 0.03913618624590608 -0.004062675762467314
276-
(2012 TC4) 2458028.493055556 ... 0.03910796987365932 -0.004063569840032833
277-
(2012 TC4) 2458028.5 ... 0.03907974874463358 -0.004064045454467904
266+
targetname datetime_jd ... range range_rate
267+
--- d ... AU AU / d
268+
---------- ----------------- ... ------------------- ---------------------
269+
(2012 TC4) 2458027.5 ... 0.04293321045723708 -0.004080187126604792
270+
(2012 TC4) 2458027.506944444 ... 0.04290487481710865 -0.004080407273252692
271+
(2012 TC4) 2458027.513888889 ... 0.04287653910612422 -0.004080207483923752
272+
(2012 TC4) 2458027.520833333 ... 0.0428482062406034 -0.004079587864060769
273+
(2012 TC4) 2458027.527777778 ... 0.04281987913334339 -0.004078549323373959
274+
(2012 TC4) 2458027.534722222 ... 0.04279156068803435 -0.004077093574441023
275+
(2012 TC4) 2458027.541666667 ... 0.04276325379369329 -0.004075223129766587
276+
(2012 TC4) 2458027.548611111 ... 0.04273496131912425 -0.004072941297304715
277+
(2012 TC4) 2458027.555555556 ... 0.04270668610741549 -0.004070252174450395
278+
(2012 TC4) 2458027.5625 ... 0.0426784309704801 -0.004067160640508755
279+
... ... ... ... ...
280+
(2012 TC4) 2458028.4375 ... 0.03933332716437921 -0.004044964554003867
281+
(2012 TC4) 2458028.444444444 ... 0.03930522397865518 -0.004048688817385818
282+
(2012 TC4) 2458028.451388889 ... 0.0392770962740423 -0.004052024827670154
283+
(2012 TC4) 2458028.458333333 ... 0.03924894677018282 -0.004054965958107465
284+
(2012 TC4) 2458028.465277778 ... 0.0392207782301315 -0.004057506335500518
285+
(2012 TC4) 2458028.472222222 ... 0.03919259345507763 -0.00405964085173645
286+
(2012 TC4) 2458028.479166667 ... 0.03916439527899811 -0.004061365173873995
287+
(2012 TC4) 2458028.486111111 ... 0.0391361865632416 -0.004062675752763805
288+
(2012 TC4) 2458028.493055556 ... 0.03910797019106256 -0.004063569830183882
289+
(2012 TC4) 2458028.5 ... 0.0390797490621057 -0.004064045444472773
278290
Length = 145 rows
279291

280292

docs/mast/mast.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -742,16 +742,16 @@ The TESS Input Catalog (TIC), Disk Detective Catalog, and PanSTARRS Catalog can
742742
>>> catalog_data = Catalogs.query_criteria(catalog="Ctl",
743743
... objectname='M101', radius=1, Tmag=[10.75,11])
744744
>>> print(catalog_data)
745-
ID version HIP TYC ... raddflag wdflag objID
745+
ID version HIP TYC ... raddflag wdflag objID
746746
--------- -------- --- ------------ ... -------- ------ ---------
747+
233458861 20190415 -- 3852-01407-1 ... 1 0 150390757
748+
441662028 20190415 -- 3855-00941-1 ... 1 0 150395533
749+
441658008 20190415 -- 3852-00116-1 ... 1 0 150246361
747750
441639577 20190415 -- 3852-00429-1 ... 1 0 150070672
748751
441658179 20190415 -- 3855-00816-1 ... 1 0 150246482
749-
441658008 20190415 -- 3852-00116-1 ... 1 0 150246361
750752
154258521 20190415 -- 3852-01403-1 ... 1 0 150281963
751753
441659970 20190415 -- 3852-00505-1 ... 1 0 150296707
752754
441660006 20190415 -- 3852-00341-1 ... 1 0 150296738
753-
233458861 20190415 -- 3852-01407-1 ... 1 0 150390757
754-
441662028 20190415 -- 3855-00941-1 ... 1 0 150395533
755755

756756

757757
.. doctest-remote-data::

0 commit comments

Comments
 (0)