Skip to content

Commit 32e5498

Browse files
committed
Added ESASky SSO documentation
1 parent 1044af1 commit 32e5498

File tree

2 files changed

+126
-17
lines changed

2 files changed

+126
-17
lines changed

astroquery/esasky/core.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def list_spectra(self):
209209

210210
def list_sso(self):
211211
"""
212-
Get a list of the mission names of the available observations with SSO cross match in ESASky
212+
Get a list of the mission names of the available observations with SSO crossmatch in ESASky
213213
"""
214214
return self._json_object_field_to_list(
215215
self._get_sso_json(), self.__MISSION_STRING)
@@ -443,8 +443,8 @@ def find_sso(self, sso_name, *, sso_type="ALL", cache=True):
443443
def query_sso_maps(self, sso_name, *, sso_type="ALL", missions=__ALL_STRING,
444444
row_limit=DEFAULT_ROW_LIMIT):
445445
"""
446-
This method performs a cross match on the chosen solar system object
447-
and the selected missions using ESASky's cross match algorithm.
446+
This method performs a crossmatch on the chosen solar system object
447+
and the selected missions using ESASky's crossmatch algorithm.
448448
The algorithm detects both targeted and serendipitous observations.
449449
It returns a TableList with all the found maps metadata for the
450450
chosen missions and object.
@@ -494,7 +494,7 @@ def query_sso_maps(self, sso_name, *, sso_type="ALL", missions=__ALL_STRING,
494494
if sso_type != 'ALL':
495495
type_text = ' and type {}'.format(sso_type)
496496
log.info('Found {num_sso} SSO\'s with name: {sso_name}{type_text}.\n'
497-
'Try narrowing your search by typing a more specific sso_name.\n{specify_type} '
497+
'Try narrowing your search by typing a more specific sso_name.\n{specify_type}'
498498
'The following SSO\'s were found:\n{found_ssos}'
499499
.format(num_sso=len(sso),
500500
sso_name=sso_name,
@@ -535,9 +535,9 @@ def get_images_sso(self, *, sso_name=None, sso_type="ALL", table_list=None, miss
535535
"""
536536
This method gets the fits files for the input (either a sso_name or table_list)
537537
and downloads all maps to the the selected folder.
538-
If a sso_name is entered, this method performs a cross match on
538+
If a sso_name is entered, this method performs a crossmatch on
539539
the chosen solar system object and the selected missions using
540-
ESASky's cross match algorithm.
540+
ESASky's crossmatch algorithm.
541541
The method returns a dictionary which is divided by mission.
542542
All mission except Herschel returns a list of HDULists.
543543
For Herschel each item in the list is a dictionary where the used
@@ -1573,7 +1573,7 @@ def _get_herschel_spectra(self, product_url, directory_path, cache):
15731573
for member in tar.getmembers():
15741574
member_name = member.name.lower()
15751575
if ('hspire' in member_name or 'hpacs' in member_name
1576-
or 'hhifi' in member_name):
1576+
or 'hhifi' in member_name):
15771577
herschel_filter = self._get_herschel_filter_name(member_name)
15781578
tar.extract(member, directory_path)
15791579
herschel_fits = []
@@ -1723,7 +1723,7 @@ def _build_region_query(self, coordinates, radius, row_limit, json):
17231723
else:
17241724
if (json[self.__USE_INTERSECT_STRING]):
17251725
where_query = (" WHERE 1=INTERSECTS(CIRCLE('ICRS', {}, {}, {}), fov)".
1726-
format(ra, dec, radius_deg))
1726+
format(ra, dec, radius_deg))
17271727
else:
17281728
where_query = (" WHERE 1=CONTAINS(POINT('ICRS', {}, {}), CIRCLE('ICRS', {}, {}, {}))".
17291729
format(tap_ra_column, tap_dec_column, ra, dec, radius_deg))

docs/esasky/esasky.rst

Lines changed: 118 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ Getting started
1010
===============
1111

