Skip to content

Commit a6806a1

Browse files
authored
Merge pull request #1968 from tinumide/ned-doc-cleanup
Ned documentation cleanup
2 parents 5c8d9b2 + c8e5af7 commit a6806a1

File tree

1 file changed

+96
-101
lines changed

1 file changed

+96
-101
lines changed

docs/ned/ned.rst

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

53
******************************
@@ -15,21 +13,23 @@ and spectra queries on the other hand return the results as a list of
1513
`~astropy.io.fits.HDUList` objects. Below are some working examples that
1614
illustrate common use cases.
1715

16+
1817
Query an object
1918
---------------
2019

2120
This may be used to query the object *by name* from the NED service. For
2221
instance if you want to query NGC 224
2322

24-
.. code-block:: python
23+
.. doctest-remote-data::
2524

2625
>>> from astroquery.ned import Ned
2726
>>> result_table = Ned.query_object("NGC 224")
2827
>>> print(result_table) # an astropy.table.Table
29-
30-
No. Object Name RA(deg) ... Redshift Points Diameter Points Associations
28+
No. Object Name RA ... Redshift Points Diameter Points Associations
29+
degrees ...
3130
--- ----------- ---------- ... --------------- --------------- ------------
32-
1 MESSIER 031 10.68479 ... 26 7 2
31+
1 MESSIER 031 10.68479 ... 37 7 2
32+
3333

3434
Query a region
3535
--------------
@@ -43,38 +43,32 @@ be specified as a string in which case it will be parsed using
4343
arcmin. Another optional parameter is the equinox if coordinates are
4444
specified. By default this is J2000.0 but can also be set to B1950.0.
4545

46-
.. code-block:: python
46+
.. doctest-remote-data::
4747

4848
>>> from astroquery.ned import Ned
4949
>>> import astropy.units as u
5050
>>> result_table = Ned.query_region("3c 273", radius=0.05 * u.deg)
5151
>>> print(result_table)
52+
No. Object Name RA ... Diameter Points Associations
53+
degrees ...
54+
--- -------------------------- ---------- ... --------------- ------------
55+
1 WISEA J122855.03+020309.1 187.22917 ... 0 0
56+
2 SSTSL2 J122855.02+020313.7 187.22925 ... 0 0
57+
3 SSTSL2 J122855.23+020341.5 187.23013 ... 0 0
58+
4 SSTSL2 J122855.36+020346.9 187.23068 ... 0 0
59+
... ... ... ... ... ...
60+
863 SSTSL2 J122918.24+020330.7 187.326 ... 0 0
61+
864 SDSS J122918.38+020323.4 187.3266 ... 4 0
62+
865 SSTSL2 J122918.52+020338.9 187.32718 ... 0 0
63+
866 SSTSL2 J122918.64+020326.7 187.32767 ... 0 0
64+
Length = 866 rows
5265

53-
No. Object Name ... Diameter Points Associations
54-
--- ------------------------ ... --------------- ------------
55-
1 3C 273:[PWC2011] 3640 ... 0 0
56-
2 3C 273:[PWC2011] 3592 ... 0 0
57-
3 3C 273:[PWC2011] 3593 ... 0 0
58-
4 3C 273:[PWC2011] 3577 ... 0 0
59-
5 SDSS J122856.35+020325.3 ... 3 0
60-
6 3C 273:[PWC2011] 3553 ... 0 0
61-
7 3C 273:[PWC2011] 3544 ... 0 0
62-
8 3C 273:[PWC2011] 3521 ... 0 0
63-
... ... ... ... ...
64-
346 3C 273:[PWC2011] 2370 ... 0 0
65-
347 SDSS J122917.00+020436.3 ... 4 0
66-
348 3C 273:[PWC2011] 2338 ... 0 0
67-
349 3C 273:[PWC2011] 2349 ... 0 0
68-
350 SDSS J122917.52+020301.5 ... 4 0
69-
351 3C 273:[PWC2011] 2326 ... 0 0
70-
352 SDSS J122917.72+020356.8 ... 3 0
71-
353 SDSS J122918.38+020323.4 ... 4 0
7266

