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