1
- .. doctest-skip-all
2
-
3
1
.. _astroquery.nasa_ads :
4
2
5
3
****************************************
@@ -23,36 +21,30 @@ Examples
23
21
Search works by specific identifier
24
22
-----------------------------------
25
23
.. code-block :: python
24
+ .. doctest-skip ::
26
25
27
- from astroquery import nasa_ads as na
28
-
26
+ >>> from astroquery import nasa_ads as na
29
27
# if you don't store your token as an environment variable
30
28
# or in a file, give it here
31
- na.ADS .TOKEN = ' your-token-goes-here'
32
-
29
+ >>> na.ADS .TOKEN = ' your-token-goes-here'
33
30
# by default, the top 10 records are returned, sorted in
34
31
# reverse chronological order. This can be changed
35
-
36
32
# change the number of rows returned
37
- na.ADS .NROWS = 20
33
+ >>> na.ADS .NROWS = 20
38
34
# change the sort order
39
- na.ADS .SORT = ' bibcode desc'
35
+ >>> na.ADS .SORT = ' bibcode desc'
40
36
# change the fields that are returned (enter as strings in a list)
41
- na.ADS .ADS_FIELDS = [' author' ,' title' ,' abstract' ,' pubdate' ]
42
-
37
+ >>> na.ADS .ADS_FIELDS = [' author' ,' title' ,' abstract' ,' pubdate' ]
43
38
# the "^" makes ADS to return only papers where Persson
44
39
# is first author
45
- results = na.ADS .query_simple(' ^Persson Origin of water\
46
- around deeply embedded low-mass protostars' ) results[0 ].title
47
-
40
+ >>> results = na.ADS .query_simple(' ^Persson Origin of water around deeply embedded low-mass protostars' )
41
+ >>> results[0 ].title
48
42
# to sort after publication date
49
- results.sort([' pubdate' ])
50
-
43
+ >>> results.sort([' pubdate' ])
51
44
# get the title of the last hit
52
- title = results[- 1 ][' title' ][0 ]
53
-
45
+ >>> title = results[- 1 ][' title' ][0 ]
54
46
# printout the authors of the last hit
55
- print (results[- 1 ][' author' ])
47
+ >>> print (results[- 1 ][' author' ])
56
48
57
49
58
50
Reference/API
@@ -64,6 +56,3 @@ Reference/API
64
56
.. _nasa_ads : http://adsabs.harvard.edu/
65
57
.. _SAO/NASA Astrophysics Data System : https://ui.adsabs.harvard.edu/
66
58
.. _account settings. : https://ui.adsabs.harvard.edu/#user/settings/token
67
-
68
-
69
-
0 commit comments