ESASkyClass¶
-
class
astroquery.esasky.
ESASkyClass
[source]¶ Bases:
astroquery.query.BaseQuery
Attributes Summary
Methods Summary
get_images
(position[, radius, missions, …])This method gets the fits files available for the selected position and mission and downloads all maps to the the selected folder.
get_maps
(query_table_list[, missions, …])This method takes the dictionary of missions and metadata as returned by query_region_maps and downloads all maps to the selected folder.
get_spectra
(position[, radius, missions, …])This method gets the fits files available for the selected position and mission and downloads all spectra to the the selected folder.
get_spectra_from_table
(query_table_list[, …])This method takes the dictionary of missions and metadata as returned by query_region_spectra and downloads all spectra to the selected folder.
Get a list of the mission names of the available catalogs in ESASky
Get a list of the mission names of the available observations in ESASky
Get a list of the mission names of the available spectra in ESASky
query_object_catalogs
(position[, catalogs, …])This method queries a chosen object or coordinate for all available catalogs and returns a TableList with all the found catalogs metadata for the chosen missions and object.
query_object_maps
(position[, missions, …])This method queries a chosen object or coordinate for all available maps which have observation data on the chosen position.
query_object_spectra
(position[, missions, …])This method queries a chosen object or coordinate for all available missions which have spectral data on the chosen position.
query_region_catalogs
(position, radius[, …])This method queries a chosen region for all available catalogs and returns a TableList with all the found catalogs metadata for the chosen missions and region.
query_region_maps
(position, radius[, …])This method queries a chosen region for all available maps and returns a TableList with all the found maps metadata for the chosen missions and region.
query_region_spectra
(position, radius[, …])This method queries a chosen region for all available spectra and returns a TableList with all the found spectra metadata for the chosen missions and region.
Attributes Documentation
-
DEFAULT_ROW_LIMIT
= 10000¶
-
TIMEOUT
= 1000¶
-
URLbase
= 'http://sky.esa.int/esasky-tap'¶
Methods Documentation
-
get_images
(position, radius='0 arcmin', missions='all', download_dir='Maps', cache=True)[source]¶ This method gets the fits files available for the selected position and mission and downloads all maps to the the selected folder. The method returns a dictionary which is divided by mission. All mission except Herschel returns a list of HDULists. For Herschel each item in the list is a dictionary where the used filter is the key and the HDUList is the value.
- Parameters
- positionstr or
astropy.coordinates
object Can either be a string of the location, eg ‘M51’, or the coordinates of the object.
- radiusstr or
Quantity
, optional The radius of a region. Defaults to 0.
- missionsstring or list, optional
Can be either a specific mission or a list of missions (all mission names are found in list_missions()) or ‘all’ to search in all missions. Defaults to ‘all’.
- download_dirstring, optional
The folder where all downloaded maps should be stored. Defaults to a folder called ‘Maps’ in the current working directory.
- cachebool, optional
When set to True the method will use a cache located at .astropy/astroquery/cache. Defaults to True.
- positionstr or
- Returns
- maps
dict
All mission except Herschel returns a list of HDULists. For Herschel each item in the list is a dictionary where the used filter is the key and the HDUList is the value. It is structured in a dictionary like this: dict: { ‘HERSCHEL’: [{‘70’: HDUList, ‘160’: HDUList}, {‘70’: HDUList, ‘160’: HDUList}, …], ‘HST’:[HDUList, HDUList, HDUList, HDUList, HDUList, …], ‘XMM-EPIC’ : [HDUList, HDUList, HDUList, HDUList, …] … }
- maps
Examples
get_images(“m101”, “14’”, “all”)
-
get_maps
(query_table_list, missions='all', download_dir='Maps', cache=True)[source]¶ This method takes the dictionary of missions and metadata as returned by query_region_maps and downloads all maps to the selected folder. The method returns a dictionary which is divided by mission. All mission except Herschel returns a list of HDULists. For Herschel each item in the list is a dictionary where the used filter is the key and the HDUList is the value.
- Parameters
- query_table_list
TableList
or dict or list of (name,Table
) pairs A TableList or dict or list of name and Table pairs with all the missions wanted and their respective metadata. Usually the return value of query_region_maps.
- missionsstring or list, optional
Can be either a specific mission or a list of missions (all mission names are found in list_missions()) or ‘all’ to search in all missions. Defaults to ‘all’.
- download_dirstring, optional
The folder where all downloaded maps should be stored. Defaults to a folder called ‘Maps’ in the current working directory.
- cachebool, optional
When set to True the method will use a cache located at .astropy/astroquery/cache. Defaults to True.
- query_table_list
- Returns
- maps
dict
All mission except Herschel returns a list of HDULists. For Herschel each item in the list is a dictionary where the used filter is the key and the HDUList is the value. It is structured in a dictionary like this: dict: { ‘HERSCHEL’: [{‘70’: HDUList, ‘160’: HDUList}, {‘70’: HDUList, ‘160’: HDUList}, …], ‘HST’:[HDUList, HDUList, HDUList, HDUList, HDUList, …], ‘XMM-EPIC’ : [HDUList, HDUList, HDUList, HDUList, …] … }
- maps
Examples
get_maps(query_region_maps(“m101”, “14’”, “all”))
-
get_spectra
(position, radius='0 arcmin', missions='all', download_dir='Spectra', cache=True)[source]¶ This method gets the fits files available for the selected position and mission and downloads all spectra to the the selected folder. The method returns a dictionary which is divided by mission. All mission except Herschel returns a list of HDULists. Herschel returns a three-level dictionary.
- Parameters
- positionstr or
astropy.coordinates
object Can either be a string of the location, eg ‘M51’, or the coordinates of the object.
- radiusstr or
Quantity
, optional The radius of a region. Defaults to 0.
- missionsstring or list, optional
Can be either a specific mission or a list of missions (all mission names are found in list_spectra()) or ‘all’ to search in all missions. Defaults to ‘all’.
- download_dirstring, optional
The folder where all downloaded spectra should be stored. Defaults to a folder called ‘Spectra’ in the current working directory.
- cachebool, optional
When set to True the method will use a cache located at .astropy/astroquery/cache. Defaults to True.
- positionstr or
- Returns
- spectra
dict
All mission except Herschel returns a list of HDULists. Herschel returns a three-level dictionary. Read more about Herschel here: https://www.cosmos.esa.int/web/esdc/esasky-observations#HERSCHEL-OBS
The response is structured in a dictionary like this: dict: { ‘HERSCHEL’: {‘1342211195’: {‘red’ : {‘HPSTBRRS’ : HDUList}, ‘blue’ : {‘HPSTBRBS’: HDUList}, ‘1342180796’: {‘WBS’ : {‘WBS-H_LSB_5a’ : HDUList}, ‘HRS’ : {‘HRS-H_LSB_5a’: HDUList}, …}, ‘HST-IR’:[HDUList, HDUList, HDUList, HDUList, HDUList, …], ‘XMM-NEWTON’ : [HDUList, HDUList, HDUList, HDUList, …] … }
- spectra
Examples
get_spectra(“m101”, “14’”, [“HST-IR”, “XMM-NEWTON”, “HERSCHEL”])
-
get_spectra_from_table
(query_table_list, missions='all', download_dir='Spectra', cache=True)[source]¶ This method takes the dictionary of missions and metadata as returned by query_region_spectra and downloads all spectra to the selected folder. The method returns a dictionary which is divided by mission. All mission except Herschel returns a list of HDULists. Herschel returns a three-level dictionary.
- Parameters
- query_table_list
TableList
or dict or list of (name,Table
) pairs A TableList or dict or list of name and Table pairs with all the missions wanted and their respective metadata. Usually the return value of query_region_spectra.
- missionsstring or list, optional
Can be either a specific mission or a list of missions (all mission names are found in list_spectra()) or ‘all’ to search in all missions. Defaults to ‘all’.
- download_dirstring, optional
The folder where all downloaded spectra should be stored. Defaults to a folder called ‘Spectra’ in the current working directory.
- cachebool, optional
When set to True the method will use a cache located at .astropy/astroquery/cache. Defaults to True.
- query_table_list
- Returns
- spectra
dict
All mission except Herschel returns a list of HDULists. Herschel returns a three-level dictionary. Read more about Herschel here: https://www.cosmos.esa.int/web/esdc/esasky-observations#HERSCHEL-OBS
The response is structured in a dictionary like this: dict: { ‘HERSCHEL’: {‘1342211195’: {‘red’ : {‘HPSTBRRS’ : HDUList}, ‘blue’ : {‘HPSTBRBS’: HDUList}, ‘1342180796’: {‘WBS’ : {‘WBS-H_LSB_5a’ : HDUList}, ‘HRS’ : {‘HRS-H_LSB_5a’: HDUList}, …}, ‘HST-IR’:[HDUList, HDUList, HDUList, HDUList, HDUList, …], ‘XMM-NEWTON’ : [HDUList, HDUList, HDUList, HDUList, …] … }
- spectra
Examples
table = query_region_spectra(“m101”, “14’”, [“HST-IR”, “XMM-NEWTON”, “HERSCHEL”]) get_spectra_from_table(table)
-
query_object_catalogs
(position, catalogs='all', row_limit=10000, get_query_payload=False, cache=True)[source]¶ This method queries a chosen object or coordinate for all available catalogs and returns a TableList with all the found catalogs metadata for the chosen missions and object. To account for errors in telescope position, the method will look for any sources within a radius of 5 arcsec of the chosen position.
- Parameters
- positionstr or
astropy.coordinates
object Can either be a string of the location, eg ‘M51’, or the coordinates of the object.
- catalogsstring or list, optional
Can be either a specific catalog or a list of catalogs (all catalog names are found in list_catalogs()) or ‘all’ to search in all catalogs. Defaults to ‘all’.
- row_limitint, optional
Determines how many rows that will be fetched from the database for each mission. Can be -1 to select maximum (currently 100 000). Defaults to 10000.
- get_query_payloadbool, optional
When set to True the method returns the HTTP request parameters. Defaults to False.
- cachebool, optional
When set to True the method will use a cache located at .astropy/astroquery/cache. Defaults to True.
- Returns
- ——-
- table_list
TableList
Each mission returns a
Table
with the metadata of the catalogs available for the chosen mission and object. It is structured in a TableList like this: TableList with 2 tables: ‘0:HSC’ with 9 column(s) and 232 row(s) ‘1:XMM-OM’ with 11 column(s) and 2 row(s)
- positionstr or
Examples
query_object_catalogs(“m101”, “all”)
query_object_catalogs(“202.469, 47.195”, “HSC”) query_object_catalogs(“202.469, 47.195”, [“HSC”, “XMM-OM”])
-
query_object_maps
(position, missions='all', get_query_payload=False, cache=True, row_limit=10000)[source]¶ This method queries a chosen object or coordinate for all available maps which have observation data on the chosen position. It returns a TableList with all the found maps metadata for the chosen missions and object.
- Parameters
- positionstr or
astropy.coordinates
object Can either be a string of the location, eg ‘M51’, or the coordinates of the object.
- missionsstring or list, optional
Can be either a specific mission or a list of missions (all mission names are found in list_missions()) or ‘all’ to search in all missions. Defaults to ‘all’.
- get_query_payloadbool, optional
When set to True the method returns the HTTP request parameters. Defaults to False.
- cachebool, optional
When set to True the method will use a cache located at .astropy/astroquery/cache. Defaults to True.
- row_limitint, optional
Determines how many rows that will be fetched from the database for each mission. Can be -1 to select maximum (currently 100 000). Defaults to 10000.
- positionstr or
- Returns
Examples
query_object_maps(“m101”, “all”)
query_object_maps(“265.05, 69.0”, “Herschel”) query_object_maps(“265.05, 69.0”, [“Herschel”, “HST-OPTICAL”])
-
query_object_spectra
(position, missions='all', get_query_payload=False, cache=True, row_limit=10000)[source]¶ This method queries a chosen object or coordinate for all available missions which have spectral data on the chosen position. It returns a TableList with all the found spectra metadata for the chosen missions and object.
- Parameters
- positionstr or
astropy.coordinates
object Can either be a string of the location, eg ‘M51’, or the coordinates of the object.
- missionsstring or list, optional
Can be either a specific mission or a list of missions (all mission names are found in list_spectra()) or ‘all’ to search in all missions. Defaults to ‘all’.
- get_query_payloadbool, optional
When set to True the method returns the HTTP request parameters. Defaults to False.
- cachebool, optional
When set to True the method will use a cache located at .astropy/astroquery/cache. Defaults to True.
- row_limitint, optional
Determines how many rows that will be fetched from the database for each mission. Can be -1 to select maximum (currently 100 000). Defaults to 10000.
- positionstr or
- Returns
Examples
query_object_spectra(“m101”, “all”)
query_object_spectra(“202.469, 47.195”, “Herschel”) query_object_spectra(“202.469, 47.195”, [“Herschel”, “HST-OPTICAL”])
-
query_region_catalogs
(position, radius, catalogs='all', row_limit=10000, get_query_payload=False, cache=True)[source]¶ This method queries a chosen region for all available catalogs and returns a TableList with all the found catalogs metadata for the chosen missions and region.
- Parameters
- positionstr or
astropy.coordinates
object Can either be a string of the location, eg ‘M51’, or the coordinates of the object.
- radiusstr or
Quantity
The radius of a region.
- catalogsstring or list, optional
Can be either a specific catalog or a list of catalogs (all catalog names are found in list_catalogs()) or ‘all’ to search in all catalogs. Defaults to ‘all’.
- row_limitint, optional
Determines how many rows that will be fetched from the database for each mission. Can be -1 to select maximum (currently 100 000). Defaults to 10000.
- get_query_payloadbool, optional
When set to True the method returns the HTTP request parameters. Defaults to False.
- cachebool, optional
When set to True the method will use a cache located at .astropy/astroquery/cache. Defaults to True.
- positionstr or
- Returns
Examples
query_region_catalogs(“m101”, “14’”, “all”)
import astropy.units as u query_region_catalogs(“265.05, 69.0”, 14*u.arcmin, “Hipparcos-2”) query_region_catalogs(“265.05, 69.0”, 14*u.arcmin, [“Hipparcos-2”, “HSC”])
-
query_region_maps
(position, radius, missions='all', get_query_payload=False, cache=True, row_limit=10000)[source]¶ This method queries a chosen region for all available maps and returns a TableList with all the found maps metadata for the chosen missions and region.
- Parameters
- positionstr or
astropy.coordinates
object Can either be a string of the location, eg ‘M51’, or the coordinates of the object.
- radiusstr or
Quantity
The radius of a region.
- missionsstring or list, optional
Can be either a specific mission or a list of missions (all mission names are found in list_missions()) or ‘all’ to search in all missions. Defaults to ‘all’.
- get_query_payloadbool, optional
When set to True the method returns the HTTP request parameters. Defaults to False.
- cachebool, optional
When set to True the method will use a cache located at .astropy/astroquery/cache. Defaults to True.
- row_limitint, optional
Determines how many rows that will be fetched from the database for each mission. Can be -1 to select maximum (currently 100 000). Defaults to 10000.
- positionstr or
- Returns
Examples
query_region_maps(“m101”, “14’”, “all”)
import astropy.units as u query_region_maps(“265.05, 69.0”, 14*u.arcmin, “Herschel”) query_region_maps(“265.05, 69.0”, 14*u.arcmin, [“Herschel”, “HST-OPTICAL”])
-
query_region_spectra
(position, radius, missions='all', row_limit=10000, get_query_payload=False, cache=True)[source]¶ This method queries a chosen region for all available spectra and returns a TableList with all the found spectra metadata for the chosen missions and region.
- Parameters
- positionstr or
astropy.coordinates
object Can either be a string of the location, eg ‘M51’, or the coordinates of the object.
- radiusstr or
Quantity
The radius of a region.
- missionsstring or list, optional
Can be either a specific mission or a list of missions (all mission names are found in list_spectra()) or ‘all’ to search in all missions. Defaults to ‘all’.
- row_limitint, optional
Determines how many rows that will be fetched from the database for each mission. Can be -1 to select maximum (currently 100 000). Defaults to 10000.
- get_query_payloadbool, optional
When set to True the method returns the HTTP request parameters. Defaults to False.
- cachebool, optional
When set to True the method will use a cache located at .astropy/astroquery/cache. Defaults to True.
- positionstr or
- Returns
Examples
query_region_spectra(“m101”, “14’”, “all”)
import astropy.units as u query_region_spectra(“265.05, 69.0”, 30*u.arcmin, “Herschel”) query_region_spectra(“265.05, 69.0”, 30*u.arcmin, [“Herschel”, “IUE”])
-