7367
Instead of using the name, the target may also be specified via
7468
coordinates. Any of the coordinate systems available in `astropy.coordinates`
7569
may be used (ICRS, Galactic, FK4, FK5). Note also the use of the equinox keyword argument:
7670

77-
.. code-block:: python
71+
.. doctest-remote-data::
7872

7973
>>> from astroquery.ned import Ned
8074
>>> import astropy.units as u
@@ -83,14 +77,20 @@ may be used (ICRS, Galactic, FK4, FK5). Note also the use of the equinox keyword
8377
... unit=(u.deg, u.deg), frame='fk4')
8478
>>> result_table = Ned.query_region(co, radius=0.1 * u.deg, equinox='B1950.0')
8579
>>> print(result_table)
80+
No. Object Name RA ... Diameter Points Associations
81+
degrees ...
82+
--- ------------------------- ---------- ... --------------- ------------
83+
1 WISEA J035137.90+384313.7 57.90793 ... 0 0
84+
2 WISEA J035138.59+384305.6 57.91062 ... 0 0
85+
3 WISEA J035139.28+384324.4 57.91371 ... 0 0
86+
4 WISEA J035139.77+384507.4 57.91572 ... 0 0
87+
... ... ... ... ... ...
88+
631 WISEA J035237.78+384519.3 58.15743 ... 0 0
89+
632 WISEA J035238.62+384431.9 58.16083 ... 0 0
90+
633 WISEA J035238.74+384352.1 58.16145 ... 0 0
91+
634 WISEA J035238.84+384437.0 58.16177 ... 0 0
92+
Length = 634 rows
8693

87-
No. Object Name ... Diameter Points Associations
88-
--- ----------------------- ... --------------- ------------
89-
1 2MASX J03514350+3841573 ... 2 0
90-
2 2MASX J03514563+3839573 ... 2 0
91-
3 NVSS J035158+384747 ... 0 0
92-
4 2MASX J03521115+3849288 ... 2 0
93-
5 2MASX J03521844+3840179 ... 2 0
9494

9595
Query in the IAU format
9696
^^^^^^^^^^^^^^^^^^^^^^^
@@ -104,19 +104,25 @@ queries). It defaults to ``B1950`` but again it may be set to ``J2000.0``. Note
104104
that Ned report results by searching in a 15 arcmin radius around the specified
105105
target.
106106

107-
.. code-block:: python
107+
.. doctest-remote-data::
108108

109109
>>> from astroquery.ned import Ned
110110
>>> result_table = Ned.query_region_iau('1234-423', frame='SuperGalactic', equinox='J2000.0')
111111
>>> print(result_table)
112+
No. Object Name RA ... Diameter Points Associations
113+
degrees ...
114+
--- ------------------------- ---------- ... --------------- ------------
115+
1 WISEA J123639.37-423822.9 189.16406 ... 0 0
116+
2 WISEA J123639.47-423656.3 189.16458 ... 0 0
117+
3 WISEA J123639.61-423637.9 189.16506 ... 0 0
118+
4 WISEA J123639.91-423709.9 189.1663 ... 0 0
119+
... ... ... ... ... ...
120+
760 2MASS J12374631-4236174 189.44299 ... 0 0
121+
761 WISEA J123746.44-423727.9 189.44359 ... 0 0
122+
762 WISEA J123746.48-423838.1 189.4437 ... 0 0
123+
763 WISEA J123747.07-423742.9 189.44616 ... 0 0
124+
Length = 763 rows
112125

113-
No. Object Name RA(deg) ... Diameter Points Associations
114-
--- ----------------------- ---------- ... --------------- ------------
115-
1 SUMSS J123651-423554 189.21425 ... 0 0
116-
2 SUMSS J123658-423457 189.245 ... 0 0
117-
3 SUMSS J123711-424119 189.29663 ... 0 0
118-
4 2MASX J12373141-4239342 189.38083 ... 2 0
119-
5 2MASX J12373567-4239122 189.39908 ... 2 0
120126

