Skip to content

Commit 0c0659b

Browse files
committed
updating the docs so the tests run properly
1 parent 86fecd1 commit 0c0659b

File tree

1 file changed

+103
-84
lines changed

1 file changed

+103
-84
lines changed

docs/eso/eso.rst

Lines changed: 103 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ store the password in your operating system. As such you should have to enter yo
3838
correct password only once, and later be able to use this package for automated
3939
interaction with the ESO archive.
4040

41-
.. code-block:: python
41+
.. doctest-skip::
4242

4343
>>> from astroquery.eso import Eso
4444
>>> eso = Eso()
@@ -49,13 +49,13 @@ interaction with the ESO archive.
4949
Authenticating TEST on www.eso.org...
5050
Authentication failed!
5151
>>> # Second example: pretend ICONDOR is a valid username
52-
>>> eso.login("Tinuade", store_password=True) # doctest: +IGNORE_OUTPUT
52+
>>> eso.login("Tinuade", store_password=True) # doctest: +SKIP
5353
Tinuade, enter your ESO password:
5454

5555
Authenticating ICONDOR on www.eso.org...
5656
Authentication successful!
5757
>>> # After the first login, your password has been stored
58-
>>> eso.login("Tinuade")
58+
>>> eso.login("Tinuade") # doctest: +SKIP
5959
Authenticating Tinuade on www.eso.org...
6060
Authentication successful!
6161

@@ -83,7 +83,7 @@ needs to be edited by adding ``username = ICONDOR`` in the ``[eso]`` section.
8383
When configured, the username in the ``login()`` method call can be omitted
8484
as follows:
8585

86-
.. code-block:: python
86+
.. doctest-skip::
8787

8888
>>> from astroquery.eso import Eso
8989
>>> eso = Eso()
@@ -105,13 +105,15 @@ authentication example above. The first thing to do is to identify the instrumen
105105
list of available instrument-specific queries can be obtained with the
106106
:meth:`~astroquery.eso.EsoClass.list_instruments` method.
107107

108-
.. code-block:: python
109108
.. doctest-remote-data::
110109

111-
>>> eso.list_instruments() # doctest: +IGNORE_OUTPUT
112-
['fors1', 'fors2', 'vimos', 'omegacam', 'hawki', 'isaac', 'naco', 'visir', 'vircam',
113-
'apex', 'uves', 'giraffe', 'xshooter', 'muse, 'crires', 'kmos', 'sinfoni',
114-
'amber', 'gravity', 'midi', 'pionier']
110+
>>> from astroquery.eso import Eso
111+
>>> eso = Eso()
112+
>>> eso.list_instruments()
113+
['fors1', 'fors2', 'sphere', 'vimos', 'omegacam', 'hawki', 'isaac', 'naco', 'visir',
114+
'vircam', 'apex', 'giraffe', 'uves', 'xshooter', 'espresso', 'muse', 'crires',
115+
'kmos', 'sinfoni', 'amber', 'gravity', 'matisse', 'midi', 'pionier', 'wlgsu']
116+
115117

116118
In the example above, 22 instruments are available, they correspond to the instruments listed on
117119
the following web page: http://archive.eso.org/cms/eso-data/instrument-specific-query-forms.html.
@@ -123,10 +125,9 @@ Once an instrument is chosen, ``midi`` in our case, the query options for that i
123125
inspected by setting the ``help=True`` keyword of the :meth:`~astroquery.eso.EsoClass.query_instrument`
124126
method.
125127

126-
.. code-block:: python
127128
.. doctest-remote-data::
128129

129-
>>> eso.query_instrument('midi', help=True)
130+
>>> eso.query_instrument('midi', help=True) # doctest: +IGNORE_OUTPUT
130131
List of the column_filters parameters accepted by the midi instrument query.
131132
The presence of a column in the result table can be controlled if prefixed with a [ ] checkbox.
132133
The default columns in the result table are shown as already ticked: [x].
@@ -175,40 +176,40 @@ It is now time to query the ``midi`` instrument for datasets. In the following e
175176
target ``NGC 4151`` between ``2007-01-01`` and ``2008-01-01`` are searched, and the query is configured to
176177
return the observation date column.
177178

