astro query:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- astroquery v0.4.11 »
- ESA HST Archive (`astroquery.esa.hubble`) »
- ESAHubbleClass

# ESAHubbleClass

class astroquery.esa.hubble.ESAHubbleClass(*, show_messages=True, auth_session=None)

  Bases: `BaseVOQuery`, `BaseQuery`

  Class to init ESA Hubble Module and communicate with eHST TAP

  Attributes Summary

  `TIMEOUT` |
  `calibration_levels` |
  `copying_string` |
  `product_types` |
  `tap` |

  Methods Summary

  `cone_search`(coordinates, radius, *[, ...]) | 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_file`(file, *[, filename, folder, ...]) | Download a file from eHST based on its filename.
  `download_files_from_program`(program, *[, ...]) | Download artifacts from EHST.
  `download_fits_files`(observation_id, *[, ...]) | Retrieves all the FITS files associated to an observation
  `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, ...]) | Download artifacts from EHST.
  `get_associated_files`(observation_id, *[, ...]) | Retrieves all the files associated to an observation
  `get_columns`(table_name, *[, only_names, verbose]) | Get the available columns for a table in EHST TAP service
  `get_datalabs_path`(filename[, default_volume]) | 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_observations_from_program`(program, *[, ...]) | Retrieves all the observations associated to a program/proposal ID
  `get_postcard`(observation_id, *[, ...]) | Download postcards from EHST
  `get_status_messages`() | Retrieve the messages to inform users about the status of eHST TAP
  `get_tables`(*[, only_names, verbose]) | Get the available table in EHST TAP service
  `parse_messages_response`(response) |
  `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_metadata`(*[, output_format, verbose]) |
  `query_tap`(query, *[, async_job, ...]) | Launches a synchronous or asynchronous job to query the HST tap
  `query_target`(name, *[, filename, ...]) | It executes a query over EHST and download the xml with the results.

  Attributes Documentation

  TIMEOUT = 60
  calibration_levels = {'AUXILIARY': 0, 'CALIBRATED': 2, 'PRODUCT': 3, 'RAW': 1}
  copying_string = 'Copying file to {0}...'
  product_types = ['SCIENCE', 'PREVIEW', 'THUMBNAIL', 'AUXILIARY']
  tap

  Methods Documentation

  cone_search(coordinates, radius, *, filename=None, output_format='votable', cache=True, async_job=False, verbose=False)

    To execute a cone search defined by a coordinate and a radius

    Parameters:
      coordinates astropy.coordinate, mandatory

        coordinates of the center in the cone search

      radius float or quantity

        radius in arcmin (int, float) or quantity of the cone_search

      filename str, default None

        Path and name of the file to store the results. If the filename is defined, the file will be automatically saved

      output_format string

        results format. Options are: ‘votable’: str, binary VOTable format ‘csv’: str, comma-separated values format

      async_job bool, optional, default ‘False’

        executes the query (job) in asynchronous/synchronous mode (default synchronous)

      cache bool

        optional, default ‘True’ Flag to save the results in the local cache

      verbose bool, 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, proposal=None, async_job=True, filename=None, output_format='votable', save=False, cache=True, verbose=False)

    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:
      radius float or quantity

        radius in arcmin (int, float) or quantity of the cone_search

      target str, mandatory if no coordinates is provided

        name of the target, that will act as center in the cone search

      coordinates astropy.coordinate, mandatory if no target is provided

        coordinates of the center in the cone search

      calibration_level str 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_type str, optional

        High level description of the product. image, spectrum or timeseries.

      intent str, optional

        The intent of the original observer in acquiring this observation. SCIENCE or CALIBRATION

      collection list of str, optional

        List of collections that are available in eHST catalogue. HLA, HST

      instrument_name list of str, optional

        Name(s) of the instrument(s) used to generate the dataset

      filters list of str, optional

        Name(s) of the filter(s) used to generate the dataset

      proposal int, optional

        Proposal ID associated to the observations

      async_job bool, optional, default ‘False’

        executes the query (job) in asynchronous/synchronous mode (default synchronous)

      filename str, default None

        Path and name of the file to store the results. If the filename is defined, the file will be automatically saved

      output_format string

        results format. Options are: ‘votable’: str, binary VOTable format ‘csv’: str, comma-separated values format

      save bool

        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

      cache bool

        optional, default ‘True’ Flag to save the results in the local cache

      verbose bool, optional, default ‘False’

        flag to display information about the process

    Returns:
      astropy.table.Table with the result of the cone_search
  download_file(file, *, filename=None, folder=None, verbose=False)

    Download a file from eHST based on its filename.

    Parameters:
      file string

        file name of the artifact to be downloaded

      filename string

        file name to be used to store the file, optional, default None

      folder string

        optional, default current path Local folder to store the file

      verbose bool

        optional, default ‘False’ flag to display information about the process

    Returns:
      None. The file is associated
  download_files_from_program(program, *, folder=None, calibration_level=None, data_product_type=None, intent=None, obs_collection=None, instrument_name=None, filters=None, only_fits=False)

    Download artifacts from EHST. Artifact is a single Hubble product file.

    Parameters:
      program int

        Program or Proposal ID associated to the observations

      folder string

        optional, default current path Local folder to store the file

      calibration_level str 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_type str, optional

        High level description of the product. image, spectrum or timeseries.

      intent str, optional

        The intent of the original observer in acquiring this observation. SCIENCE or CALIBRATION

      obs_collection list of str, optional

        List of collections that are available in eHST catalogue. HLA, HST, HAP

      instrument_name str or list of str, optional

        Name(s) of the instrument(s) used to generate the dataset

      filters list of str, optional

        Name(s) of the filter(s) used to generate the dataset

      only_fits bool

        optional, default ‘False’ flag to download only FITS files

    Returns:
      None. It downloads the artifact indicated
  download_fits_files(observation_id, *, folder=None, verbose=False)

    Retrieves all the FITS files associated to an observation

    Parameters:
      observation_id string or list of strings

        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.

      folder string

        optional, default current path Local folder to store the file

      verbose bool

        optional, default ‘False’ flag to display information about the process

    Returns:
      None. The file is associated
  download_product(observation_id, *, calibration_level=None, filename=None, folder=None, verbose=False, product_type=None)

    Download products from EHST based on their observation ID and the calibration level or the product type.

    Parameters:
      observation_id string

        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_level string

        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

      filename string

        File name to be used to store the artifact, optional, default None

      folder string

        optional, default current folder Local folder to store the file

      verbose bool

        optional, default ‘False’ flag to display information about the process

      product_type string

        type of product retrieval, optional SCIENCE, PREVIEW, THUMBNAIL or AUXILIARY ———— Deprecation Warning: PRODUCT, SCIENCE_PRODUCT or POSTCARD are no longer supported. ————

    Returns:
      None. It downloads the observation indicated
  get_artifact(artifact_id, *, filename=None, folder=None, verbose=False)

    Download artifacts from EHST. Artifact is a single Hubble product file.

    Parameters:
      artifact_id string

        filename to be downloaded, mandatory The identifier of the physical product (file) we want to retrieve.

      filename string

        file name to be used to store the artifact, optional, default None File name for the artifact

      folder string

        optional, default current path Local folder to store the file

      verbose bool

        optional, default ‘False’ flag to display information about the process

    Returns:
      None. It downloads the artifact indicated
  get_associated_files(observation_id, *, verbose=False)

    Retrieves all the files associated to an observation

    Parameters:
      observation_id string or list of strings

        id(s) of the observation(s) to be downloaded, mandatory The identifier of the observation we want to retrieve, regardless of whether it is simple or composite.

      verbose bool

        optional, default ‘False’ flag to display information about the process

    Returns:
      None. The file is associated
  get_columns(table_name, *, only_names=True, verbose=False)

    Get the available columns for a table in EHST TAP service

    Parameters:
      table_name string, mandatory, default None

        table name of which, columns will be returned

      only_names bool, TAP+ only, optional, default ‘False’

        True to load table names only

      verbose bool, optional, default ‘False’

        flag to display information about the process

    Returns:
      A list of columns
  get_datalabs_path(filename, default_volume=None)

    Get the available columns for a table in EHST TAP service

    Parameters:
      filename string, mandatory, default None

        file name to search for its full path

      default_volume string, optional, default None

        Default folder name in datalabs. If None, it is filled automatically

    Returns:
      The complete path of the file name in Datalabs
  get_hap_hst_link(observation_id)

    Returns the related members of hap and hst observations

    Parameters:
      observation_id string

        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)

    Returns the related members of simple and composite observations

    Parameters:
      observation_id str

        Observation identifier.

    Returns:
      A list of strings with the observation_id of the associated
      observations
  get_observation_type(observation_id)

    Returns the type of an observation

    Parameters:
      observation_id string

        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_observations_from_program(program, *, output_file=None, output_format='votable', verbose=False)

    Retrieves all the observations associated to a program/proposal ID

    Parameters:
      program int

        Program or Proposal ID associated to the observations

      output_file string

        optional, default None file name to be used to store the result

      output_format string

        results format. Options are: ‘votable’: str, binary VOTable format ‘csv’: str, comma-separated values format

      verbose bool

        optional, default ‘False’ flag to display information about the process

    Returns:
      A table object
  get_postcard(observation_id, *, calibration_level='RAW', resolution=256, filename=None, verbose=False)

    Download postcards from EHST

    Parameters:
      observation_id string

        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_level string

        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

      resolution integer

        postcard resolution, optional, default 256 Resolution of the retrieved postcard. 256 or 1024

      filename string

        file name to be used to store the postcard, optional, default None File name for the artifact

      verbose bool

        optional, default ‘False’ Flag to display information about the process

    Returns:
      None. It downloads the observation postcard indicated
  get_status_messages()

    Retrieve the messages to inform users about the status of eHST TAP

  get_tables(*, only_names=True, verbose=False)

    Get the available table in EHST TAP service

    Parameters:
      only_names bool, TAP+ only, optional, default ‘False’

        True to load table names only

      verbose bool, optional, default ‘False’

        flag to display information about the process

    Returns:
      A list of tables
  parse_messages_response(response)
  query_criteria(*, calibration_level=None, data_product_type=None, intent=None, obs_collection=None, instrument_name=None, filters=None, proposal=None, async_job=True, output_file=None, output_format='votable', verbose=False, get_query=False)

    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_level str 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_type str, optional

        High level description of the product. image, spectrum or timeseries.

      intent str, optional

        The intent of the original observer in acquiring this observation. SCIENCE or CALIBRATION

      obs_collection list of str, optional

        List of collections that are available in eHST catalogue. HLA, HST, HAP

      instrument_name str or list of str, optional

        Name(s) of the instrument(s) used to generate the dataset

      filters list of str, optional

        Name(s) of the filter(s) used to generate the dataset

      proposal int, optional

        Proposal ID associated to the observations

      async_job bool, optional, default ‘True’

        executes the query (job) in asynchronous/synchronous mode (default synchronous)

      output_file str, 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_format str, optional, default ‘votable’

        results format

      verbose bool, optional, default ‘False’

        flag to display information about the process

      get_query bool, optional, default ‘False’

        flag to return the query associated to the criteria as the result of this function.

    Returns:
      A table object
  query_metadata(*, output_format='votable', verbose=False)
  query_tap(query, *, async_job=False, output_file=None, output_format='votable', verbose=False)

    Launches a synchronous or asynchronous job to query the HST tap

    Parameters:
      query str, mandatory

        query (adql) to be executed

      async_job bool, optional, default ‘False’

        executes the query (job) in asynchronous/synchronous mode (default synchronous)

      output_file str, 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_format str, optional, default ‘votable’

        results format

      verbose bool, 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)

    It executes a query over EHST and download the xml with the results.

    Parameters:
      name string

        target name to be requested, mandatory

      filename string

        file name to be used to store the metadata, optional, default None

      output_format string

        optional, default ‘votable’ output format of the query

      verbose bool

        optional, default ‘False’ Flag to display information about the process

      async_job bool, optional, default ‘False’

        executes the query (job) in asynchronous/synchronous mode (default synchronous)

      radius int

        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.