121127
Query a reference code for objects
122128
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -125,42 +131,36 @@ These queries can be used to retrieve all objects that appear in the specified
125131
19 digit reference code. These are similar to the
126132
:meth:`~astroquery.simbad.SimbadClass.query_bibobj` queries.
127133

128-
.. code-block:: python
134+
.. doctest-remote-data::
129135

130136
>>> from astroquery.ned import Ned
131137
>>> result_table = Ned.query_refcode('1997A&A...323...31K')
132138
>>> print(result_table)
139+
No. Object Name RA ... Diameter Points Associations
140+
degrees ...
141+
--- ------------------------- ---------- ... --------------- ------------
142+
1 NGC 0262 12.19642 ... 8 0
143+
2 NGC 0449 19.0302 ... 7 0
144+
3 NGC 0591 23.38028 ... 7 0
145+
4 UGC 01214 25.99084 ... 7 0
146+
... ... ... ... ... ...
147+
33 WISEA J202325.39+113134.6 305.85577 ... 2 0
148+
34 UGC 12149 340.28163 ... 8 0
149+
35 MRK 0522 345.07954 ... 4 0
150+
36 NGC 7674 351.98635 ... 8 0
151+
Length = 36 rows
133152

134-
No. Object Name RA(deg) ... Diameter Points Associations
135-
--- ----------------------- ---------- ... --------------- ------------
136-
1 NGC 0262 12.19642 ... 8 0
137-
2 NGC 0449 19.0302 ... 7 0
138-
3 NGC 0591 23.38028 ... 7 0
139-
4 UGC 01214 25.99084 ... 7 0
140-
5 2MASX J01500266-0725482 27.51124 ... 2 0
141-
6 MESSIER 077 40.66963 ... 8 0
142-
7 MRK 0599 41.94759 ... 6 0
143-
8 MRK 1058 42.46596 ... 4 0
144-
... ... ... ... ... ...
145-
30 NGC 5643 218.16977 ... 18 0
146-
31 SBS 1439+537 220.1672 ... 2 3
147-
32 MRK 1388 222.65772 ... 6 0
148-
33 2MASX J20232535+1131352 305.85577 ... 2 0
149-
34 UGC 12149 340.28163 ... 8 0
150-
35 MRK 0522 345.07954 ... 4 0
151-
36 NGC 7674 351.98635 ... 8 0
152153

153154
Image and Spectra Queries
154155
^^^^^^^^^^^^^^^^^^^^^^^^^
155156

156157
The image queries return a list of `~astropy.io.fits.HDUList` objects for the
157158
specified name. For instance:
158159

159-
.. code-block:: python
160+
.. doctest-remote-data::
160161

