Skip to content

Commit b1361d7

Browse files
committed
DOC: fixing up more doctests and sphinc for nvas and oac
1 parent 20ced03 commit b1361d7

File tree

2 files changed

+23
-39
lines changed

2 files changed

+23
-39
lines changed

docs/nvas/nvas.rst

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,12 @@ optionally specify are the ``radius`` and the frequency band for which the image
1919
must be fetched. You can also specify the maximum allowable noise level in mJy
2020
via the ``max_rms`` keyword parameter. By default this is set to 10000 mJy
2121

22-
.. code-block:: python
2322
.. doctest-remote-data::
2423

2524
>>> from astroquery.nvas import Nvas
2625
>>> import astropy.units as u
27-
>>> images = Nvas.get_images("3c 273", radius=2*u.arcsec, band="K", max_rms=500) # doctest: +IGNORE_OUTPUT
26+
>>> images = Nvas.get_images("3c 273", radius=2*u.arcsec, band="K", max_rms=500) # doctest: +IGNORE_WARNINGS
2827
1 images found.
29-
Downloading http://www.vla.nvas.edu/astro/archive/pipeline/position/J122906.7+020308/22.4I0.37_TEST_1995NOV15_1_352.U55.6S.imfits
30-
|===========================================| 10M/ 10M (100.00%) 19m37s
3128
>>> images # doctest: +IGNORE_OUTPUT
3229
[[<astropy.io.fits.hdu.image.PrimaryHDU at 0x3376150>]]
3330

@@ -43,16 +40,14 @@ the bands. Here's a list of the valid values that this parameter can take. ::
4340
Let's look at an example that uses coordinates for specifying the search
4441
centre.
4542

46-
.. code-block:: python
4743
.. doctest-remote-data::
4844

4945
>>> from astroquery.nvas import Nvas
5046
>>> import astropy.coordinates as coord
5147
>>> import astropy.units as u
5248
>>> images = Nvas.get_images(coord.SkyCoord(49.489, -0.37,
53-
... unit=(u.deg, u.deg), frame='galactic'),
54-
... band="K") # doctest: +IGNORE_OUTPUT
55-
49+
... unit=(u.deg, u.deg), frame='galactic'), band="K") # doctest: +IGNORE_WARNINGS
50+
2 images found.
5651

5752
You may also fetch UVfits files rather than the IMfits files which is the
5853
default. To do this simply set the ``get_uvfits`` to ``True``, in any of the query
@@ -62,15 +57,14 @@ actual images themselves. To do this use the
6257
arguments as :meth:`~astroquery.nvas.NvasClass.get_images` above except for the
6358
``verbose`` argument which isn't relevant in this case.
6459

65-
.. code-block:: python
6660
.. doctest-remote-data::
6761

6862
>>> from astroquery.nvas import Nvas
6963
>>> import astropy.coordinates as coord
7064
>>> import astropy.units as u
7165
>>> image_urls = Nvas.get_image_list("05h34m31.94s 22d00m52.2s",
7266
... radius='0d0m0.6s', max_rms=500) # doctest: +IGNORE_WARNINGS
73-
>>> image_urls # doctest: +IGNORE_OUTPUT
67+
>>> image_urls
7468
['http://www.vla.nrao.edu/astro/archive/pipeline/position/J053431.5+220114/1.51I4.12_T75_1986AUG12_1_118.U3.06M.imfits',
7569
'http://www.vla.nrao.edu/astro/archive/pipeline/position/J053431.5+220114/1.51I3.92_T75_1986AUG20_1_373.U2.85M.imfits',
7670
'http://www.vla.nrao.edu/astro/archive/pipeline/position/J053431.5+220114/4.89I1.22_T75_1986AUG12_1_84.8U2.73M.imfits',

docs/oac/oac.rst

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ at the `OAC API Github Repository <https://github.com/astrocatalogs/OACAPI>`_
1414

1515
Primary Methods
1616
===============
17+
1718
There are two primary methods for submitting API queries. The first is query_object
1819
which can be used to search the OAC based on an event name. Multiple events can
1920
be retrieved by submitting a list of event names.
2021

2122
The default behavior returns a top-level list of all available metadata for the
2223
queried event(s).
2324

24-
.. code-block:: python
2525
.. doctest-remote-data::
2626

2727
>>> from astroquery.oac import OAC
@@ -30,24 +30,22 @@ queried event(s).
3030
The query can be further refined by using the available QUANTITY and ATTRIBUTE
3131
options. For example, to retrieve the light curve for an object:
3232

33-
.. code-block:: python
3433
.. doctest-remote-data::
3534

3635
>>> photometry = OAC.query_object("GW170817", quantity="photometry",
37-
... attribute=["time", "magnitude",
38-
... "e_magnitude", "band",
39-
... "instrument"])
36+
... attribute=["time", "magnitude",
37+
... "e_magnitude", "band",
38+
... "instrument"])
4039