178-
.. code-block:: python
179179
.. doctest-remote-data::
180180

181-
>>> table = eso.query_instrument('midi', column_filters={'target':'NGC 4151', 'stime':'2007-01-01', 'etime':'2008-01-01'}, columns=['night'])
181+
>>> table = eso.query_instrument('midi', column_filters={'target':'NGC 4151',
182+
... 'stime':'2007-01-01',
183+
... 'etime':'2008-01-01'},
184+
... columns=['night'])
182185
>>> print(len(table))
183186
38
184187
>>> print(table.columns)
185188
<TableColumns names=('Release Date','Object','RA','DEC','Target Ra Dec','Target l b','DATE OBS','ProgId','DP.ID','OB.ID','OBS.TARG.NAME','DPR.CATG','DPR.TYPE','DPR.TECH','INS.MODE','DIMM Seeing-avg')>
186189
>>> table.pprint(max_width=100)
187-
Object Target Ra Dec Target l b ... INS.MODE DIMM S-avg
188-
----------------------- ----------------------- -------------------- ... -------- -----------
189-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.69 [0.01]
190-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.68 [0.01]
191-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.68 [0.01]
192-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.69 [0.01]
193-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.69 [0.01]
194-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.74 [0.01]
195-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.69 [0.01]
196-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.66 [0.01]
197-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.64 [0.01]
198-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.60 [0.01]
199-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.59 [0.01]
200-
... ... ... ... ... ...
201-
TRACK,OBJECT,DISPERSED 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.70 [0.01]
202-
TRACK,OBJECT,DISPERSED 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.72 [0.01]
203-
SEARCH,OBJECT,DISPERSED 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.62 [0.01]
204-
SEARCH,OBJECT,DISPERSED 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.61 [0.01]
205-
SEARCH,OBJECT,DISPERSED 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.54 [0.01]
206-
SEARCH,OBJECT,DISPERSED 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.53 [0.01]
207-
TRACK,OBJECT,DISPERSED 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.51 [0.01]
208-
TRACK,OBJECT,DISPERSED 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.51 [0.01]
209-
TRACK,OBJECT,DISPERSED 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.51 [0.01]
210-
PHOTOMETRY,OBJECT 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.54 [0.01]
211-
PHOTOMETRY,OBJECT 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.54 [0.01]
190+
Release Date Object RA ... DPR.TECH INS.MODE DIMM Seeing-avg
191+
------------ ----------------------- ---------- ... -------------------- -------- ---------------
192+
2008-02-07 NGC4151 182.635969 ... IMAGE,WINDOW STARINTF 0.69 [0.01]
193+
2008-02-07 NGC4151 182.635969 ... IMAGE,WINDOW STARINTF 0.68 [0.01]
194+
2008-02-07 NGC4151 182.635969 ... IMAGE,WINDOW STARINTF 0.68 [0.01]
195+
2008-02-07 NGC4151 182.635969 ... IMAGE,WINDOW STARINTF 0.69 [0.01]
196+
2008-02-07 NGC4151 182.635969 ... IMAGE,WINDOW STARINTF 0.69 [0.01]
197+
2008-02-07 NGC4151 182.635969 ... IMAGE,WINDOW STARINTF 0.74 [0.01]
198+
2008-02-07 NGC4151 182.635969 ... IMAGE,WINDOW STARINTF 0.69 [0.01]
199+
2008-02-07 NGC4151 182.635969 ... IMAGE,WINDOW STARINTF 0.66 [0.01]
200+
2008-02-07 NGC4151 182.635969 ... IMAGE,WINDOW STARINTF 0.64 [0.01]
201+
2008-02-07 NGC4151 182.635969 ... IMAGE,WINDOW STARINTF 0.60 [0.01]
202+
... ... ... ... ... ... ...
203+
2007-02-07 TRACK,OBJECT,DISPERSED 182.635969 ... INTERFEROMETRY STARINTF 0.72 [0.01]
204+
2007-02-07 SEARCH,OBJECT,DISPERSED 182.635969 ... INTERFEROMETRY STARINTF 0.62 [0.01]
205+
2007-02-07 SEARCH,OBJECT,DISPERSED 182.635969 ... INTERFEROMETRY STARINTF 0.61 [0.01]
206+
2007-02-07 SEARCH,OBJECT,DISPERSED 182.635969 ... INTERFEROMETRY STARINTF 0.54 [0.01]
207+
2007-02-07 SEARCH,OBJECT,DISPERSED 182.635969 ... INTERFEROMETRY STARINTF 0.53 [0.01]
208+
2007-02-07 TRACK,OBJECT,DISPERSED 182.635969 ... INTERFEROMETRY STARINTF 0.51 [0.01]
209+
2007-02-07 TRACK,OBJECT,DISPERSED 182.635969 ... INTERFEROMETRY STARINTF 0.51 [0.01]
210+
2007-02-07 TRACK,OBJECT,DISPERSED 182.635969 ... INTERFEROMETRY STARINTF 0.51 [0.01]
211+
2007-02-07 PHOTOMETRY,OBJECT 182.635969 ... IMAGE,WINDOW,CHOPNOD STARINTF 0.54 [0.01]
212+
2007-02-07 PHOTOMETRY,OBJECT 182.635969 ... IMAGE,WINDOW,CHOPNOD STARINTF 0.54 [0.01]
212213
Length = 38 rows
213214

