HEASARC

High Energy Astrophysics Science Archive (X-ray and gamma-ray missions).

  • Module name: heasarc

  • Python class: astroquery.heasarc.Heasarc

  • Functions: 13

Call any function below with the astroquery_execute MCP tool. Descriptions are taken from the upstream astroquery/astropy docstrings.

Function

Summary

clear_cache

Removes all cache files.

download_data

Download data products in links with a choice of getting the

enable_cloud

Enable downloading public files from the cloud.

get_default_radius

Get a mission-appropriate default radius for a catalog

list_catalogs

Return a table of all available catalogs with two columns

list_columns

Return the columns available in catalog_name as a table

locate_data

Get links to data products

query_mission_cols

Deprecated: 0.4.8

query_mission_list

Deprecated: 0.4.8

query_object

Deprecated: 0.4.8

query_region

Queries the HEASARC TAP server around a coordinate and returns a

query_tap

Send query to HEASARC’s Xamin TAP using ADQL.

reset_cache_location

Resets the cache location to the default astropy cache

Functions

clear_cache

Call via MCP

astroquery_execute(
    module_name="heasarc",
    function_name="clear_cache",
    params={},
)
HeasarcClass.clear_cache()

Removes all cache files.

download_data

Call via MCP

astroquery_execute(
    module_name="heasarc",
    function_name="download_data",
    params={"links": "<links>"},
)
HeasarcClass.download_data(links, host='heasarc', location='.')

Download data products in links with a choice of getting the data from either the heasarc server, sciserver, or the cloud in AWS.

