ESAHubbleClass¶
- class astroquery.esa.hubble.ESAHubbleClass(tap_handler=None)[source]¶
Bases:
astroquery.query.BaseQuery
Class to init ESA Hubble Module and communicate with eHST TAP
Attributes Summary
Methods Summary
cone_search
(coordinates, radius[, filename, ...])To execute a cone search defined by a coordinate and a radius
cone_search_criteria
(radius[, target, ...])To execute a cone search defined by a coordinate (an astropy.coordinate element or a target name which is resolved), a radius and a set of criteria to filter the results.
download_product
(observation_id, *[, ...])Download products from EHST based on their observation ID and the calibration level or the product type.
get_artifact
(artifact_id[, filename, verbose])Download artifacts from EHST.
get_columns
(table_name[, only_names, verbose])Get the available columns for a table in EHST TAP service
get_hap_hst_link
(observation_id)Returns the related members of hap and hst observations
get_member_observations
(observation_id)Returns the related members of simple and composite observations
get_observation_type
(observation_id)Returns the type of an observation
get_postcard
(observation_id[, ...])Download postcards from EHST
get_tables
([only_names, verbose])Get the available table in EHST TAP service
query_criteria
([calibration_level, ...])Launches a synchronous or asynchronous job to query the HST tap using calibration level, data product type, intent, collection, instrument name, and filters as criteria to create and execute the associated query.
query_hst_tap
(query[, async_job, ...])Launches a synchronous or asynchronous job to query the HST tap
query_metadata
([output_format, verbose])query_target
(name, *[, filename, ...])It executes a query over EHST and download the xml with the results.
Attributes Documentation
- TIMEOUT = 60¶
- calibration_levels = {0: 'AUXILIARY', 1: 'RAW', 2: 'CALIBRATED', 3: 'PRODUCT'}¶
- copying_string = 'Copying file to {0}...'¶
- data_url = 'http://archives.esac.esa.int/ehst-sl-server/servlet/data-action'¶
- metadata_url = 'http://archives.esac.esa.int/ehst-sl-server/servlet/metadata-action'¶
- product_types = ['PRODUCT', 'SCIENCE_PRODUCT', 'POSTCARD']¶
- target_url = 'http://archives.esac.esa.int/ehst-sl-server/servlet/targetresolver-action'¶
Methods Documentation
- cone_search(coordinates, radius, filename=None, output_format='votable', cache=True, async_job=False, verbose=False)[source]¶
To execute a cone search defined by a coordinate and a radius
- Parameters
- coordinatesastropy.coordinate, mandatory
coordinates of the center in the cone search
- radiusfloat or quantity
radius in arcmin (int, float) or quantity of the cone_search
- filenamestr, default None
Path and name of the file to store the results. If the filename is defined, the file will be automatically saved
- output_formatstring
results format. Options are: ‘votable’: str, binary VOTable format ‘csv’: str, comma-separated values format
- async_jobbool, optional, default ‘False’
executes the query (job) in asynchronous/synchronous mode (default synchronous)
- cachebool
optional, default ‘True’ Flag to save the results in the local cache
- verbosebool, optional, default ‘False’
flag to display information about the process
- Returns
- astropy.table.Table with the result of the cone_search
- cone_search_criteria(radius, target=None, coordinates=None, calibration_level=None, data_product_type=None, intent=None, obs_collection=None, instrument_name=None, filters=None, async_job=True, filename=None, output_format='votable', save=False, cache=True, verbose=False)[source]¶
To execute a cone search defined by a coordinate (an astropy.coordinate element or a target name which is resolved), a radius and a set of criteria to filter the results. This function comprises the outputs of query_target, cone_search and query_criteria methods.
- Parameters
- radiusfloat or quantity
radius in arcmin (int, float) or quantity of the cone_search
- targetstr, mandatory if no coordinates is provided
name of the target, that will act as center in the cone search
- coordinatesastropy.coordinate, mandatory if no target is provided
coordinates of the center in the cone search
- calibration_levelstr or int, optional
The identifier of the data reduction/processing applied to the data. RAW (1), CALIBRATED (2), PRODUCT (3) or AUXILIARY (0)
- data_product_typestr, optional
High level description of the product. image, spectrum or timeseries.
- intentstr, optional
The intent of the original observer in acquiring this observation. SCIENCE or CALIBRATION
- collectionlist of str, optional
List of collections that are available in eHST catalogue. HLA, HST
- instrument_namelist of str, optional
Name(s) of the instrument(s) used to generate the dataset
- filterslist of str, optional
Name(s) of the filter(s) used to generate the dataset
- async_jobbool, optional, default ‘False’
executes the query (job) in asynchronous/synchronous mode (default synchronous)
- filenamestr, default None
Path and name of the file to store the results. If the filename is defined, the file will be automatically saved
- output_formatstring
results format. Options are: ‘votable’: str, binary VOTable format ‘csv’: str, comma-separated values format
- savebool
optional, default ‘False’ Flag to save the result in a file. If the filename is not defined, it will use a formatted name to save the file
- cachebool
optional, default ‘True’ Flag to save the results in the local cache
- verbosebool, optional, default ‘False’
flag to display information about the process
- Returns
- astropy.table.Table with the result of the cone_search
- download_product(observation_id, *, calibration_level=None, filename=None, verbose=False, product_type=None)[source]¶
Download products from EHST based on their observation ID and the calibration level or the product type.
- Parameters
- observation_idstring
id of the observation to be downloaded, mandatory The identifier of the observation we want to retrieve, regardless of whether it is simple or composite.
- calibration_levelstring
calibration level, optional The identifier of the data reduction/processing applied to the data. By default, the most scientifically relevant level will be chosen. RAW, CALIBRATED, PRODUCT or AUXILIARY
- filenamestring
file name to be used to store the artifact, optional, default None File name for the observation.
- verbosebool
optional, default ‘False’ flag to display information about the process
- product_typestring
type of product retrieval, optional PRODUCT, SCIENCE_PRODUCT or POSTCARD
- Returns
- None. It downloads the observation indicated
- get_artifact(artifact_id, filename=None, verbose=False)[source]¶
Download artifacts from EHST. Artifact is a single Hubble product file.
- Parameters
- artifact_idstring
id of the artifact to be downloaded, mandatory The identifier of the physical product (file) we want to retrieve.
- filenamestring
file name to be used to store the artifact, optional, default None File name for the artifact
- verbosebool
optional, default ‘False’ flag to display information about the process
- Returns
- None. It downloads the artifact indicated
- get_columns(table_name, only_names=True, verbose=False)[source]¶
Get the available columns for a table in EHST TAP service
- Parameters
- table_namestring, mandatory, default None
table name of which, columns will be returned
- only_namesbool, TAP+ only, optional, default ‘False’
True to load table names only
- verbosebool, optional, default ‘False’
flag to display information about the process
- Returns
- A list of columns
- get_hap_hst_link(observation_id)[source]¶
Returns the related members of hap and hst observations
- Parameters
- observation_idstring
id of the observation to be downloaded, mandatory The identifier of the observation we want to retrieve, regardless of whether it is simple or composite.
- Returns
- A list of strings with the observation_id of the associated
- observations
- get_member_observations(observation_id)[source]¶
Returns the related members of simple and composite observations
- Parameters
- observation_idstr
Observation identifier.
- Returns
- A list of strings with the observation_id of the associated
- observations
- get_observation_type(observation_id)[source]¶
Returns the type of an observation
- Parameters
- observation_idstring
id of the observation to be downloaded, mandatory The identifier of the observation we want to retrieve, regardless of whether it is simple or composite.
- Returns
- String with the observation type
- get_postcard(observation_id, calibration_level='RAW', resolution=256, filename=None, verbose=False)[source]¶
Download postcards from EHST
- Parameters
- observation_idstring
id of the observation for which download the postcard, mandatory The identifier of the observation we want to retrieve, regardless of whether it is simple or composite.
- calibration_levelstring
calibration level, optional, default ‘RAW’ The identifier of the data reduction/processing applied to the data. By default, the most scientifically relevant level will be chosen. RAW, CALIBRATED, PRODUCT or AUXILIARY
- resolutioninteger
postcard resolution, optional, default 256 Resolution of the retrieved postcard. 256 or 1024
- filenamestring
file name to be used to store the postcard, optional, default None File name for the artifact
- verbosebool
optional, default ‘False’ Flag to display information about the process
- Returns
- None. It downloads the observation postcard indicated
- get_tables(only_names=True, verbose=False)[source]¶
Get the available table in EHST TAP service
- Parameters
- only_namesbool, TAP+ only, optional, default ‘False’
True to load table names only
- verbosebool, optional, default ‘False’
flag to display information about the process
- Returns
- A list of tables
- query_criteria(calibration_level=None, data_product_type=None, intent=None, obs_collection=None, instrument_name=None, filters=None, async_job=True, output_file=None, output_format='votable', verbose=False, get_query=False)[source]¶
Launches a synchronous or asynchronous job to query the HST tap using calibration level, data product type, intent, collection, instrument name, and filters as criteria to create and execute the associated query.
- Parameters
- calibration_levelstr or int, optional
The identifier of the data reduction/processing applied to the data. RAW (1), CALIBRATED (2), PRODUCT (3) or AUXILIARY (0)
- data_product_typestr, optional
High level description of the product. image, spectrum or timeseries.
- intentstr, optional
The intent of the original observer in acquiring this observation. SCIENCE or CALIBRATION
- collectionlist of str, optional
List of collections that are available in eHST catalogue. HLA, HST
- instrument_namelist of str, optional
Name(s) of the instrument(s) used to generate the dataset
- filterslist of str, optional
Name(s) of the filter(s) used to generate the dataset
- async_jobbool, optional, default ‘True’
executes the query (job) in asynchronous/synchronous mode (default synchronous)
- output_filestr, optional, default None
file name where the results are saved if dumpToFile is True. If this parameter is not provided, the jobid is used instead
- output_formatstr, optional, default ‘votable’
results format
- verbosebool, optional, default ‘False’
flag to display information about the process
- get_querybool, optional, default ‘False’
flag to return the query associated to the criteria as the result of this function.
- Returns
- A table object
- query_hst_tap(query, async_job=False, output_file=None, output_format='votable', verbose=False)[source]¶
Launches a synchronous or asynchronous job to query the HST tap
- Parameters
- querystr, mandatory
query (adql) to be executed
- async_jobbool, optional, default ‘False’
executes the query (job) in asynchronous/synchronous mode (default synchronous)
- output_filestr, optional, default None
file name where the results are saved if dumpToFile is True. If this parameter is not provided, the jobid is used instead
- output_formatstr, optional, default ‘votable’
results format
- verbosebool, optional, default ‘False’
flag to display information about the process
- Returns
- A table object
- query_target(name, *, filename=None, output_format='votable', verbose=False, async_job=False, radius=7)[source]¶
It executes a query over EHST and download the xml with the results.
- Parameters
- namestring
target name to be requested, mandatory
- filenamestring
file name to be used to store the metadata, optional, default None
- output_formatstring
optional, default ‘votable’ output format of the query
- verbosebool
optional, default ‘False’ Flag to display information about the process
- async_jobbool, optional, default ‘False’
executes the query (job) in asynchronous/synchronous mode (default synchronous)
- radiusint
optional, default 7 radius in arcmin (int, float) or quantity of the cone_search
- Returns
- Table with the result of the query. It downloads metadata as a file.