Skip to content

Commit 5ac1834

Browse files
authored
Merge pull request #1972 from tinumide/eso-doc-cleanup
Eso documentation cleanup
2 parents d40d316 + 4519f73 commit 5ac1834

File tree

1 file changed

+107
-85
lines changed

1 file changed

+107
-85
lines changed

docs/eso/eso.rst

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

53
******************************
@@ -40,12 +38,12 @@ store the password in your operating system. As such you should have to enter yo
4038
correct password only once, and later be able to use this package for automated
4139
interaction with the ESO archive.
4240

43-
.. code-block:: python
41+
.. doctest-skip::
4442

4543
>>> from astroquery.eso import Eso
4644
>>> eso = Eso()
4745
>>> # First example: TEST is not a valid username, it will fail
48-
>>> eso.login("TEST") # doctest: +SKIP
46+
>>> eso.login("TEST")
4947
TEST, enter your ESO password:
5048

5149
Authenticating TEST on www.eso.org...
@@ -85,7 +83,7 @@ needs to be edited by adding ``username = ICONDOR`` in the ``[eso]`` section.
8583
When configured, the username in the ``login()`` method call can be omitted
8684
as follows:
8785

88-
.. code-block:: python
86+
.. doctest-skip::
8987

9088
>>> from astroquery.eso import Eso
9189
>>> eso = Eso()
@@ -107,12 +105,15 @@ authentication example above. The first thing to do is to identify the instrumen
107105
list of available instrument-specific queries can be obtained with the
108106
:meth:`~astroquery.eso.EsoClass.list_instruments` method.
109107

110-
.. code-block:: python
108+
.. doctest-remote-data::
109+
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']
111116

112-
>>> eso.list_instruments()
113-
['fors1', 'fors2', 'vimos', 'omegacam', 'hawki', 'isaac', 'naco', 'visir', 'vircam',
114-
'apex', 'uves', 'giraffe', 'xshooter', 'muse, 'crires', 'kmos', 'sinfoni',
115-
'amber', 'gravity', 'midi', 'pionier']
116117

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

127-
.. code-block:: python
128+
.. 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,39 +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
179+
.. doctest-remote-data::
179180

