Skip to content

Commit 39aa4f4

Browse files
tinuademargaretbsipocz
authored andcommitted
WIP
1 parent b0a89ed commit 39aa4f4

File tree

1 file changed

+41
-15
lines changed

1 file changed

+41
-15
lines changed

docs/esasky/esasky.rst

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

53
************************************
@@ -23,13 +21,16 @@ Get the available catalog names
2321
If you know the names of all the available catalogs you can use :meth:`~astroquery.esasky.ESASkyClass.list_catalogs`:
2422

2523
.. code-block:: python
24+
.. doctest-remote-data::
2625

2726
>>> from astroquery.esasky import ESASky
2827
>>> catalog_list = ESASky.list_catalogs()
29-
>>> print(catalog_list)
30-
['LAMOST', 'AllWise', 'AKARI-IRC-SC', 'TwoMASS', 'INTEGRAL', 'CHANDRA-SC2', 'XMM-EPIC-STACK', 'XMM-EPIC', 'XMM-OM',
31-
'XMM-SLEW', 'Tycho-2', 'Gaia-eDR3', 'Hipparcos-2', 'HSC', 'Herschel-HPPSC-070', 'Herschel-HPPSC-100',
32-
'Herschel-HPPSC-160', 'Herschel-SPSC-250', 'Herschel-SPSC-350', 'Herschel-SPSC-500', 'Planck-PGCC',
28+
>>> print(catalog_list) # doctest: +IGNORE_OUTPUT
29+
['LAMOST', 'AllWise', 'AKARI-IRC-SC', 'TwoMASS', 'INTEGRAL',
30+
'CHANDRA-SC2', 'XMM-EPIC-STACK', 'XMM-EPIC', 'XMM-OM', 'XMM-SLEW',
31+
'Tycho-2', 'Gaia-eDR3', 'Hipparcos-2', 'HSC', 'Herschel-HPPSC-070',
32+
'Herschel-HPPSC-100', 'Herschel-HPPSC-160', 'Herschel-SPSC-250',
33+
'Herschel-SPSC-350', 'Herschel-SPSC-500','Planck-PGCC',
3334
'Planck-PCCS2E-HFI', 'Planck-PCCS2-HFI', 'Planck-PCCS2-LFI', 'Planck-PSZ2']
3435

3536
Get the available maps mission names
@@ -38,10 +39,12 @@ Get the available maps mission names
3839
If you know the names of all the available maps missions you can use :meth:`~astroquery.esasky.ESASkyClass.list_maps`:
3940

4041
.. code-block:: python
42+
.. doctest-remote-data::
4143

4244
>>> maps_list = ESASky.list_maps()
43-
>>> print(maps_list)
44-
['INTEGRAL', 'XMM', 'Chandra', 'SUZAKU', 'XMM-OM-OPTICAL', 'XMM-OM-UV', 'HST-UV', 'HST-OPTICAL', 'HST-IR', 'ISO-IR',
45+
>>> print(maps_list) # doctest: +IGNORE_OUTPUT
46+
['INTEGRAL', 'XMM', 'Chandra', 'SUZAKU', 'XMM-OM-OPTICAL',
47+
'XMM-OM-UV', 'HST-UV', 'HST-OPTICAL', 'HST-IR', 'ISO-IR',
4548
'Herschel', 'AKARI', 'Spitzer', 'ALMA']
4649

4750
Get the available spectra mission names
@@ -50,10 +53,12 @@ Get the available spectra mission names
5053
If you know the names of all the available spectra you can use :meth:`~astroquery.esasky.ESASkyClass.list_spectra`:
5154

5255
.. code-block:: python
56+
.. doctest-remote-data::
5357

5458
>>> spectra_list = ESASky.list_spectra()
55-
>>> print(spectra_list)
56-
['XMM-NEWTON', 'Chandra', 'IUE', 'HST-UV', 'HST-OPTICAL', 'HST-IR', 'ISO-IR', 'Herschel', 'LAMOST']
59+
>>> print(spectra_list) # doctest: +IGNORE_OUTPUT
60+
['XMM-NEWTON', 'Chandra', 'IUE', 'HST-UV', 'HST-OPTICAL',
61+
'HST-IR', 'ISO-IR', 'Herschel', 'LAMOST']
5762

5863
Get the available SSO mission names
5964
-----------------------------------
@@ -67,6 +72,7 @@ If you know the names of all the available missions with SSO cross match data, y
6772
>>> print(sso_list)
6873
['Herschel', 'HST', 'XMM']
6974
75+
7076
Query an object
7177
---------------
7278

@@ -82,6 +88,7 @@ row_limit parameter. You can set the parameter to -1, which will result in the m
8288
For instance to query an object around M51 in the Hubble catalog:
8389

8490
.. code-block:: python
91+
.. doctest-remote-data::
8592

8693
>>> from astroquery.esasky import ESASky
8794
>>> result = ESASky.query_object_catalogs(position="M51", missions="HSC")
@@ -91,19 +98,21 @@ So the above query may also be written as:
9198

9299
.. code-block:: python
93100
94-
>>> result = ESASky.query_object_catalogs(position="M51", missions=["HSC", "XMM-OM"])
101+
>>> result = ESASky.query_object_catalogs(position="M51", missions=["HSC", "XMM-OM"]) # doctest: +REMOTE_DATA
95102
96103
To search in all available catalogs you can write ``"all"`` instead of a catalog name. The same thing will happen if you
97104
don't write any catalog name.
98105

99106
.. code-block:: python
107+
.. doctest-remote-data::
100108

101109
>>> result = ESASky.query_object_catalogs(position="M51", missions="all")
102110
>>> result = ESASky.query_object_catalogs(position="M51")
103111

104112
To see the result:
105113

106114
.. code-block:: python
115+
.. doctest-remote-data::
107116

108117
>>> print(result)
109118
TableList with 9 tables:
@@ -124,6 +133,7 @@ name.
124133
To access an individual table from the `~astroquery.utils.TableList` object
125134

126135
.. code-block:: python
136+
.. doctest-remote-data::
127137

128138
>>> interesting_table = result['ALLWISE']
129139
>>> print(interesting_table)
@@ -136,6 +146,7 @@ To do some common processing to all the tables in the returned `~astroquery.util
136146
for loop:
137147

138148
.. code-block:: python
149+
.. doctest-remote-data::
139150

140151
>>> for table in result:
141152
... colnames = table.colnames
@@ -147,6 +158,7 @@ As mentioned earlier, :meth:`astroquery.esasky.ESASkyClass.query_object_maps` an
147158
that contain the chosen object or coordinate. To execute the same command as above you write this:
148159

149160
.. code-block:: python
161+
.. doctest-remote-data::
150162

151163
>>> result = ESASky.query_object_maps(position="M51", missions="all")
152164
>>> result = ESASky.query_object_spectra(position="M51", missions="all")
@@ -166,6 +178,7 @@ To query a region either the coordinates or the object name around which to quer
166178
value for the radius of the region. For instance to query region around M51 in the HSC catalog:
167179

168180
.. code-block:: python
181+
.. doctest-remote-data::
169182

170183
>>> from astroquery.esasky import ESASky
171184
>>> import astropy.units as u
@@ -175,19 +188,21 @@ Note that the catalog may also be specified as a list. So the above query may al
175188

176189
.. code-block:: python
177190
178-
>>> result = ESASky.query_region_catalogs(position="M51", radius=10 * u.arcmin, catalogs=["HSC", "XMM-OM"])
191+
>>> result = ESASky.query_region_catalogs(position="M51", radius=10 * u.arcmin, catalogs=["HSC", "XMM-OM"]) # doctest: +REMOTE_DATA
179192
180193
To search in all available catalogs you can write ``"all"`` instead of a catalog name. The same thing will happen if you
181194
don't write any catalog name.
182195

183196
.. code-block:: python
197+
.. doctest-remote-data::
184198

185199
>>> result = ESASky.query_region_catalogs(position="M51", radius=10 * u.arcmin, catalogs="all")
186200
>>> result = ESASky.query_region_catalogs(position="M51", radius=10 * u.arcmin)
187201

188202
In the same manner, the radius can be specified with either a string or any `~astropy.units.Quantity`
189203

190204
.. code-block:: python
205+
.. doctest-remote-data::
191206

192207
>>> result = ESASky.query_region_catalogs(position="M51", radius="10 arcmin")
193208

@@ -234,6 +249,7 @@ If you already know the observation ID's or source names of interest, you can ge
234249
:meth:`~astroquery.esasky.ESASkyClass.query_ids_spectra`
235250

236251
.. code-block:: python
252+
.. doctest-remote-data::
237253

238254
>>> maps = ESASky.query_ids_maps(observation_ids=["lbsk03vbq", "ieag90010"], missions="HST-UV")
239255
>>> catalogs = ESASky.query_ids_catalogs(source_ids=["2CXO J090341.1-322609", "2CXO J090353.8-322642",
@@ -257,15 +273,15 @@ The method returns a `dict` to separate the different missions. All mission exce
257273
HDUList is the value.
258274

259275
.. code-block:: python
276+
.. doctest-remote-data::
260277

261278
>>> from astroquery.esasky import ESASky
262-
>>> images = ESASky.get_images(position="m51", radius="20 arcmin", missions=['Herschel', 'ISO-IR'])
279+
>>> images = ESASky.get_images(position="m51", radius="20 arcmin", missions=['Herschel', 'ISO-IR']) # doctest: +IGNORE_OUTPUT
263280
Starting download of HERSCHEL data. (25 files)
264281
Downloading Observation ID: 1342188589 from http://archives.esac.esa.int/hsa/whsa-tap-server/data?RETRIEVAL_TYPE=STANDALONE&observation_oid=8618001&DATA_RETRIEVAL_ORIGIN=UI [Done]
265282
Downloading Observation ID: 1342188328 from http://archives.esac.esa.int/hsa/whsa-tap-server/data?RETRIEVAL_TYPE=STANDALONE&observation_oid=8637833&DATA_RETRIEVAL_ORIGIN=UI
266283
...
267-
268-
>>> print(images)
284+
>>> print(images) # doctest: +IGNORE_OUTPUT
269285
{
270286
'HERSCHEL': [{'70': [HDUList], '160': HDUList}, {'70': HDUList, '160': HDUList}, ...],
271287
'ISO' : [HDUList, HDUList, HDUList, HDUList, ...]
@@ -276,6 +292,8 @@ As mentioned above, you can also download a images from a list of observation ID
276292
parameter observation_id instead of target and position.
277293

278294
.. code-block:: python
295+
.. doctest-remote-data::
296+
.. doctest-skip::
279297

280298
>>> from astroquery.esasky import ESASky
281299
>>> images = ESASky.get_images(position="m51", radius="20 arcmin", missions=['Herschel', 'ISO-IR'])
@@ -296,13 +314,17 @@ You can also fetch images using :meth:`astroquery.esasky.ESASkyClass.get_maps`.
296314
position, radius and missions.
297315

298316
.. code-block:: python
317+
.. doctest-remote-data::
318+
.. doctest-skip::
299319

300320
>>> table_list = ESASky.query_region_maps(position="m51", radius="20 arcmin", missions=['Herschel', 'ISO-IR'])
301321
>>> images = ESASky.get_maps(query_table_list=table_list, download_dir="/home/user/esasky")
302322

303323
This example is equivalent to:
304324

305325
.. code-block:: python
326+
.. doctest-remote-data::
327+
.. doctest-skip::
306328

307329
>>> images = ESASky.get_images(position="m51", radius="20 arcmin", missions=['Herschel', 'ISO-IR'],
308330
... download_dir="/home/user/esasky")
@@ -318,6 +340,7 @@ The methods returns a `dict` to separate the different missions. All mission exc
318340
`~astropy.io.fits.HDUList`. Herschel returns a three-level dictionary.
319341

320342
.. code-block:: python
343+
.. doctest-remote-data::
321344

322345
>>> from astroquery.esasky import ESASky
323346
>>> spectra = ESASky.get_spectra(position="m51", radius="20 arcmin", missions=['Herschel', 'XMM-NEWTON'])
@@ -326,6 +349,8 @@ The methods returns a `dict` to separate the different missions. All mission exc
326349
or
327350

328351
.. code-block:: python
352+
.. doctest-remote-data::
353+
.. doctest-skip::
329354

330355
>>> table_list = ESASky.query_region_spectra(position="m51", radius="20 arcmin",
331356
... missions=['Herschel', 'XMM-NEWTON'])
@@ -347,6 +372,7 @@ The return value is structured in a dictionary like this:
347372
Here is another example for Herschel, since it is a bit special:
348373
349374
.. code-block:: python
375+
.. doctest-remote-data::
350376
351377
>>> from astroquery.esasky import ESASky
352378
>>> result = ESASky.query_region_spectra(position='M51', radius='1arcmin', missions=['HERSCHEL'])

0 commit comments

Comments
 (0)