HSAClass

class astroquery.esa.hsa.HSAClass(tap_handler=None)[source]

Bases: BaseQuery

Attributes Summary

data_url

metadata_url

timeout

Methods Summary

download_data(*[, retrieval_type, ...])

Download data from Herschel

get_columns(table_name, *[, only_names, verbose])

Get the available columns for a table in HSA TAP service

get_observation(observation_id, ...[, ...])

Download observation from Herschel.

get_postcard(observation_id, instrument_name, *)

Download postcard from Herschel

get_tables(*[, only_names, verbose])

Get the available table in HSA TAP service

query_hsa_tap(query, *[, output_file, ...])

Launches a synchronous job to query HSA Tabular Access Protocol (TAP) Service

query_observations(coordinate, radius, *[, ...])

Get the observation IDs from a given region

query_region(coordinate, radius, *[, n_obs, ...])

Get the observation metadata from a given region

Attributes Documentation

data_url = 'http://archives.esac.esa.int/hsa/whsa-tap-server/data?'
metadata_url = 'http://archives.esac.esa.int/hsa/whsa-tap-server/tap'
timeout = 60

Methods Documentation

download_data(*, retrieval_type='OBSERVATION', observation_id=None, instrument_name=None, filename=None, observation_oid=None, instrument_oid=None, product_level=None, verbose=False, download_dir='', cache=True, **kwargs)[source]

Download data from Herschel

Parameters:
observation_idstring, optional

id of the observation to be downloaded The identifies of the observation we want to retrieve, 10 digits example: 1342195355

retrieval_typestring, optional, default ‘OBSERVATION’

The type of product that we want to retrieve values: OBSERVATION, PRODUCT, POSTCARD, POSTCARDFITS, REQUESTFILE_XML, STANDALONE, UPDP, HPDP

instrument_namestring, optional, default ‘PACS’

values: PACS, SPIRE, HIFI The instrument name, by default ‘PACS’ if the retrieval_type is ‘OBSERVATION’

filenamestring, optional, default None

If the filename is not set it will use the observation_id as filename file name to be used to store the file

verbosebool, optional, default False

flag to display information about the process

observation_oidstring, optional

Observation internal identifies. This is the database identifier

instrument_oidstring, optional

The database identifies of the instrument values: 1, 2, 3

product_levelstring, optional

level to download values: ALL, AUXILIARY, CALIBRATION, LEVEL0, LEVEL0_5, LEVEL1, LEVEL2, LEVEL2_5, LEVEL3, ALL-LEVEL3

download_dirstring, optional

The directory in which the file will be downloaded

Returns:
File name of downloaded data
get_columns(table_name, *, only_names=True, verbose=False)[source]

Get the available columns for a table in HSA TAP service

Parameters:
table_namestring

table name of which, columns will be returned

only_namesbool, optional, default True

True to load column names only

verbosebool, optional, default False

flag to display information about the process

Returns:
A list of columns
get_observation(observation_id, instrument_name, *, filename=None, observation_oid=None, instrument_oid=None, product_level=None, verbose=False, download_dir='', cache=True, **kwargs)[source]

Download observation from Herschel. This consists of a .tar file containing:

  • The auxiliary directory: contains all Herschel non-science spacecraft data

  • The calibarion directory: contains the uplink and downlink calibration products

  • <obs_id> directory: contains the science data distributed in sub-directories called level0/0.5/1/2/2.5/3.

More information can be found here:

https://www.cosmos.esa.int/web/herschel/data-products-overview

Parameters:
observation_idstring

id of the observation to be downloaded The identifies of the observation we want to retrieve, 10 digits example: 1342195355

instrument_namestring

The instrument name values: PACS, SPIRE, HIFI

filenamestring, optional, default None

If the filename is not set it will use the observation_id as filename file name to be used to store the file

verbosebool, optional, default ‘False’

flag to display information about the process

observation_oidstring, optional

Observation internal identifies. This is the database identifier

istrument_oidstring, optional

The database identifies of the instrument values: 1, 2, 3

product_levelstring, optional

level to download values: ALL, AUXILIARY, CALIBRATION, LEVEL0, LEVEL0_5, LEVEL1, LEVEL2, LEVEL2_5, LEVEL3, ALL-LEVEL3

download_dirstring, optional

The directory in which the file will be downloaded

Returns:
File name of downloaded data
get_postcard(observation_id, instrument_name, *, filename=None, verbose=False, download_dir='', cache=True, **kwargs)[source]

Download postcard from Herschel

Parameters:
observation_idstring

id of the observation to be downloaded The identifies of the observation we want to retrieve, 10 digits example: 1342195355

instrument_namestring

The instrument name values: PACS, SPIRE, HIFI

filenamestring, optional, default None

If the filename is not set it will use the observation_id as filename file name to be used to store the file

verbosebool, optional, default False

flag to display information about the process

observation_oidstring, optional

Observation internal identifies. This is the database identifier

istrument_oidstring, optional

The database identifies of the instrument values: 1, 2, 3

product_levelstring, optional

level to download values: ALL, AUXILIARY, CALIBRATION, LEVEL0, LEVEL0_5, LEVEL1, LEVEL2, LEVEL2_5, LEVEL3, ALL-LEVEL3

postcard_singlestring, optional

‘true’ to retrieve one single postcard (main one) values: true, false

download_dirstring, optional

The directory in which the file will be downloaded

Returns:
File name of downloaded data
get_tables(*, only_names=True, verbose=False)[source]

Get the available table in HSA TAP service

Parameters:
only_namesbool, optional, default True

True to load table names only

verbosebool, optional, default False

flag to display information about the process

Returns:
A list of tables
query_hsa_tap(query, *, output_file=None, output_format='votable', verbose=False)[source]

Launches a synchronous job to query HSA Tabular Access Protocol (TAP) Service

Parameters:
querystring

query (adql) to be executed

output_filestring, 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_formatstring, optional, default ‘votable’

values ‘votable’ or ‘csv’

verbosebool, optional, default ‘False’

flag to display information about the process

Returns:
A table object
query_observations(coordinate, radius, *, n_obs=10, **kwargs)[source]

Get the observation IDs from a given region

Parameters:
coordinatestring / astropy.coordinates

the identifier or coordinates around which to query

radiusint / Quantity

the radius of the region

n_obsint, optional

the number of observations

kwargsdict

passed to query_hsa_tap

Returns:
A table object with the list of observations in the region
query_region(coordinate, radius, *, n_obs=10, columns='*', **kwargs)[source]

Get the observation metadata from a given region

Parameters:
coordinatestring / astropy.coordinates

the identifier or coordinates around which to query

radiusint / Quantity

the radius of the region

n_obsint, optional

the number of observations

columnsstr, optional

the columns to retrieve from the data table

kwargsdict

passed to query_hsa_tap

Returns:
A table object with the list of observations in the region