1212
This is a python interface for querying the `ESASky web service
13-
<http://www.cosmos.esa.int/web/esdc/esasky>`__. This supports querying an object
14-
as well as querying a region around the target. For region queries, the region
15-
dimensions may be specified as a radius. The queries may be further constrained
16-
by specifying a choice of catalogs, missions, or spectra. `Documentation on the ESASky
13+
<http://www.cosmos.esa.int/web/esdc/esasky>`__. This module supports cone
14+
searches and download of data products from all missions available in ESASky.
15+
You can also use the ESASky Solar System Object crossmatch methods to get
16+
all observations (both targeted and serendipitous) of a solar system object.
17+
18+
There are 4 categories of methods, based on the type of data:
19+
catalogs, observations, spectra, and SSO. `Documentation on the ESASky
1720
web service can be found here. <http://www.cosmos.esa.int/web/esdc/esasky-help>`__
1821

1922
Get the available catalog names
@@ -49,7 +52,7 @@ If you know the names of all the available maps missions you can use
4952
'XMM-OM-UV', 'HST-UV', 'HST-OPTICAL', 'HST-IR', 'ISO-IR',
5053
'Herschel', 'AKARI', 'Spitzer', 'ALMA']
5154
52-
Get the available maps mission names
55+
Get the available spectra mission names
5356
------------------------------------
5457

5558
If you know the names of all the available spectra you can use
@@ -62,14 +65,29 @@ If you know the names of all the available spectra you can use
6265
['XMM-NEWTON', 'Chandra', 'IUE', 'HST-UV',
6366
'HST-OPTICAL', 'HST-IR', 'ISO-IR', 'Herschel', 'LAMOST']
6467
68+
Get the available SSO mission names
69+
------------------------------------
70+
71+
If you know the names of all the available missions with SSO cross
72+
match data, you can use
73+
:meth:`~astroquery.esasky.ESASkyClass.list_sso`:
74+
75+
.. code-block:: python
76+
77+
>>> sso_list = ESASky.list_sso()
78+
>>> print(sso_list)
79+
['Herschel', 'HST', 'XMM']
80+
6581
Query an object
6682
---------------
6783

68-
There are three query objects methods in this module
84+
There are three very similar query objects methods in this module
6985
:meth:`~astroquery.esasky.ESASkyClass.query_object_catalogs`,
7086
:meth:`~astroquery.esasky.ESASkyClass.query_object_maps`, and
71-
:meth:`~astroquery.esasky.ESASkyClass.query_object_spectra`, which all work in
72-
almost the same way.
87+
:meth:`~astroquery.esasky.ESASkyClass.query_object_spectra`.
88+
There is also a method for querying SSO object
89+
:meth:`~astroquery.esasky.ESASkyClass.query_sso_maps`
90+
which is covered in its own section further down.
7391

7492
For catalogs, the query returns a maximum of 10000 sources per mission by
7593
default. However, this can be modified by the row_limit parameter.
@@ -355,7 +373,7 @@ or
355373
... missions=['Herschel', 'XMM-NEWTON'])
356374
>>> spectra = ESASky.get_spectra_from_table(query_table_list=table_list, download_dir="/home/user/esasky")
357375
358-
The response is structured in a dictionary like this:
376+
The return value is structured in a dictionary like this:
359377