161162
>>> from astroquery.ned import Ned
162-
>>> images = Ned.get_images("m1")
163-
163+
>>> images = Ned.get_images("m1") # doctest: +IGNORE_OUTPUT
164164
Downloading http://ned.ipac.caltech.edu/dss1B2/Bb/MESSIER_001:I:103aE:dss1.fits.gz
165165
|===========================================| 32k/ 32k (100.00%) 00s
166166
Downloading http://ned.ipac.caltech.edu/img5/1995RXCD3.T...0000C/p083n22a:I:0.1-2.4keV:cop1995.fits.gz
@@ -171,9 +171,7 @@ specified name. For instance:
171171
|===========================================| 52k/ 52k (100.00%) 01s
172172
Downloading http://ned.ipac.caltech.edu/img5/1998RXCD8.T...0000C/h083n22a:I:0.1-2.4keV:cps1998.fits.gz
173173
|===========================================| 35k/ 35k (100.00%) 00s
174-
175-
>>> images # may be used to do further processing on individual cutouts
176-
174+
>>> images # doctest: +IGNORE_OUTPUT
177175
[[<astropy.io.fits.hdu.image.PrimaryHDU at 0x4311890>],
178176
[<astropy.io.fits.hdu.image.PrimaryHDU at 0x432b350>],
179177
[<astropy.io.fits.hdu.image.PrimaryHDU at 0x3e9c5d0>],
@@ -182,49 +180,47 @@ specified name. For instance:
182180

183181
To get the URLs of the downloadable FITS images:
184182

185-
.. code-block:: python
183+
.. doctest-remote-data::
186184

187185
>>> from astroquery.ned import Ned
188186
>>> image_list = Ned.get_image_list("m1")
189-
>>> image_list
190-
187+
>>> image_list # doctest: +NORMALIZE_WHITESPACE
191188
['http://ned.ipac.caltech.edu/dss1B2/Bb/MESSIER_001:I:103aE:dss1.fits.gz',
192-
'http://ned.ipac.caltech.edu/img5/1995RXCD3.T...0000C/p083n22a:I:0.1-2.4keV:cop1995.fits.gz',
193-
'http://ned.ipac.caltech.edu/img5/1996RXCD6.T...0000C/p083n22a:I:0.1-2.4keV:cps1996.fits.gz',
194-
'http://ned.ipac.caltech.edu/img5/1995RXCD3.T...0000C/p084n22a:I:0.1-2.4keV:cop1995.fits.gz',
195-
'http://ned.ipac.caltech.edu/img5/1998RXCD8.T...0000C/h083n22a:I:0.1-2.4keV:cps1998.fits.gz']
189+
'http://ned.ipac.caltech.edu/img/1995RXCD3.T...0000C/p084n22a:I:0.1-2.4keV:cop1995.fits.gz',
190+
'http://ned.ipac.caltech.edu/img/1996RXCD6.T...0000C/p083n22a:I:0.1-2.4keV:cps1996.fits.gz',
191+
'http://ned.ipac.caltech.edu/img/1998RXCD8.T...0000C/h083n22a:I:0.1-2.4keV:cps1998.fits.gz',
192+
'http://ned.ipac.caltech.edu/img/1995RXCD3.T...0000C/p083n22a:I:0.1-2.4keV:cop1995.fits.gz']
193+
196194

197195
Spectra can also be fetched in the same way:
198196

199-
.. code-block:: python
197+
.. doctest-remote-data::
200198

201199
>>> from astroquery.ned import Ned
202-
>>> spectra = Ned.get_spectra('3c 273')
203-
200+
>>> spectra = Ned.get_spectra('3c 273') # doctest: +IGNORE_OUTPUT
204201
Downloading http://ned.ipac.caltech.edu/spc1/2009A+A...495.1033B/3C_273:S:B:bcc2009.fits.gz
205202
|===========================================| 7.8k/7.8k (100.00%) 00s
206203
Downloading http://ned.ipac.caltech.edu/spc1/1992ApJS...80..109B/PG_1226+023:S:B_V:bg1992.fits.gz
207204
|===========================================| 5.0k/5.0k (100.00%) 00s
208205
Downloading http://ned.ipac.caltech.edu/spc1/2009A+A...495.1033B/3C_273:S:RI:bcc2009.fits.gz
209206
|===========================================| 9.4k/9.4k (100.00%) 00s
210-
211-
>>> spectra
212-
207+
>>> spectra # doctest: +IGNORE_OUTPUT
213208
[[<astropy.io.fits.hdu.image.PrimaryHDU at 0x41b4190>],
214209
[<astropy.io.fits.hdu.image.PrimaryHDU at 0x41b0990>],
215210
[<astropy.io.fits.hdu.image.PrimaryHDU at 0x430a450>]]
216211

212+
217213
Similarly the list of URLs for spectra of a particular object may be fetched:
218214

219-
.. code-block:: python
215+
.. doctest-remote-data::
220216