Parameters:
  • links (astropy.table.Table or astropy.table.Row) – The result from locate_data

  • host (str) – The data host. The options are: heasarc (default), sciserver, aws. If host == ‘sciserver’, data is copied from the local mounted data drive. If host == ‘aws’, data is downloaded from Amazon S3 Open Data Repository.

  • location (str) – local folder where the downloaded file will be saved. Default is current working directory

  • 10GB) (Note that ff you are downloading large datasets (more 10)

:param : :param from the main heasarc server: :param it is recommended that you split: :param it up: :param so that if the downloaded is interrupted: :param you do not need: :param to start again.:

enable_cloud

Call via MCP

astroquery_execute(
    module_name="heasarc",
    function_name="enable_cloud",
    params={},
)
HeasarcClass.enable_cloud(provider='aws', profile=None)

Enable downloading public files from the cloud. Requires the boto3 library to function.

Parameters:
  • provider (str) – Which cloud data provider to use. Currently, only ‘aws’ is supported.

  • profile (str) – Profile to use to identify yourself to the cloud provider (usually in ~/.aws/config).

get_default_radius

Call via MCP

astroquery_execute(
    module_name="heasarc",
    function_name="get_default_radius",
    params={"catalog_name": "<catalog_name>"},
)
HeasarcClass.get_default_radius(catalog_name)

Get a mission-appropriate default radius for a catalog

Parameters:

catalog_name (str) – The name of catalog as a str

Return type:

The radius as `~astropy.units.Quantity`

list_catalogs

Call via MCP

astroquery_execute(
    module_name="heasarc",
    function_name="list_catalogs",
    params={},
)
HeasarcClass.list_catalogs(*, master=False, keywords=None)

Return a table of all available catalogs with two columns (name, description)

Parameters:
  • master (bool) – Select only master catalogs. Default is False

  • keywords (str or list) – a str or a list of str of keywords used as search terms for catalogs. Words with a str separated by a space are AND’ed, while words in a list are OR’ed

Returns:

`~astropy.table.Table` with columns

Return type:

name, description

list_columns

Call via MCP

astroquery_execute(
    module_name="heasarc",
    function_name="list_columns",
    params={"catalog_name": "<catalog_name>"},
)
HeasarcClass.list_columns(catalog_name, full=False)

Return the columns available in catalog_name as a table

Parameters:
  • catalog_name (str) – The name of catalog as a str

  • full (bool) – If True, return all columns, otherwise, return the standard list of columns

Returns:

result – A table with columns: name, description, unit

Return type:

Table

locate_data

Call via MCP

astroquery_execute(
    module_name="heasarc",
    function_name="locate_data",
    params={},
)
HeasarcClass.locate_data(query_result=None, catalog_name=None)

Get links to data products Use vo/datalinks to query the data products for some query_results.

Parameters:
  • query_result (astropy.table.Table or astropy.table.Row, optional) – A table that contain the search results. Typically as returned by query_region. If None, use the table from the most recent query_region call.

  • catalog_name (str) – The catalog name for the which the query_result belongs to. If None, use the one from the most recent query_region call.

Returns:

table

Return type:

A `~astropy.table.Table object.`

query_mission_cols

Call via MCP

astroquery_execute(
    module_name="heasarc",
    function_name="query_mission_cols",
    params={"mission": "<mission>"},
)
HeasarcClass.query_mission_cols(mission, *, cache=True, get_query_payload=False, **kwargs)

Deprecated since version 0.4.8: The query_mission_cols function is deprecated and may be removed in a future version. Use list_columns instead.

Query around a specific object within a given mission catalog

NOTE: This method is deprecated, and is included only for limited backward compatibility with the old astroquery.Heasarc that uses the Browse interface. Please use list_columns instead.

Parameters:
  • mission (str) – Mission catalog (short name) to search from

  • fields (str, optional) – Return format for columns from the server available options: * Standard : Return default catalog columns * All (default) : Return all catalog columns * <custom> : User defined csv list of columns to be returned

  • cache (bool, optional) – Defaults to True. If set overrides global caching behavior. See caching documentation.

  • effect (All other parameters have no)

query_mission_list

Call via MCP

astroquery_execute(
    module_name="heasarc",
    function_name="query_mission_list",
    params={},
)
HeasarcClass.query_mission_list(*, cache=True, get_query_payload=False)

Deprecated since version 0.4.8: The query_mission_list function is deprecated and may be removed in a future version. Use list_catalogs instead.

Returns a list of all available mission catalogs with descriptions.

This method is deprecated, and is included only for limited backward compatibility with the old astroquery.Heasarc that uses the Browse interface. Please use list_catalogs instead.

query_object

Call via MCP

astroquery_execute(
    module_name="heasarc",
    function_name="query_object",
    params={"object_name": "<object_name>", "mission": "<mission>"},
)
HeasarcClass.query_object(object_name, mission, *, cache=True, get_query_payload=False, **kwargs)

Deprecated since version 0.4.8: The query_object function is deprecated and may be removed in a future version. Use query_region instead.

Query around a specific object within a given mission catalog

Parameters:
  • object_name (str) – Object to query around. To set search radius use the ‘radius’ parameter.

  • mission (str) – Mission catalog to search from

  • cache (bool) – Defaults to True. If set overrides global caching behavior. See caching documentation.

  • **kwargs – see _args_to_payload for list of additional parameters that can be used to refine search query.

query_region

Call via MCP

astroquery_execute(
    module_name="heasarc",
    function_name="query_region",
    params={},
)
HeasarcClass.query_region(position=None, catalog=None, radius=None, *, spatial='cone', width=None, polygon=None, add_offset=False, get_query_payload=False, columns=None, cache=False, verbose=False, maxrec=None, **kwargs)

Queries the HEASARC TAP server around a coordinate and returns a Table object.

Parameters:
  • position (str, astropy.coordinates object) – Gives the position of the center of the cone or box if performing a cone or box search. Required if spatial is 'cone' or 'box'. Ignored if spatial is 'polygon' or 'all-sky'.

  • catalog (str) – The catalog to query. To list the available catalogs, use list_catalogs().

  • spatial (str) – Type of spatial query: 'cone', 'box', 'polygon', and 'all-sky'. Defaults to 'cone'.

  • radius (str or Quantity object, [optional for) – spatial == 'cone']. The string must be parsable by Angle. The appropriate Quantity object from astropy.units may also be used. If None, a default value appropriate for the selected catalog is used. To see the default radius for the catalog, see get_default_radius.

  • width (str, Quantity object [Required for) – spatial == 'box'.] The string must be parsable by Angle. The appropriate Quantity object from astropy.units may also be used.

  • polygon (list, [Required for spatial is ````’polygon’:py:class:`]`) – A list of (ra, dec) pairs (as tuples), in decimal degrees, outlining the polygon to search in. It can also be a list of astropy.coordinates object or strings that can be parsed by astropy.coordinates.ICRS.

  • add_offset (bool) – If True and spatial==’cone’, add a search_offset column that indicates the separation (in arcmin) between the requested coordinate and the entry coordinates in the catalog. Default is False.

  • get_query_payload (bool, optional) – If True then returns the generated ADQL query as str. Defaults to False.

  • columns (str, optional) – Target column list with value separated by a comma(,). Use * for all the columns. The default is to return a subset of the columns that are generally the most useful.

  • verbose (bool, optional) – If False, suppress vo warnings.

  • maxrec (int, optional) – Maximum number of records

Returns:

table

Return type:

A `~astropy.table.Table object.`

query_tap

Call via MCP

astroquery_execute(
    module_name="heasarc",
    function_name="query_tap",
    params={"query": "<query>"},
)
HeasarcClass.query_tap(query, *, maxrec=None)

Send query to HEASARC’s Xamin TAP using ADQL. Results in TAPResults format. result.to_table gives Table format.

Parameters:
  • query (str) – ADQL query to be executed

  • maxrec (int) – maximum number of records to return

Returns:

  • result (TAPResults) – TAP query result.

  • result.to_table (Table) – TAP query result as Table

  • result.to_qtable (QTable) – TAP query result as QTable

reset_cache_location

Call via MCP

astroquery_execute(
    module_name="heasarc",
    function_name="reset_cache_location",
    params={},
)
HeasarcClass.reset_cache_location()

Resets the cache location to the default astropy cache