ObservationsClass

class astroquery.mast.ObservationsClass(*args, **kwargs)[source]

Bases: astroquery.mast.MastClass

MAST Observations query class.

Class for querying MAST observational data.

Methods Summary

disable_cloud_dataset()

Disables downloading public files from S3 instead of MAST

disable_s3_hst_dataset()

Deprecated since version v0.3.9.

download_products(products[, download_dir, …])

Download data products.

enable_cloud_dataset([provider, profile, …])

Attempts to enable downloading public files from S3 instead of MAST.

enable_s3_hst_dataset()

Deprecated since version v0.3.9.

filter_products(products[, mrp_only, extension])

Takes an astropy.table.Table of MAST observation data products and filters it based on given filters.

get_cloud_uri(data_product[, …])

Turns a data_product into a cloud URI

get_cloud_uris(data_products[, …])

Takes an astropy.table.Table of data products and turns them into cloud data uris.

get_hst_s3_uri(data_product[, …])

Deprecated since version v0.3.9.

get_hst_s3_uris(data_products[, …])

Deprecated since version v0.3.9.

get_metadata(query_type)

Returns metadata about the requested query type.

get_product_list(*args, **kwargs)

Queries the service and returns a table object.

get_product_list_async(observations)

Given a “Product Group Id” (column name obsid) returns a list of associated data products.

list_missions()

Lists data missions archived by MAST and avaiable through astroquery.mast.

query_criteria(*args, **kwargs)

Queries the service and returns a table object.

query_criteria_async([pagesize, page])

Given an set of filters, returns a list of MAST observations.

query_criteria_count([pagesize, page])

Given an set of filters, returns the number of MAST observations meeting those criteria.

query_object(*args, **kwargs)

Queries the service and returns a table object.

query_object_async(objectname[, radius, …])

Given an object name, returns a list of MAST observations.

query_object_count(objectname[, radius, …])

Given an object name, returns the number of MAST observations.

query_region(*args, **kwargs)

Queries the service and returns a table object.

query_region_async(coordinates[, radius, …])

Given a sky position and radius, returns a list of MAST observations.

query_region_count(coordinates[, radius, …])

Given a sky position and radius, returns the number of MAST observations in that region.

Methods Documentation

disable_cloud_dataset()[source]

Disables downloading public files from S3 instead of MAST

disable_s3_hst_dataset()[source]

Deprecated since version v0.3.9: The disable_s3_hst_dataset function is deprecated and may be removed in a future version. Use disable_cloud_dataset instead.

download_products(products, download_dir=None, cache=True, curl_flag=False, mrp_only=False, **filters)[source]

Download data products.

Parameters
productsstr, list, astropy.table.Table

Either a single or list of obsids (as can be given to get_product_list), or a Table of products (as is returned by get_product_list)

download_dirstr, optional

Optional. Directory to download files to. Defaults to current directory.

cachebool, optional

Default is True. If file is found on disc it will not be downloaded again. Note: has no affect when downloading curl script.

curl_flagbool, optional

Default is False. If true instead of downloading files directly, a curl script will be downloaded that can be used to download the data files at a later time.

mrp_onlybool, optional

Default False. When set to true only “Minimum Recommended Products” will be returned.

**filters :

Filters to be applied. Valid filters are all products fields listed here and ‘extension’ which is the desired file extension. The Column Name (or ‘extension’) is the keyword, with the argument being one or more acceptable values for that parameter. Filter behavior is AND between the filters and OR within a filter set. For example: productType=”SCIENCE”,extension=[“fits”,”jpg”]

Returns
responseTable

The manifest of files downloaded, or status of files on disk if curl option chosen.

enable_cloud_dataset(provider='AWS', profile=None, verbose=True)[source]

Attempts to enable downloading public files from S3 instead of MAST. Requires the boto3 library to function.

Parameters
providerstr

Which cloud data provider to use. We may in the future support multiple providers, though at the moment this argument is ignored.

profilestr

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

verbosebool

Default True. Logger to display extra info and warning.

enable_s3_hst_dataset()[source]

Deprecated since version v0.3.9: The enable_s3_hst_dataset function is deprecated and may be removed in a future version. Use enable_cloud_dataset instead.

filter_products(products, mrp_only=False, extension=None, **filters)[source]

Takes an astropy.table.Table of MAST observation data products and filters it based on given filters.

Parameters
productsastropy.table.Table

Table containing data products to be filtered.

mrp_onlybool, optional

Default False. When set to true only “Minimum Recommended Products” will be returned.

extensionstring or array, optional

Default None. Option to filter by file extension.

**filters :

Filters to be applied. Valid filters are all products fields listed here. The column name is the keyword, with the argument being one or more acceptable values for that parameter. Filter behavior is AND between the filters and OR within a filter set. For example: productType=”SCIENCE”,extension=[“fits”,”jpg”]