360378
.. code-block:: python
361379
@@ -380,6 +398,97 @@ Here is another example for Herschel, since it is a bit special:
380398
>>> spectra['HERSCHEL']['1342211195']['red'].keys()
381399
>>> spectra['HERSCHEL']['1342211195']['red']['HPSTBRRS'].info()
382400
401+
Solar System Object Crossmatch
402+
------------------------------
403+
ESASky has a solar system object crossmatch feature which
404+
performs a crossmatch on the SSO orbits against the entire
405+
mission archives to find observations in which the SSO fell
406+
within the imaging instrument's field of view during the
407+
time the images were being taken.
408+
`Read more about the ESASky SSO feature
409+
<https://www.cosmos.esa.int/web/esdc/esasky-interface#SSO>`__
410+
You can access the results of this crossmatch by using
411+
:meth:`astroquery.esasky.ESASkyClass.query_sso_maps` which
412+
works like the other query methods, but it takes an SSO
413+
name as input instead of a position.
414+
415+
.. code-block:: python
416+
417+
>>> from astroquery.esasky import ESASky
418+
>>> result = ESASky.query_sso_maps(sso_name="Pallas", missions=["XMM", "HST"])
419+
420+
In some cases an SSO name is ambiguous, in which case you
421+
may need to use a more precise SSO name or specify the
422+
SSO type of the desired object. For example:
423+
424+
.. code-block:: python
425+
426+
>>> from astroquery.esasky import ESASky
427+
>>> ESASky.query_sso_maps(sso_name="503")
428+
INFO: Found 4 SSO's with name: 503.
429+
Try narrowing your search by typing a more specific sso_name.
430+
You can also narrow your search by specifying the sso_type.
431+
Allowed values are ALL, ASTEROID, COMET, SATELLITE, PLANET, DWARF_PLANET, SPACECRAFT, SPACEJUNK, EXOPLANET, STAR.
432+
The following SSO's were found:
433+
{'aliases': ['503', 'J-3', 'J-III'], 'sso_name': 'Ganymede', 'sso_type': 'SATELLITE'}
434+
{'aliases': [], 'sso_name': 'TOI-503 b', 'sso_type': 'EXOPLANET'}
435+
{'aliases': [], 'sso_name': 'Wolf 503 b', 'sso_type': 'EXOPLANET'}
436+
{'aliases': ['00503', '1899 GA', '1903 BL', '1948 BA', '1948 DA', '2000503', '503', 'I99G00A', 'J03B00L', 'J48B00A', 'J48D00A'], 'sso_name': 'Evelyn', 'sso_type': 'ASTEROID'}
437+
438+
439+
In this case, you can specify the sso_type
440+
441+
.. code-block:: python
442+
>>> from astroquery.esasky import ESASky
443+
>>> ESASky.query_sso_maps(sso_name="503", sso_type="SATELLITE")
444+
445+
446+
You can see the available missions with:
447+
448+
.. code-block:: python
449+
>>> from astroquery.esasky import ESASky
450+
>>> ESASky.list_sso()
451+
452+
453+
Other parameters and the return value are structured in the
454+
same manner as the other query methods.
455+
456+
You can also download the observation for a given SSO with
457+
:meth:`astroquery.esasky.ESASkyClass.get_images_sso`.
458+
This function works very similar to
459+
:meth:`astroquery.esasky.ESASkyClass.get_images` and
460+
:meth:`astroquery.esasky.ESASkyClass.get_maps`, as it
461+
structures the return values in the same way, and
462+
most parameters are the same.
463+
You can for example, download a table list just like
464+
in get_maps by doing something like this:
465+
466+
.. code-block:: python
467+
>>> from astroquery.esasky import ESASky
468+
>>> table_list_from_query_maps=ESASky.query_sso_maps(sso_name="ganymede", missions="XMM")
469+
>>> table_list_from_query_maps['XMM'].remove_rows(list(range(0, 32)))
470+
>>> images=ESASky.get_images_sso(table_list=table_list_from_query_maps)
471+
472+
Or download everything on an SSO by something like this:
473+
474+
.. code-block:: python
475+
>>> from astroquery.esasky import ESASky
476+
>>> images=ESASky.get_images(sso_name="ganymede")
477+
478+
479+
This module also offers access to IMCCE's SsODNet resolver,
480+
which allows you to find solar and extra solar system
481+
objects with a given name. Here you can see all matches
482+
and there aliases and types. You can use this method to
483+
help you specify which SSO you are after. Use
484+
:meth:`astroquery.esasky.ESASkyClass.find_sso`
485+
like this:
486+
487+
.. code-block:: python
488+
>>> from astroquery.esasky import ESASky
489+
>>> list_of_matches=ESASky.find_sso(sso_name="Io")
490+
491+
383492
Reference/API
384493
=============
385494

0 commit comments

Comments
 (0)