214215
And indeed, 38 datasets are found, and the ``DATE OBS`` column is in the result table.
@@ -227,7 +228,6 @@ ESO instruments without a specific query interface can be queried with
227228
This is the case of e.g. ``harps``, ``feros`` or the all sky cameras APICAM and MASCOT. Here is an example to
228229
query all-sky images from APICAM with ``luminance`` filter.
229230

230-
.. code-block:: python
231231
.. doctest-remote-data::
232232

233233
>>> eso.ROW_LIMIT = -1 # Return all results
@@ -238,15 +238,30 @@ query all-sky images from APICAM with ``luminance`` filter.
238238
>>> print(table.columns)
239239
<TableColumns names=('OBJECT','RA','DEC','Program_ID','Instrument','Category','Type','Mode','Dataset ID','Release_Date','TPL ID','TPL START','Exptime','Exposure','filter_lambda_min','filter_lambda_max','MJD-OBS','Airmass','DIMM Seeing at Start')>
240240
>>> table.pprint(max_width=100)
241-
OBJECT RA DEC Program_ID ... Filter MJD-OBS Airmass DIMM Seeing at Start
242-
------- ----------- ----------- ------------ ... --------- ------------ ------- --------------------
243-
ALL SKY 09:18:37.39 -24:32:32.7 60.A-9008(A) ... LUMINANCE 58599.987766 1.0 N/A
244-
ALL SKY 09:21:07.68 -24:32:30.1 60.A-9008(A) ... LUMINANCE 58599.989502 1.0 N/A
245-
ALL SKY 09:23:38.98 -24:32:27.5 60.A-9008(A) ... LUMINANCE 58599.99125 1.0 N/A
246-
... ... ... ... ... ... ... ... ...
247-
ALL SKY 11:47:35.12 -24:31:07.7 60.A-9008(A) ... LUMINANCE 58600.091019 1.0 N/A
248-
ALL SKY 11:50:07.40 -24:31:07.6 60.A-9008(A) ... LUMINANCE 58600.092778 1.0 N/A
249-
Length = 50 rows
241+
OBJECT RA DEC Program_ID ... MJD-OBS Airmass DIMM Seeing at Start
242+
------- ----------- ----------- ------------ ... ------------ ------- --------------------
243+
ALL SKY 09:18:37.39 -24:32:32.7 60.A-9008(A) ... 58599.987766 1.0 N/A
244+
ALL SKY 09:21:07.68 -24:32:30.1 60.A-9008(A) ... 58599.989502 1.0 N/A
245+
ALL SKY 09:23:38.98 -24:32:27.5 60.A-9008(A) ... 58599.99125 1.0 N/A
246+
ALL SKY 09:26:10.28 -24:32:24.9 60.A-9008(A) ... 58599.992998 1.0 N/A
247+
ALL SKY 09:28:40.58 -24:32:22.4 60.A-9008(A) ... 58599.994734 1.0 N/A
248+
ALL SKY 09:31:43.93 -24:32:19.4 60.A-9008(A) ... 58599.996852 1.0 N/A
249+
ALL SKY 09:34:15.23 -24:32:17.0 60.A-9008(A) ... 58599.9986 1.0 N/A
250+
ALL SKY 09:36:47.53 -24:32:14.5 60.A-9008(A) ... 58600.000359 1.0 N/A
251+
ALL SKY 09:39:18.82 -24:32:12.2 60.A-9008(A) ... 58600.002106 1.0 N/A
252+
ALL SKY 09:41:49.11 -24:32:09.9 60.A-9008(A) ... 58600.003843 1.0 N/A
253+
... ... ... ... ... ... ... ...
254+
ALL SKY 19:07:39.21 -24:39:35.1 60.A-9008(A) ... 58600.395914 1.0 N/A
255+
ALL SKY 19:10:11.68 -24:39:39.1 60.A-9008(A) ... 58600.397674 1.0 N/A
256+
ALL SKY 19:12:44.15 -24:39:43.2 60.A-9008(A) ... 58600.399433 1.0 N/A
257+
ALL SKY 19:15:15.62 -24:39:47.1 60.A-9008(A) ... 58600.401181 1.0 N/A
258+
ALL SKY 19:17:46.09 -24:39:51.1 60.A-9008(A) ... 58600.402917 1.0 N/A
259+
ALL SKY 19:20:46.65 -24:39:55.8 60.A-9008(A) ... 58600.405 1.0 N/A
260+
ALL SKY 19:23:18.12 -24:39:59.7 60.A-9008(A) ... 58600.406748 1.0 N/A
261+
ALL SKY 19:25:51.60 -24:40:03.7 60.A-9008(A) ... 58600.408519 1.0 N/A
262+
ALL SKY 19:28:22.08 -24:40:07.6 60.A-9008(A) ... 58600.410255 1.0 N/A
263+
ALL SKY 19:30:52.55 -24:40:11.4 60.A-9008(A) ... 58600.411991 1.0 N/A
264+
Length = 207 rows
250265