180-
>>> 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'])
181185
>>> print(len(table))
182186
38
183187
>>> print(table.columns)
184-
<TableColumns names=('Object','RA', 'DEC','Target l b','DATE OBS','ProgId','DP.ID','OB.ID','OBS.TARG.NAME','DPR.CATG','DPR.TYPE','DPR.TECH','INS.MODE','DIMM S-avg')>
188+
<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')>
185189
>>> table.pprint(max_width=100)
186-
Object Target Ra Dec Target l b ... INS.MODE DIMM S-avg
187-
----------------------- ----------------------- -------------------- ... -------- -----------
188-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.69 [0.01]
189-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.68 [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.69 [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.74 [0.01]
194-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.69 [0.01]
195-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.66 [0.01]
196-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.64 [0.01]
197-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.60 [0.01]
198-
NGC4151 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.59 [0.01]
199-
... ... ... ... ... ...
200-
TRACK,OBJECT,DISPERSED 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.70 [0.01]
201-
TRACK,OBJECT,DISPERSED 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.72 [0.01]
202-
SEARCH,OBJECT,DISPERSED 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.62 [0.01]
203-
SEARCH,OBJECT,DISPERSED 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.61 [0.01]
204-
SEARCH,OBJECT,DISPERSED 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.54 [0.01]
205-
SEARCH,OBJECT,DISPERSED 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.53 [0.01]
206-
TRACK,OBJECT,DISPERSED 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.51 [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-
PHOTOMETRY,OBJECT 12:10:32.63 +39:24:20.7 155.076719 75.063247 ... STARINTF 0.54 [0.01]
210-
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]
211213
Length = 38 rows
212214

213215
And indeed, 38 datasets are found, and the ``DATE OBS`` column is in the result table.
@@ -224,27 +226,42 @@ is identical to :meth:`~astroquery.eso.EsoClass.query_instrument`.
224226
ESO instruments without a specific query interface can be queried with
225227
:meth:`~astroquery.eso.EsoClass.query_main`, specifying the ``instrument`` constraint.
226228
This is the case of e.g. ``harps``, ``feros`` or the all sky cameras APICAM and MASCOT. Here is an example to
227-
query all-sky images from APICAM with ``luminance`` filter.
229+
query all-sky images from APICAM with ``luminance`` filter.
228230

229-
.. code-block:: python
231+
.. doctest-remote-data::
230232

231233
>>> eso.ROW_LIMIT = -1 # Return all results
232234
>>> table = eso.query_main(column_filters={'instrument': 'APICAM', 'filter_path': 'LUMINANCE',
233235
... 'stime':'2019-04-26', 'etime':'2019-04-27'}, cache=False)
234236
>>> print(len(table))
235237
207
236238
>>> print(table.columns)
237-
<TableColumns names=('OBJECT','RA','DEC','Program_ID','Instrument','Category','Type','Mode','Dataset ID','Release_Date','TPL ID','TPL START','Exptime','Exposure','Filter','MJD-OBS','Airmass','DIMM Seeing at Start')>
239+
<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')>
238240
>>> table.pprint(max_width=100)
239-
OBJECT RA DEC Program_ID ... Filter MJD-OBS Airmass DIMM Seeing at Start
240-
------- ----------- ----------- ------------ ... --------- ------------ ------- --------------------
241-
ALL SKY 09:18:37.39 -24:32:32.7 60.A-9008(A) ... LUMINANCE 58599.987766 1.0 N/A
242-
ALL SKY 09:21:07.68 -24:32:30.1 60.A-9008(A) ... LUMINANCE 58599.989502 1.0 N/A
243-
ALL SKY 09:23:38.98 -24:32:27.5 60.A-9008(A) ... LUMINANCE 58599.99125 1.0 N/A
244-
... ... ... ... ... ... ... ... ...
245-
ALL SKY 11:47:35.12 -24:31:07.7 60.A-9008(A) ... LUMINANCE 58600.091019 1.0 N/A
246-
ALL SKY 11:50:07.40 -24:31:07.6 60.A-9008(A) ... LUMINANCE 58600.092778 1.0 N/A
247-
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
248265

249266

250267
Query the ESO archive for reduced data
@@ -258,7 +275,7 @@ Identify available surveys
258275

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

261-
.. code-block:: python
278+
.. doctest-remote-data::
262279

263280
>>> surveys = eso.list_surveys()
264281

@@ -269,7 +286,8 @@ Let's assume that we work with the ``HARPS`` survey, and that we are interested
269286
target ``HD203608``.
270287
The archive can be queried as follows:
271288

272-
.. code-block:: python
289+
290+
.. doctest-remote-data::
273291

274292
>>> table = eso.query_surveys('HARPS', cache=False, target="HD203608")
275293

@@ -284,37 +302,40 @@ Only a small subset of the keywords presents in the data products can be obtaine
284302
with :meth:`~astroquery.eso.EsoClass.query_instrument` or :meth:`~astroquery.eso.EsoClass.query_main`.
285303
There is however a way to get the full primary header of the FITS data products,
286304
using :meth:`~astroquery.eso.EsoClass.get_headers`.
287-
This method is detailed in the example below, continuing with the previously obtained table.
305+
This method is detailed in the example below.
306+
288307

289-
.. code-block:: python
308+
.. doctest-remote-data::
290309

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

332-
.. code-block:: python
353+
.. doctest-skip::
333354

334355
>>> data_files = eso.retrieve_data(table['DP.ID'][:2])
335356
Staging request...
@@ -354,12 +375,13 @@ would like to download datasets from an existing request, either submitted
354375
through the functions here or externally, call ``retrieve_data`` with the
355376
``request_id`` option:
356377

357-
.. code-block:: python
378+
.. doctest-skip::
358379

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

361382
The ``request_id`` can be found in the automatic email sent by the archive after
362-
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.
383+
staging the initial request, i.e., https://dataportal.eso.org/rh/requests/[USERNAME]/{request_id}.
384+
A summary of your available requests is shown at https://dataportal.eso.org/rh/requests/[USERNAME]/recentRequests.
363385

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

0 commit comments

Comments
 (0)