Returns
responseTable
get_cloud_uri(data_product, include_bucket=True, full_url=False)[source]

Turns a data_product into a cloud URI

Parameters
data_productastropy.table.Table

Product to be converted into cloud data uri.

include_bucketbool

When either to include the cloud bucket prefix in the result or not.

full_urlstr

Return a HTTP fetchable url instead of a uri.

Returns
struri generated from the data product
get_cloud_uris(data_products, include_bucket=True, full_url=False)[source]

Takes an astropy.table.Table of data products and turns them into cloud data uris.

Parameters
data_productsastropy.table.Table

Table containing products to be converted into cloud data uris.

include_bucketbool

When either to include the cloud bucket prefix in the result or not.

full_urlstr

Return a HTTP fetchable url instead of a uri.

Returns
listList of uris generated from the data products
get_hst_s3_uri(data_product, include_bucket=True, full_url=False)[source]

Deprecated since version v0.3.9: The get_hst_s3_uri function is deprecated and may be removed in a future version. Use get_cloud_uri instead.

get_hst_s3_uris(data_products, include_bucket=True, full_url=False)[source]

Deprecated since version v0.3.9: The get_hst_s3_uris function is deprecated and may be removed in a future version. Use get_cloud_uris instead.

get_metadata(query_type)[source]

Returns metadata about the requested query type.

Parameters
query_typestr

The query to get metadata for. Options are observations, and products.

Returns
responseTable

The metadata table.

get_product_list(*args, **kwargs)

Queries the service and returns a table object.

Given a “Product Group Id” (column name obsid) returns a list of associated data products. See column documentation here.

Parameters
observationsstr or astropy.table.Row or list/Table of same

Row/Table of MAST query results (e.g. output from query_object) or single/list of MAST Product Group Id(s) (obsid). See description here.

Returns
tableA Table object.
get_product_list_async(observations)[source]

Given a “Product Group Id” (column name obsid) returns a list of associated data products. See column documentation here.

Parameters
observationsstr or astropy.table.Row or list/Table of same

Row/Table of MAST query results (e.g. output from query_object) or single/list of MAST Product Group Id(s) (obsid). See description here.

Returns
responselist of Response
list_missions()[source]

Lists data missions archived by MAST and avaiable through astroquery.mast.

Returns
responselist

List of available missions.

query_criteria(*args, **kwargs)

Queries the service and returns a table object.

Given an set of filters, returns a list of MAST observations. See column documentation here.

Parameters
pagesizeint, optional

Can be used to override the default pagesize. E.g. when using a slow internet connection.

pageint, optional

Can be used to override the default behavior of all results being returned to obtain one sepcific page of results.

**criteria

Criteria to apply. At least one non-positional criteria must be supplied. Valid criteria are coordinates, objectname, radius (as in query_region and query_object), and all observation fields listed here. The Column Name is the keyword, with the argument being one or more acceptable values for that parameter, except for fields with a float datatype where the argument should be in the form [minVal, maxVal]. For non-float type criteria wildcards maybe used (both * and % are considered wildcards), however only one wildcarded value can be processed per criterion. RA and Dec must be given in decimal degrees, and datetimes in MJD. For example: filters=[“FUV”,”NUV”],proposal_pi=”Ost*”,t_max=[52264.4586,54452.8914]

Returns
tableA Table object.
query_criteria_async(pagesize=None, page=None, **criteria)[source]

Given an set of filters, returns a list of MAST observations. See column documentation here.

Parameters
pagesizeint, optional

Can be used to override the default pagesize. E.g. when using a slow internet connection.

pageint, optional

Can be used to override the default behavior of all results being returned to obtain one sepcific page of results.

**criteria

Criteria to apply. At least one non-positional criteria must be supplied. Valid criteria are coordinates, objectname, radius (as in query_region and query_object), and all observation fields listed here. The Column Name is the keyword, with the argument being one or more acceptable values for that parameter, except for fields with a float datatype where the argument should be in the form [minVal, maxVal]. For non-float type criteria wildcards maybe used (both * and % are considered wildcards), however only one wildcarded value can be processed per criterion. RA and Dec must be given in decimal degrees, and datetimes in MJD. For example: filters=[“FUV”,”NUV”],proposal_pi=”Ost*”,t_max=[52264.4586,54452.8914]

Returns
responselist of Response
query_criteria_count(pagesize=None, page=None, **criteria)[source]

Given an set of filters, returns the number of MAST observations meeting those criteria.

Parameters
pagesizeint, optional

Can be used to override the default pagesize. E.g. when using a slow internet connection.

pageint, optional

Can be used to override the default behavior of all results being returned to obtain one sepcific page of results.

**criteria

