1
- .. doctest-skip-all
2
-
3
1
.. _astroquery_xmatch :
4
2
5
3
************************************
@@ -23,20 +21,33 @@ has the following content::
23
21
306.01575,33.86756
24
22
322.493,12.16703
25
23
24
+ .. testsetup ::
25
+
26
+ >>> with open (' pos_list.csv' , ' w' ) as f: # doctest: +IGNORE_OUTPUT
27
+ ... f.write(""" ra,dec
28
+ ... 267.22029 ,- 20.35869
29
+ ... 274.83971 ,- 25.42714
30
+ ... 275.92229 ,- 30.36572
31
+ ... 283.26621 ,- 8.70756
32
+ ... 306.01575 ,33.86756
33
+ ... 322.493 ,12.16703 """ )
34
+
26
35
Next, the xMatch service will be used to find cross matches between the
27
36
uploaded file and a VizieR catalogue. The parameters ``cat1 `` and ``cat2 ``
28
37
define the catalogues where one of them may point to a local file (in this
29
38
example, the CSV file is stored in
30
- ``'/tmp/ pos_list.csv' ``). ``max_distance `` denotes the maximum distance in
39
+ ``'pos_list.csv' ``). ``max_distance `` denotes the maximum distance in
31
40
arcsec to look for counterparts; it is used here to limit the number of rows
32
41
in the resulting table for demonstration purposes. Finally, ``colRa1 `` and
33
42
``colDec1 `` are used to denote the column names in the input file.
34
43
35
- .. code-block :: python
44
+ .. doctest-remote-data ::
36
45
37
46
>>> from astropy import units as u
38
47
>>> from astroquery.xmatch import XMatch
39
- >> > table = XMatch.query(cat1 = open (' /tmp/pos_list.csv' ),
48
+ >>> from astropy.table import Table
49
+ >>> input_table = Table.read(' pos_list.csv' )
50
+ >>> table = XMatch.query(cat1 = input_table,
40
51
... cat2= ' vizier:II/246/out' ,
41
52
... max_distance= 5 * u.arcsec, colRA1= ' ra' ,
42
53
... colDec1= ' dec' )
@@ -57,6 +68,13 @@ in the resulting table for demonstration purposes. Finally, ``colRa1`` and
57
68
0.853178 322.493 12.16703 21295836+1210007 ... EEA 222 0 2451080.6935
58
69
4.50395 322.493 12.16703 21295861+1210023 ... EEE 222 0 2451080.6935
59
70
71
+
72
+ .. testcleanup ::
73
+
74
+ >>> from astroquery.utils import cleanup_saved_downloads
75
+ >>> cleanup_saved_downloads([' pos_list.csv' ])
76
+
77
+
60
78
Reference/API
61
79
=============
62
80
0 commit comments