221217
>>> from astroquery.ned import Ned
222-
>>> image_list = Ned.get_image_list("3c 273", item='spectra')
223-
>>> image_list
218+
>>> spectra_list = Ned.get_image_list("3c 273", item='spectra')
219+
>>> spectra_list
220+
['http://ned.ipac.caltech.edu/spc1/1992/1992ApJS...80..109B/PG_1226+023:S:B_V:bg1992.fits.gz',
221+
'http://ned.ipac.caltech.edu/spc1/2009/2009A+A...495.1033B/3C_273:S:B:bcc2009.fits.gz',
222+
'http://ned.ipac.caltech.edu/spc1/2009/2009A+A...495.1033B/3C_273:S:RI:bcc2009.fits.gz']
224223

225-
['http://ned.ipac.caltech.edu/spc1/2009A+A...495.1033B/3C_273:S:B:bcc2009.fits.gz',
226-
'http://ned.ipac.caltech.edu/spc1/1992ApJS...80..109B/PG_1226+023:S:B_V:bg1992.fits.gz',
227-
'http://ned.ipac.caltech.edu/spc1/2009A+A...495.1033B/3C_273:S:RI:bcc2009.fits.gz']
228224

229225
Fetching other data tables for an object
230226
----------------------------------------
@@ -235,26 +231,25 @@ queries. These take a keyword argument ``table``, which may be set to one of
235231
instance the ``table=photometry`` will fetch all the relevant photometric data
236232
for the specified object. We look at a simple example:
237233

238-
.. code-block:: python
234+
.. doctest-remote-data::
239235

240236
>>> from astroquery.ned import Ned
241237
>>> result_table = Ned.get_table("3C 273", table='positions')
242238
>>> print(result_table)
239+
No. RA ... Published Frequence Mode Qualifiers
240+
...
241+
--- -------------- ... ------------------------ -------------------------
242+
0 12h29m06.6997s ...
243+
1 12h29m06.7000s ... Uncertain origin
244+
2 12h29m06.7000s ... Uncertain origin
245+
3 12h29m06.7000s ... Uncertain origin
246+
... ... ... ... ...
247+
113 12h29m07.9s ... Uncertain origin
248+
114 12h29m04s ... Uncertain origin
249+
115 12h29m06s ... Uncertain origin
250+
116 12h29m08s ... Uncertain origin
251+
Length = 117 rows
243252

244-
No. RA DEC ... Published Frame Published Frequence Mode Qualifiers
245-
--- -------------- -------------- ... --------------- ------------------------- --------------------------------------------------------------
246-
0 12h29m06.6997s +02d03m08.598s ...
247-
1 12h29m06.6997s +02d03m08.598s ... ICR Multiple line measurement From new, raw data
248-
2 12h29m06.699s +02d03m08.59s ... ICR Broad-band measurement From new, raw data
249-
3 12h29m06.64s +02d03m09.0s ... FK4 Broad-band measurement From reprocessed raw data; Corrected for contaminating sources
250-
4 12h29m06.79s +02d03m08.0s ... FK5 Broad-band measurement From new, raw data; Systematic errors in RA and Dec corrected
251-
5 12h29m06.05s +02d02m57.1s ... FK4 Broad-band measurement From new, raw data
252-
6 12h29m05.60s +02d03m09.0s ... FK5 Broad-band measurement From new, raw data
253-
7 12h29m04.5s +02d03m03s ... Broad-band measurement From new, raw data
254-
8 12h29m07.55s +02d03m02.3s ... FK4 Broad-band measurement From reprocessed raw data
255-
9 12h29m06.05s +02d03m11.3s ... FK4 Broad-band measurement From new, raw data
256-
10 12h29m06.5s +02d02m53s ... FK4 Broad-band measurement From new, raw data
257-
11 12h29m06.5s +02d02m52s ... FK4 Broad-band measurement From reprocessed raw data
258253

259254
Reference/API
260255
=============

0 commit comments

Comments
 (0)