Criteria to apply. At least one non-positional criterion must be supplied. Valid criteria are coordinates, objectname, radius (as in query_region and query_object), and all observation fields listed here. The Column Name is the keyword, with the argument being one or more acceptable values for that parameter, except for fields with a float datatype where the argument should be in the form [minVal, maxVal]. For non-float type criteria wildcards maybe used (both * and % are considered wildcards), however only one wildcarded value can be processed per criterion. RA and Dec must be given in decimal degrees, and datetimes in MJD. For example: filters=[“FUV”,”NUV”],proposal_pi=”Ost*”,t_max=[52264.4586,54452.8914]

Returns
responseint
query_object(*args, **kwargs)

Queries the service and returns a table object.

Given an object name, returns a list of MAST observations. See column documentation here.

Parameters
objectnamestr

The name of the target around which to search.

radiusstr or Quantity object, optional

Default 0.2 degrees. The string must be parsable by astropy.coordinates.Angle. The appropriate Quantity object from astropy.units may also be used. Defaults to 0.2 deg.

pagesizeint, optional

Default None. Can be used to override the default pagesize for (set in configs) this query only. E.g. when using a slow internet connection.

pageint, optional

Defaulte None. Can be used to override the default behavior of all results being returned to obtain a specific page of results.

Returns
tableA Table object.
query_object_async(objectname, radius=<Quantity 0.2 deg>, pagesize=None, page=None)[source]

Given an object name, returns a list of MAST observations. See column documentation here.

Parameters
objectnamestr

The name of the target around which to search.

radiusstr or Quantity object, optional

Default 0.2 degrees. The string must be parsable by astropy.coordinates.Angle. The appropriate Quantity object from astropy.units may also be used. Defaults to 0.2 deg.

pagesizeint, optional

Default None. Can be used to override the default pagesize for (set in configs) this query only. E.g. when using a slow internet connection.

pageint, optional

Defaulte None. Can be used to override the default behavior of all results being returned to obtain a specific page of results.

Returns
responselist of Response
query_object_count(objectname, radius=<Quantity 0.2 deg>, pagesize=None, page=None)[source]

Given an object name, returns the number of MAST observations.

Parameters
objectnamestr

The name of the target around which to search.

radiusstr or Quantity object, optional

The string must be parsable by astropy.coordinates.Angle. The appropriate Quantity object from astropy.units may also be used. Defaults to 0.2 deg.

pagesizeint, optional

Can be used to override the default pagesize. E.g. when using a slow internet connection.

pageint, optional

Can be used to override the default behavior of all results being returned to obtain one sepcific page of results.

Returns
responseint
query_region(*args, **kwargs)

Queries the service and returns a table object.

Given a sky position and radius, returns a list of MAST observations. See column documentation here.

Parameters
coordinatesstr or astropy.coordinates object

The target around which to search. It may be specified as a string or as the appropriate astropy.coordinates object.

radiusstr or Quantity object, optional

Default 0.2 degrees. The string must be parsable by astropy.coordinates.Angle. The appropriate Quantity object from astropy.units may also be used. Defaults to 0.2 deg.

pagesizeint, optional

Default None. Can be used to override the default pagesize for (set in configs) this query only. E.g. when using a slow internet connection.

pageint, optional

Default None. Can be used to override the default behavior of all results being returned to obtain a specific page of results.

Returns
tableA Table object.
query_region_async(coordinates, radius=<Quantity 0.2 deg>, pagesize=None, page=None)[source]

Given a sky position and radius, returns a list of MAST observations. See column documentation here.

Parameters
coordinatesstr or astropy.coordinates object

The target around which to search. It may be specified as a string or as the appropriate astropy.coordinates object.

radiusstr or Quantity object, optional

Default 0.2 degrees. The string must be parsable by astropy.coordinates.Angle. The appropriate Quantity object from astropy.units may also be used. Defaults to 0.2 deg.

pagesizeint, optional

Default None. Can be used to override the default pagesize for (set in configs) this query only. E.g. when using a slow internet connection.

pageint, optional

Default None. Can be used to override the default behavior of all results being returned to obtain a specific page of results.

Returns
responselist of Response
query_region_count(coordinates, radius=<Quantity 0.2 deg>, pagesize=None, page=None)[source]

Given a sky position and radius, returns the number of MAST observations in that region.

Parameters
coordinatesstr or astropy.coordinates object

The target around which to search. It may be specified as a string or as the appropriate astropy.coordinates object.

radiusstr or Quantity object, optional

The string must be parsable by astropy.coordinates.Angle. The appropriate Quantity object from astropy.units may also be used. Defaults to 0.2 deg.

pagesizeint, optional

Can be used to override the default pagesize for. E.g. when using a slow internet connection.

pageint, optional

Can be used to override the default behavior of all results being returned to obtain a specific page of results.

Returns
responseint