251266

252267
Query the ESO archive for reduced data
@@ -260,9 +275,9 @@ Identify available surveys
260275

261276
The list of available surveys can be obtained with :meth:`astroquery.eso.EsoClass.list_surveys` as follows:
262277

263-
.. code-block:: python
278+
.. doctest-remote-data::
264279

265-
>>> surveys = eso.list_surveys() # doctest: +REMOTE_DATA
280+
>>> surveys = eso.list_surveys()
266281

267282
Query a specific survey with constraints
268283
----------------------------------------
@@ -271,10 +286,10 @@ Let's assume that we work with the ``HARPS`` survey, and that we are interested
271286
target ``HD203608``.
272287
The archive can be queried as follows:
273288

274-
.. code-block:: python
289+
275290
.. doctest-remote-data::
276291

277-
>>> table = eso.query_surveys('HARPS', cache=False, target="HD203608") # doctest: +REMOTE_DATA
292+
>>> table = eso.query_surveys('HARPS', cache=False, target="HD203608")
278293

279294
The returned table has an ``ARCFILE`` column. It can be used to retrieve the datasets with
280295
:meth:`astroquery.eso.EsoClass.retrieve_data` (see next section).
@@ -287,38 +302,41 @@ Only a small subset of the keywords presents in the data products can be obtaine
287302
with :meth:`~astroquery.eso.EsoClass.query_instrument` or :meth:`~astroquery.eso.EsoClass.query_main`.
288303
There is however a way to get the full primary header of the FITS data products,
289304
using :meth:`~astroquery.eso.EsoClass.get_headers`.
290-
This method is detailed in the example below, continuing with the previously obtained table.
305+
This method is detailed in the example below.
306+
291307