4140
The results of a query can be further refined by using the ARGUMENT option
4241

43-
.. code-block:: python
4442
.. doctest-remote-data::
4543

4644
>>> photometry = OAC.query_object("GW170817", quantity="photometry",
47-
... attribute=["time", "magnitude",
48-
... "e_magnitude", "band",
49-
... "instrument"],
50-
... argument=["band=i"])
45+
... attribute=["time", "magnitude",
46+
... "e_magnitude", "band",
47+
... "instrument"],
48+
... argument=["band=i"])
5149

5250
The second method available is query_region which performs a cone or box
5351
search for a given set of coordinates. Coordinates can be submitted as an Astropy
@@ -57,7 +55,6 @@ a single set of coordinates.
5755

5856
For this example, we first establish coordinates and search parameters:
5957

60-
.. code-block:: python
6158
.. doctest-remote-data::
6259

6360
>>> import astropy.coordinates as coord
@@ -73,27 +70,22 @@ For this example, we first establish coordinates and search parameters:
7370

7471
An example cone search:
7572

76-
.. code-block:: python
7773
.. doctest-remote-data::
7874

79-
>>> photometry = OAC.query_region(coordinates=test_coords,
80-
... radius=test_radius,
81-
... quantity="photometry",
82-
... attribute=["time", "magnitude",
83-
... "e_magnitude", "band",
84-
... "instrument"])
75+
>>> photometry = OAC.query_region(coordinates=test_coords, radius=test_radius,
76+
... quantity="photometry",
77+
... attribute=["time", "magnitude",
78+
... "e_magnitude", "band", "instrument"])
8579

8680
An example box search:
8781

88-
.. code-block:: python
8982
.. doctest-remote-data::
9083

9184
>>> photometry = OAC.query_region(coordinates=test_coords,
92-
... width=test_width, height=test_height,
93-
... quantity="photometry",
94-
... attribute=["time", "magnitude",
95-
... "e_magnitude", "band",
96-
... "instrument"])
85+
... width=test_width, height=test_height,
86+
... quantity="photometry",
87+
... attribute=["time", "magnitude",
88+
... "e_magnitude", "band", "instrument"])
9789

9890
As with the query_object method, searches using query_region can be refined
9991
using the QUANTITY, ATTRIBUTE, and ARGUMENT options. The complete list of
@@ -105,13 +97,13 @@ data_format option.
10597

10698
Tailored Methods
10799
================
100+
108101
There are three tailed search methods available to users to facilitate quick
109102
retrieval of common data products.
110103

111104
The method get_photometry is designed to quickly return the photometry for a
112105
given event or list of events.
113106

114-
.. code-block:: python
115107
.. doctest-remote-data::
116108

117109
>>> from astroquery.oac import OAC
@@ -122,17 +114,16 @@ query_object. More complex queries should use the base query_object method.
122114

123115
For example, to retrieve only R-band photometry:
124116

125-
.. code-block:: python
117+
.. doctest-remote-data::
126118

127-
>>> photometry = OAC.get_photometry("SN2014J", argument="band=R") # doctest: +REMOTE_DATA
119+
>>> photometry = OAC.get_photometry("SN2014J", argument="band=R")
128120

129121
The output is an Astropy table.
130122

131123
The method get_single_spectrum is designed to retrieve a single spectrum for a
132124
single object at a specified time. The time should be given in MJD, but does
133125
not have to be exact. The query will return the spectrum that is closest in time.
134126

135-
.. code-block:: python
136127
.. doctest-remote-data::
137128

138129
>>> from astroquery.oac import OAC
@@ -144,7 +135,6 @@ The output is an Astropy table.
144135
The method get_spectra is designed to return all available spectra for an event
145136
or list of events.
146137

147-
.. code-block:: python
148138
.. doctest-remote-data::
149139

150140
>>> from astroquery.oac import OAC

0 commit comments

Comments
 (0)