@@ -20,11 +20,13 @@ Table Discover
20
20
If you want to search for a set of tables, e.g. based on author name or other keywords,
21
21
the :meth: `~astroquery.vizier.VizierClass.find_catalogs ` tool can be used:
22
22
23
+ .. order is not deterministic
23
24
.. doctest-remote-data ::
24
25
25
26
>>> from astroquery.vizier import Vizier
26
- >>> catalog_list = Vizier.find_catalogs(' hot jupiter exoplanet transit' )
27
- >>> for k, v in catalog_list.items():
27
+ >>> vizier = Vizier() # this instantiates Vizier with its default parameters
28
+ >>> catalog_list = vizier.find_catalogs(' hot jupiter exoplanet transit' )
29
+ >>> for k, v in catalog_list.items(): # doctest: +IGNORE_OUTPUT
28
30
... print (k, " :" , v.description)
29
31
J/A+A/635/A205 : Ultra-hot Jupiter WASP-121b transits (Bourrier+, 2020)
30
32
J/ApJ/788/39 : Hot Jupiter exoplanets host stars EW and abundances (Teske+, 2014)
@@ -44,8 +46,8 @@ the complete contents of those catalogs:
44
46
45
47
.. doctest-remote-data ::
46
48
47
- >>> catalogs = Vizier .get_catalogs(catalog_list.keys())
48
- >>> print (catalogs)
49
+ >>> catalogs = vizier .get_catalogs(catalog_list.keys())
50
+ >>> print (catalogs) # doctest: +IGNORE_OUTPUT
49
51
TableList with 10 tables:
50
52
'0:J/A+A/635/A205/20140119' with 7 column(s) and 50 row(s)
51
53
'1:J/A+A/635/A205/20140123' with 7 column(s) and 50 row(s)
64
66
65
67
.. doctest-remote-data ::
66
68
67
- >>> catalogs = Vizier .get_catalogs(catalog_list.values())
68
- >>> print (catalogs)
69
+ >>> catalogs = vizier .get_catalogs(catalog_list.values())
70
+ >>> print (catalogs) # doctest: +IGNORE_OUTPUT
69
71
TableList with 10 tables:
70
72
'0:J/A+A/635/A205/20140119' with 7 column(s) and 50 row(s)
71
73
'1:J/A+A/635/A205/20140123' with 7 column(s) and 50 row(s)
80
82
81
83
.. doctest-remote-data ::
82
84
83
- >>> catalogs = Vizier .get_catalogs(catalog_list.keys())
84
- >>> print (catalogs)
85
+ >>> catalogs = vizier .get_catalogs(catalog_list.keys())
86
+ >>> print (catalogs) # doctest: +IGNORE_OUTPUT
85
87
TableList with 10 tables:
86
88
'0:J/A+A/635/A205/20140119' with 7 column(s) and 50 row(s)
87
89
'1:J/A+A/635/A205/20140123' with 7 column(s) and 50 row(s)
@@ -99,9 +101,9 @@ complete catalog, you need to change that:
99
101
100
102
.. doctest-remote-data ::
101
103
102
- >>> Vizier .ROW_LIMIT = - 1
103
- >>> catalogs = Vizier .get_catalogs(catalog_list.keys())
104
- >>> print (catalogs)
104
+ >>> vizier .ROW_LIMIT = - 1
105
+ >>> catalogs = vizier .get_catalogs(catalog_list.keys())
106
+ >>> print (catalogs) # doctest: +IGNORE_OUTPUT
105
107
TableList with 10 tables:
106
108
'0:J/A+A/635/A205/20140119' with 7 column(s) and 235 row(s)
107
109
'1:J/A+A/635/A205/20140123' with 7 column(s) and 195 row(s)
@@ -113,7 +115,7 @@ complete catalog, you need to change that:
113
115
'7:J/AJ/157/217/transits' with 8 column(s) and 236 row(s)
114
116
'8:J/A+A/635/A122/table2' with 4 column(s) and 18 row(s)
115
117
'9:J/A+A/635/A122/table3' with 4 column(s) and 17 row(s)
116
- >>> Vizier .ROW_LIMIT = 50
118
+ >>> vizier .ROW_LIMIT = 50
117
119
118
120
Get a catalog's associated metadata
119
121
-----------------------------------
@@ -160,11 +162,11 @@ For instance to query Sirius across all catalogs:
160
162
.. doctest-remote-data ::
161
163
162
164
>>> from astroquery.vizier import Vizier
163
- >>> vizier = Vizier()
164
- >>> result = vizier.query_object(" sirius" )
165
+ >>> vizier = Vizier(row_limit = 10 )
166
+ >>> result = vizier.query_object(" sirius" ) # doctest: +IGNORE_WARNINGS
165
167
>>> print (result)
166
- TableList with 416 tables:
167
- '0:METAobj' with 5 column(s) and 7 row(s)
168
+ TableList with ... tables:
169
+ '0:METAobj' with 5 column(s) and 7 row(s)
168
170
'1:ReadMeObj' with 5 column(s) and 7 row(s)
169
171
'2:I/34/greenw2a' with 16 column(s) and 1 row(s)
170
172
...
@@ -210,22 +212,23 @@ quasar 3C 273:
210
212
211
213
>>> from astroquery.vizier import Vizier
212
214
>>> from astropy.coordinates import Angle
213
- >>> result = Vizier.query_region(" 3C 273" , radius = Angle(0.1 , " deg" ), catalog = ' GSC' )
215
+ >>> vizier = Vizier()
216
+ >>> result = vizier.query_region(" 3C 273" , radius = Angle(0.1 , " deg" ), catalog = ' GSC' )
214
217
215
218
Note that the radius may also be specified as a string in the format
216
219
expected by `~astropy.coordinates.Angle `. So the above query may also
217
220
be written as:
218
221
219
222
.. doctest-remote-data ::
220
223
221
- >>> result = Vizier .query_region(" 3C 273" , radius = " 0d6m0s" , catalog = ' GSC' )
224
+ >>> result = vizier .query_region(" 3C 273" , radius = " 0d6m0s" , catalog = ' GSC' )
222
225
223
226
Or using angular units and quantities from `astropy.units `:
224
227
225
228
.. doctest-remote-data ::
226
229
227
230
>>> import astropy.units as u
228
- >>> result = Vizier .query_region(" 3C 273" , radius = 0.1 * u.deg, catalog = ' GSC' )
231
+ >>> result = vizier .query_region(" 3C 273" , radius = 0.1 * u.deg, catalog = ' GSC' )
229
232
230
233
To see the result:
231
234
@@ -249,17 +252,17 @@ dimension.
249
252
>>> from astroquery.vizier import Vizier
250
253
>>> import astropy.units as u
251
254
>>> import astropy.coordinates as coord
252
- >>> result = Vizier.query_region(coord.SkyCoord(ra = 299.590 , dec = 35.201 ,
255
+ >>> vizier = Vizier()
256
+ >>> result = vizier.query_region(coord.SkyCoord(ra = 299.590 , dec = 35.201 ,
253
257
... unit= (u.deg, u.deg),
254
258
... frame= ' icrs' ),
255
259
... width= " 30m" ,
256
260
... catalog= [" NOMAD" , " UCAC" ])
257
261
>>> print (result)
258
- TableList with 4 tables:
262
+ TableList with 3 tables:
259
263
'0:I/297/out' with 19 column(s) and 50 row(s)
260
- '1:I/289/out' with 13 column(s) and 50 row(s)
261
- '2:I/322A/out' with 24 column(s) and 50 row(s)
262
- '3:I/340/ucac5' with 20 column(s) and 50 row(s)
264
+ '1:I/322A/out' with 24 column(s) and 50 row(s)
265
+ '2:I/340/ucac5' with 20 column(s) and 50 row(s)
263
266
264
267
265
268
One more thing to note in the above example is that the coordinates may be
@@ -279,7 +282,8 @@ constraints on the columns of the returned tables by mean of the ``column_filter
279
282
>>> from astroquery.vizier import Vizier
280
283
>>> import astropy.units as u
281
284
>>> from astropy.coordinates import SkyCoord
282
- >>> result = Vizier.query_region(SkyCoord.from_name(' M81' ),
285
+ >>> vizier = Vizier()
286
+ >>> result = vizier.query_region(SkyCoord.from_name(' M81' ),
283
287
... radius= 10 * u.arcmin,
284
288
... catalog= ' I/345/gaia2' ,
285
289
... column_filters= {' Gmag' : ' <19' })
@@ -296,27 +300,27 @@ on the Vizier class.
296
300
297
301
.. doctest-remote-data ::
298
302
299
- >>> v = Vizier(columns = [' _RAJ2000' , ' _DEJ2000' ,' B-V' , ' Vmag' , ' Plx' ],
303
+ >>> vizier = Vizier(columns = [' _RAJ2000' , ' _DEJ2000' ,' B-V' , ' Vmag' , ' Plx' ],
300
304
... column_filters= {" Vmag" :" >10" }, keywords= [" optical" , " xry" ]) # doctest: +IGNORE_WARNINGS
301
305
302
- Note that whenever an unknown keyword is specified, a warning is emitted and
306
+ Note that whenever an unknown keyword is specified (here `` xry ``) a warning is emitted and
303
307
that keyword is discarded from further consideration. The behavior for
304
308
searching with these keywords is the same as defined for the web
305
309
interface (`for details see here `_). Now we call the different query methods on
306
310
this Vizier instance:
307
311
312
+ .. output can be in any order here
308
313
.. doctest-remote-data ::
309
314
310
- >>> v = Vizier(columns = [' _RAJ2000' , ' _DEJ2000' ,' B-V' , ' Vmag' , ' Plx' ],
311
- ... column_filters= {" Vmag" :" >10" }, keywords= [" optical" , " xry " ]) # doctest: +IGNORE_WARNINGS
312
- >>> result = v .query_object(" HD 226868" , catalog = [" NOMAD" , " UCAC" ])
315
+ >>> vizier = Vizier(columns = [' _RAJ2000' , ' _DEJ2000' ,' B-V' , ' Vmag' , ' Plx' ],
316
+ ... column_filters= {" Vmag" :" >10" }, keywords= [" optical" ])
317
+ >>> result = vizier .query_object(" HD 226868" , catalog = [" NOMAD" , " UCAC" ])
313
318
>>> print (result)
314
- TableList with 4 tables:
319
+ TableList with 3 tables:
315
320
'0:I/297/out' with 3 column(s) and 50 row(s)
316
- '1:I/289/out' with 2 column(s) and 18 row(s)
317
- '2:I/322A/out' with 3 column(s) and 10 row(s)
318
- '3:I/340/ucac5' with 2 column(s) and 26 row(s)
319
- >>> print (result[' I/322A/out' ])
321
+ '1:I/322A/out' with 3 column(s) and 10 row(s)
322
+ '2:I/340/ucac5' with 2 column(s) and 26 row(s)
323
+ >>> print (result[' I/322A/out' ]) # doctest: +IGNORE_OUTPUT
320
324
_RAJ2000 _DEJ2000 Vmag
321
325
deg deg mag
322
326
------------- ------------- ------
@@ -340,15 +344,15 @@ the ``"+"`` in front of ``"_r"``.
340
344
341
345
.. doctest-remote-data ::
342
346
343
- >>> v = Vizier(columns = [" *" , " +_r" ], catalog = " II/246" )
344
- >>> result = v .query_region(" HD 226868" , radius = " 20s" )
347
+ >>> vizier = Vizier(columns = [" *" , " +_r" ], catalog = " II/246" )
348
+ >>> result = vizier .query_region(" HD 226868" , radius = " 20s" )
345
349
>>> print (result[0 ])
346
350
_r RAJ2000 DEJ2000 _2MASS Jmag ... Bflg Cflg Xflg Aflg
347
351
deg deg mag ...
348
352
------ ---------- ---------- ---------------- ------ ... ---- ---- ---- ----
349
353
0.134 299.590280 35.201599 19582166+3512057 6.872 ... 111 000 0 0
350
354
10.135 299.587491 35.203217 19582099+3512115 10.285 ... 111 c00 0 0
351
- 11.167 299.588599 35.198849 19582126+3511558 13.111 ... 002 00c 0 0
355
+ 11.167 299.588599 35.198849 19582126+3511558 13.111 ... 2 00c 0 0
352
356
12.288 299.586356 35.200542 19582072+3512019 14.553 ... 111 ccc 0 0
353
357
17.691 299.586254 35.197994 19582070+3511527 16.413 ... 100 c00 0 0
354
358
@@ -394,9 +398,9 @@ index to the ``agn`` table (not the 0-based python convention).
394
398
_q RAJ2000 DEJ2000 _2MASS Jmag ... Rflg Bflg Cflg Xflg Aflg
395
399
deg deg mag ...
396
400
--- ---------- ---------- ---------------- ------ ... ---- ---- ---- ---- ----
397
- 1 10.686015 41.269630 00424464+4116106 9.399 ... 020 020 0c0 2 0
401
+ 1 10.686015 41.269630 00424464+4116106 9.399 ... 20 20 0c0 2 0
398
402
1 10.685657 41.269550 00424455+4116103 10.773 ... 200 200 c00 2 0
399
- 1 10.685837 41.270599 00424460+4116141 9.880 ... 020 020 0c0 2 0
403
+ 1 10.685837 41.270599 00424460+4116141 9.880 ... 20 20 0c0 2 0
400
404
1 10.683263 41.267456 00424398+4116028 12.136 ... 200 100 c00 2 0
401
405
1 10.683465 41.269676 00424403+4116108 11.507 ... 200 100 c00 2 0
402
406
3 27.238636 5.906066 01485727+0554218 8.961 ... 112 111 000 0 0
0 commit comments