Skip to content

Commit 9bf69d3

Browse files
authored
Merge pull request #1952 from tinumide/magpis-others-doc-cleanup
Magpis, Xmatch documentation cleanup
2 parents f14f0a5 + f7a3443 commit 9bf69d3

File tree

2 files changed

+45
-27
lines changed

2 files changed

+45
-27
lines changed

docs/magpis/magpis.rst

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. doctest-skip-all
2-
31
.. _astroquery.magpis:
42

53
*****************************************
@@ -16,15 +14,15 @@ functions or as coordinates using any of the coordinate systems available in
1614
`astropy.coordinates`. The FITS image is returned as an
1715
`~astropy.io.fits.HDUList` object. Here is a sample query:
1816

19-
.. code-block:: python
17+
.. doctest-remote-data::
2018

2119
>>> from astroquery.magpis import Magpis
2220
>>> from astropy import coordinates
2321
>>> from astropy import units as u
2422
>>> image = Magpis.get_images(coordinates.SkyCoord(10.5*u.deg, 0.0*u.deg,
2523
... frame='galactic'))
26-
>>> image
27-
24+
>>> image # doctest: +IGNORE_OUTPUT
25+
2826
[<astropy.io.fits.hdu.image.PrimaryHDU at 0x4008650>]
2927

3028
There are some other optional parameters that you may additionally specify.
@@ -35,29 +33,31 @@ appropriate `~astropy.units.Quantity` object.
3533
You may also specify the MAGPIS survey from which to fetch the cutout via the
3634
keyword ``survey``. To know the list of valid surveys:
3735

38-
.. code-block:: python
36+
.. doctest-remote-data::
3937

4038
>>> from astroquery.magpis import Magpis
4139
>>> Magpis.list_surveys()
42-
43-
['gps6epoch3',
44-
'gps6epoch4',
45-
'gps20',
46-
'gps20new',
47-
'gps90',
48-
'gpsmsx',
49-
'gpsmsx2',
50-
'gpsglimpse36',
51-
'gpsglimpse45',
52-
'gpsglimpse58',
53-
'gpsglimpse80',
54-
'mipsgal',
55-
'bolocam']
40+
['gps6',
41+
'gps6epoch2',
42+
'gps6epoch3',
43+
'gps6epoch4',
44+
'gps20',
45+
'gps20new',
46+
'gps90',
47+
'gpsmsx',
48+
'gpsmsx2',
49+
'gpsglimpse36',
50+
'gpsglimpse45',
51+
'gpsglimpse58',
52+
'gpsglimpse80',
53+
'mipsgal',
54+
'atlasgal',
55+
'bolocam']
5656

5757
The default survey used is 'bolocam'. Here is a query setting these optional
5858
parameters as well.
5959

60-
.. code-block:: python
60+
.. doctest-remote-data::
6161

6262
>>> from astroquery.magpis import Magpis
6363
>>> import astropy.units as u
@@ -66,7 +66,7 @@ parameters as well.
6666
... frame='galactic'),
6767
... image_size=10*u.arcmin,
6868
... survey='gps20new')
69-
>>> image
69+
>>> image # doctest: +IGNORE_OUTPUT
7070

7171
[<astropy.io.fits.hdu.image.PrimaryHDU at 0x4013e10>]
7272

docs/xmatch/xmatch.rst

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. doctest-skip-all
2-
31
.. _astroquery_xmatch:
42

53
************************************
@@ -23,20 +21,33 @@ has the following content::
2321
306.01575,33.86756
2422
322.493,12.16703
2523

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+
2635
Next, the xMatch service will be used to find cross matches between the
2736
uploaded file and a VizieR catalogue. The parameters ``cat1`` and ``cat2``
2837
define the catalogues where one of them may point to a local file (in this
2938
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
3140
arcsec to look for counterparts; it is used here to limit the number of rows
3241
in the resulting table for demonstration purposes. Finally, ``colRa1`` and
3342
``colDec1`` are used to denote the column names in the input file.
3443

35-
.. code-block:: python
44+
.. doctest-remote-data::
3645

3746
>>> from astropy import units as u
3847
>>> 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,
4051
... cat2='vizier:II/246/out',
4152
... max_distance=5 * u.arcsec, colRA1='ra',
4253
... colDec1='dec')
@@ -57,6 +68,13 @@ in the resulting table for demonstration purposes. Finally, ``colRa1`` and
5768
0.853178 322.493 12.16703 21295836+1210007 ... EEA 222 0 2451080.6935
5869
4.50395 322.493 12.16703 21295861+1210023 ... EEE 222 0 2451080.6935
5970

71+
72+
.. testcleanup::
73+
74+
>>> from astroquery.utils import cleanup_saved_downloads
75+
>>> cleanup_saved_downloads(['pos_list.csv'])
76+
77+
6078
Reference/API
6179
=============
6280

0 commit comments

Comments
 (0)