1
1
.. _astroquery.esasky :
2
2
3
+ .. testsetup ::
4
+
5
+ >>> # Dealing with the openfile warnings here, globally rather than in the snippets below.
6
+ >>> import warnings
7
+ >>> warnings.filterwarnings(" ignore" , category = ResourceWarning , message = " unclosed file" )
8
+
9
+
3
10
************************************
4
11
ESASky Queries (`astroquery.esasky `)
5
12
************************************
@@ -257,11 +264,10 @@ HDUList is the value.
257
264
.. doctest-remote-data ::
258
265
259
266
>>> from astroquery.esasky import ESASky
260
- >>> images = ESASky.get_images(position = " V* HT Aqr" , radius = " 15 arcmin" , missions = [' Herschel' , ' ISO-IR' ]) # doctest: +IGNORE_WARNINGS
261
-
262
- Starting download of HERSCHEL data. (6 files)
263
- Downloading Observation ID: 1342220557 from http://archives.esac.esa.int/hsa/whsa-tap-server/data?RETRIEVAL_TYPE=STANDALONE&observation_oid=8628906&DATA_RETRIEVAL_ORIGIN=UI [Done]
264
- Downloading Observation ID: 1342221178 from http://archives.esac.esa.int/hsa/whsa-tap-server/data?RETRIEVAL_TYPE=STANDALONE&observation_oid=8628962&DATA_RETRIEVAL_ORIGIN=UI
267
+ >>> images = ESASky.get_images(position = " V* HT Aqr" , radius = " 15 arcmin" , missions = [' Herschel' , ' ISO-IR' ]) # doctest: +IGNORE_OUTPUT
268
+ INFO: Starting download of HERSCHEL data. (6 files)
269
+ INFO: Downloading Observation ID: 1342220557 from http://archives.esac.esa.int/hsa/whsa-tap-server/data?RETRIEVAL_TYPE=STANDALONE&observation_oid=8628906&DATA_RETRIEVAL_ORIGIN=UI [Done]
270
+ INFO: Downloading Observation ID: 1342221178 from http://archives.esac.esa.int/hsa/whsa-tap-server/data?RETRIEVAL_TYPE=STANDALONE&observation_oid=8628962&DATA_RETRIEVAL_ORIGIN=UI
265
271
...
266
272
>>> print (images) # doctest: +IGNORE_OUTPUT
267
273
{
@@ -275,8 +281,10 @@ parameter observation_id instead of target and position.
275
281
276
282
.. doctest-remote-data ::
277
283
278
- >>> images = ESASky.get_images(observation_ids = " 100001010" , missions = " SUZAKU" ) # doctest: +IGNORE_WARNINGS
279
284
>>> images = ESASky.get_images(observation_ids = [" 100001010" , " 01500403" ], missions = [" SUZAKU" , " ISO-IR" ])
285
+ INFO: Starting download of SUZAKU data. (1 files) [astroquery.esasky.core]
286
+ INFO: Starting download of ISO-IR data. (1 files) [astroquery.esasky.core]
287
+ ...
280
288
281
289
Note that the fits files also are stored to disk. By default they are saved to the working directory but the location
282
290
can be chosen by the download_dir parameter.
@@ -300,7 +308,7 @@ This example is equivalent to:
300
308
.. doctest-remote-data ::
301
309
302
310
>>> images = ESASky.get_images(position = " V* HT Aqr" , radius = " 15 arcmin" , missions = [' Herschel' , ' ISO-IR' ],
303
- download_dir="/home/user/esasky") # doctest: +SKIP
311
+ ... download_dir= " /home/user/esasky" ) # doctest: +SKIP
304
312
305
313
306
314
Get spectra
@@ -313,21 +321,23 @@ There are also two methods to download spectra: :meth:`astroquery.esasky.ESASkyC
313
321
The methods returns a `dict ` to separate the different missions. All mission except Herschel returns a list of
314
322
`~astropy.io.fits.HDUList `. Herschel returns a three-level dictionary.
315
323
316
- .. TODO: Skipping for now as it keeps timinig out. Needs fixing
317
324
.. doctest-remote-data ::
318
325
319
326
>>> from astroquery.esasky import ESASky
320
327
>>> spectra = ESASky.get_spectra(position = " Gaia DR3 4512810408088819712" , radius = " 6.52 arcmin" ,
321
- missions=['Herschel', 'XMM-NEWTON'])
328
+ ... missions= [' Herschel' , ' XMM-NEWTON' ]) # doctest: +IGNORE_OUTPUT
322
329
>>> spectra = ESASky.get_spectra(observation_ids = [" 02101201" , " z1ax0102t" ], missions = [" ISO-IR" , " HST-UV" ])
330
+ INFO: Starting download of ISO-IR data. (1 files) [astroquery.esasky.core]
331
+ INFO: Starting download of HST-UV data. (1 files) [astroquery.esasky.core]
332
+ ...
323
333
324
334
or
325
335
326
336
.. doctest-remote-data ::
327
337
328
338
>>> table_list = ESASky.query_region_spectra(position = " Gaia DR3 4512810408088819712" , radius = " 6.52 arcmin" ,
329
- missions=['Herschel', 'XMM-NEWTON'])
330
- >>> spectra = ESASky.get_spectra_from_table(query_table_list = table_list, download_dir = " /home/user/esasky" )
339
+ ... missions= [' Herschel' , ' XMM-NEWTON' ])
340
+ >>> spectra = ESASky.get_spectra_from_table(query_table_list = table_list, download_dir = " /home/user/esasky" ) # doctest: +SKIP
331
341
dict: {
332
342
'HERSCHEL': {'1342244919': {'red' : {'HPSTBRRS' : HDUList}, 'blue' : {'HPSTBRBS': HDUList},
333
343
'1342243607': {'SSW+SLW' : {'SPSS' : HDUList},
@@ -344,9 +354,25 @@ Here is another example for Herschel, since it is a bit special:
344
354
>>> result = ESASky.query_region_spectra(position = ' [SMB88] 6327' , radius = ' 1 arcmin' , missions = [' HERSCHEL' ])
345
355
>>> herschel_result = result[' HERSCHEL' ]
346
356
>>> herschel_result[' observation_id' , ' target_name' , ' instrument' , ' observing_mode_name' , ' band' , ' duration' ].pprint()
347
- >>> spectra = ESASky.get_spectra_from_table(query_table_list = [(' HERSCHEL' , herschel_result)], download_dir = ' Spectra_new' )
357
+ observation_id target_name instrument ... band duration
358
+ ... seconds
359
+ -------------- -------------------- ---------- ... -------------- --------
360
+ 1342249066 HATLAS-NGP-NA.V1.144 SPIRE ... 191-671 micron 13752.0
361
+ >>>
362
+ >>> spectra = ESASky.get_spectra_from_table(query_table_list = [(' HERSCHEL' , herschel_result)], download_dir = ' Spectra_new' ) # doctest: +IGNORE_OUTPUT
348
363
>>> spectra[' HERSCHEL' ][' 1342249066' ][' SSW+SLW' ].keys()
364
+ dict_keys(['SPSS'])
349
365
>>> spectra[' HERSCHEL' ][' 1342249066' ][' SSW+SLW' ][' SPSS' ].info()
366
+ Filename: Spectra_new/HERSCHEL/...
367
+ No. Name Ver Type Cards Dimensions Format
368
+ 0 PRIMARY 1 PrimaryHDU 404 ()
369
+ 1 0000 1 ImageHDU 58 ()
370
+ 2 SLWB2 1 BinTableHDU 90 1905R x 5C [1D, 1D, 1D, 1J, 1J]
371
+ 3 SLWB3 1 BinTableHDU 90 1905R x 5C [1D, 1D, 1D, 1J, 1J]
372
+ 4 SLWC2 1 BinTableHDU 90 1905R x 5C [1D, 1D, 1D, 1J, 1J]
373
+ 5 SLWC3 1 BinTableHDU 90 1905R x 5C [1D, 1D, 1D, 1J, 1J]
374
+ 6 SLWC4 1 BinTableHDU 90 1905R x 5C [1D, 1D, 1D, 1J, 1J]
375
+ ...
350
376
351
377
352
378
Solar System Object Crossmatch
@@ -370,8 +396,10 @@ type of the desired object. For example:
370
396
.. doctest-remote-data ::
371
397
372
398
>>> from astroquery.esasky import ESASky
373
- >>> ESASky.query_sso(sso_name = " 503" )
374
- INFO: Found 4 SSO's with name: 503.
399
+ >>> ESASky.query_sso(sso_name = " 503" ) # doctest: +IGNORE_EXCEPTION_DETAIL
400
+ Traceback (most recent call last):
401
+ ...
402
+ ValueError: Found 4 SSO's with name: 503.
375
403
Try narrowing your search by typing a more specific sso_name.
376
404
You can also narrow your search by specifying the sso_type.
377
405
Allowed values are ALL, ASTEROID, COMET, SATELLITE, PLANET, DWARF_PLANET, SPACECRAFT, SPACEJUNK, EXOPLANET, STAR.
@@ -388,15 +416,17 @@ In this case, you can specify the sso_type
388
416
389
417
>>> from astroquery.esasky import ESASky
390
418
>>> ESASky.query_sso(sso_name = " 503" , sso_type = " SATELLITE" )
391
-
419
+ TableList with 2 tables:
420
+ '0:HST' with 45 column(s) and 618 row(s)
421
+ '1:XMM' with 45 column(s) and 33 row(s)
392
422
393
423
You can see the available missions with:
394
424
395
425
.. doctest-remote-data ::
396
426
397
427
>>> from astroquery.esasky import ESASky
398
428
>>> ESASky.list_sso()
399
-
429
+ ['Herschel', 'HST', 'XMM', 'XMM-OM']
400
430
401
431
Other parameters and the return value are structured in the same manner as the other query methods.
402
432
@@ -411,14 +441,19 @@ are the same. You can for example, download a table list just like in get_maps b
411
441
>>> table_list_from_query_maps= ESASky.query_sso(sso_name = " ganymede" , missions = " XMM" )
412
442
>>> table_list_from_query_maps[' XMM' ].remove_rows(list (range (0 , 32 )))
413
443
>>> images= ESASky.get_images_sso(table_list = table_list_from_query_maps)
444
+ INFO: Starting download of XMM data. (1 files) [astroquery.esasky.core]
445
+ ...
414
446
415
447
Or download everything on an SSO by something like this:
416
448
417
449
.. doctest-remote-data ::
418
450
419
451
>>> from astroquery.esasky import ESASky
420
452
>>> images= ESASky.get_images_sso(sso_name = " 2017 RN65" )
421
-
453
+ INFO: Starting download of HERSCHEL data. (1 files) [astroquery.esasky.core]
454
+ INFO: Starting download of HST data. (1 files) [astroquery.esasky.core]
455
+ INFO: Starting download of XMM data. (1 files) [astroquery.esasky.core]
456
+ ...
422
457
423
458
This module also offers access to IMCCE's SsODNet resolver, which allows you to find solar and extra solar system
424
459
objects with a given name. Here you can see all matches and there aliases and types. You can use this method to help you
@@ -430,6 +465,13 @@ specify which SSO you are after. Use :meth:`astroquery.esasky.ESASkyClass.find_s
430
465
>>> list_of_matches= ESASky.find_sso(sso_name = " Io" )
431
466
432
467
468
+
469
+ .. testcleanup ::
470
+
471
+ >>> from astroquery.utils import cleanup_saved_downloads
472
+ >>> cleanup_saved_downloads([' Spectra_new' ])
473
+
474
+
433
475
Reference/API
434
476
=============
435
477
0 commit comments