292-
.. code-block:: python
293308
.. doctest-remote-data::
294309

310+
>>> table = eso.query_instrument('midi', column_filters={'target':'NGC 4151',
311+
... 'stime':'2007-01-01',
312+
... 'etime':'2008-01-01'},
313+
... columns=['night'])
314+
295315
>>> table_headers = eso.get_headers(table['DP.ID'])
296-
>>> table_headers.pprint()
297-
ARCFILE BITPIX ... TELESCOP UTC
298-
--------------------------------- ------ ... ------------ -------
299-
MIDI.2007-02-07T07:01:51.000.fits 16 ... ESO-VLTI-U23 25300.5
300-
MIDI.2007-02-07T07:02:49.000.fits 16 ... ESO-VLTI-U23 25358.5
301-
MIDI.2007-02-07T07:03:30.695.fits 16 ... ESO-VLTI-U23 25358.5
302-
MIDI.2007-02-07T07:05:47.000.fits 16 ... ESO-VLTI-U23 25538.5
303-
MIDI.2007-02-07T07:06:28.695.fits 16 ... ESO-VLTI-U23 25538.5
304-
MIDI.2007-02-07T07:09:03.000.fits 16 ... ESO-VLTI-U23 25732.5
305-
MIDI.2007-02-07T07:09:44.695.fits 16 ... ESO-VLTI-U23 25732.5
306-
MIDI.2007-02-07T07:13:09.000.fits 16 ... ESO-VLTI-U23 25978.5
307-
MIDI.2007-02-07T07:13:50.695.fits 16 ... ESO-VLTI-U23 25978.5
308-
MIDI.2007-02-07T07:15:55.000.fits 16 ... ESO-VLTI-U23 26144.5
309-
MIDI.2007-02-07T07:16:36.694.fits 16 ... ESO-VLTI-U23 26144.5
310-
... ... ... ... ...
311-
MIDI.2007-02-07T07:51:13.485.fits 16 ... ESO-VLTI-U23 28190.5
312-
MIDI.2007-02-07T07:52:27.992.fits 16 ... ESO-VLTI-U23 28190.5
313-
MIDI.2007-02-07T07:56:21.000.fits 16 ... ESO-VLTI-U23 28572.5
314-
MIDI.2007-02-07T07:57:35.485.fits 16 ... ESO-VLTI-U23 28572.5
315-
MIDI.2007-02-07T07:59:46.000.fits 16 ... ESO-VLTI-U23 28778.5
316-
MIDI.2007-02-07T08:01:00.486.fits 16 ... ESO-VLTI-U23 28778.5
317-
MIDI.2007-02-07T08:03:42.000.fits 16 ... ESO-VLTI-U23 29014.5
318-
MIDI.2007-02-07T08:04:56.506.fits 16 ... ESO-VLTI-U23 29014.5
319-
MIDI.2007-02-07T08:06:11.013.fits 16 ... ESO-VLTI-U23 29014.5
320-
MIDI.2007-02-07T08:08:19.000.fits 16 ... ESO-VLTI-U23 29288.5
321-
MIDI.2007-02-07T08:09:33.506.fits 16 ... ESO-VLTI-U23 29288.5
316+
>>> table_headers.pprint() # doctest: +SKIP
317+
DP.ID SIMPLE BITPIX ... HIERARCH ESO OCS TPL NFILE HIERARCH ESO OCS EXPO1 FNAME3
318+
---------------------------- ------ ------ ... -------------------------- ---------------------------------
319+
MIDI.2007-02-07T07:01:51.000 True 16 ... 0
320+
MIDI.2007-02-07T07:02:49.000 True 16 ... 0
321+
MIDI.2007-02-07T07:03:30.695 True 16 ... 0
322+
MIDI.2007-02-07T07:05:47.000 True 16 ... 0
323+
MIDI.2007-02-07T07:06:28.695 True 16 ... 0
324+
MIDI.2007-02-07T07:09:03.000 True 16 ... 0
325+
MIDI.2007-02-07T07:09:44.695 True 16 ... 0
326+
MIDI.2007-02-07T07:13:09.000 True 16 ... 0
327+
MIDI.2007-02-07T07:13:50.695 True 16 ... 0
328+
MIDI.2007-02-07T07:15:55.000 True 16 ... 0
329+
... ... ... ... ... ...
330+
MIDI.2007-02-07T07:52:27.992 True 16 ... 8 MIDI.2007-02-07T07:52:27.992.fits
331+
MIDI.2007-02-07T07:56:21.000 True 16 ... 0
332+
MIDI.2007-02-07T07:57:35.485 True 16 ... 0
333+
MIDI.2007-02-07T07:59:46.000 True 16 ... 0
334+
MIDI.2007-02-07T08:01:00.486 True 16 ... 0
335+
MIDI.2007-02-07T08:03:42.000 True 16 ... 8
336+
MIDI.2007-02-07T08:04:56.506 True 16 ... 8
337+
MIDI.2007-02-07T08:06:11.013 True 16 ... 8 MIDI.2007-02-07T08:06:11.013.fits
338+
MIDI.2007-02-07T08:08:19.000 True 16 ... 8 MIDI.2007-02-07T08:06:11.013.fits
339+
MIDI.2007-02-07T08:09:33.506 True 16 ... 8 MIDI.2007-02-07T08:06:11.013.fits
322340
Length = 38 rows
323341
>>> len(table_headers.columns)
324342
340
@@ -333,9 +351,9 @@ Downloading datasets from the archive
333351
Continuing from the query with constraints example, the first two datasets are selected,
334352
using their data product IDs ``DP.ID`` (or ``ARCFILE`` for surveys), and retrieved from the ESO archive.
335353

336-
.. code-block:: python
354+
.. doctest-skip::
337355

338-
>>> data_files = eso.retrieve_data(table['DP.ID'][:2]) # doctest: +REMOTE_DATA
356+
>>> data_files = eso.retrieve_data(table['DP.ID'][:2])
339357
Staging request...
340358
Downloading files...
341359
Downloading MIDI.2007-02-07T07:01:51.000.fits.Z...
@@ -358,12 +376,13 @@ would like to download datasets from an existing request, either submitted
358376
through the functions here or externally, call ``retrieve_data`` with the
359377
``request_id`` option:
360378

361-
.. code-block:: python
379+
.. doctest-skip::
362380

363381
>>> data_files = eso.retrieve_data(table['DP.ID'][:2], request_id=999999)
364382

365383
The ``request_id`` can be found in the automatic email sent by the archive after
366-
staging the initial request, i.e., https://dataportal.eso.org/rh/requests/[USERNAME]/{request_id}. A summary of your available requests is shown at https://dataportal.eso.org/rh/requests/[USERNAME]/recentRequests.
384+
staging the initial request, i.e., https://dataportal.eso.org/rh/requests/[USERNAME]/{request_id}.
385+
A summary of your available requests is shown at https://dataportal.eso.org/rh/requests/[USERNAME]/recentRequests.
367386

368387
Note: The function does check that the specified retrieval URL based on
369388
``request_id`` is valid and then that the datasets indicated there are

0 commit comments

Comments
 (0)