MastClass

class astroquery.mast.MastClass(mast_token=None)[source]

Bases: astroquery.query.QueryWithLogin

MAST query class.

Class that allows direct programatic access to the MAST Portal, more flexible but less user friendly than ObservationsClass.

Methods Summary

catalogs_service_request(*args, **kwargs)

Queries the service and returns a table object.

catalogs_service_request_async(service, params)

Given a MAST fabric service and parameters, builds and excecutes a fabric microservice catalog query.

get_token()

Deprecated since version v0.3.9.

login([token, store_token, reenter_token])

Log into the MAST portal.

logout()

Log out of current MAST session.

resolve_object(objectname)

Resolves an object name to a position on the sky.

service_request(*args, **kwargs)

Queries the service and returns a table object.

service_request_async(service, params[, …])

Given a Mashup service and parameters, builds and excecutes a Mashup query.

session_info([silent, verbose])

Displays information about current MAST user, and returns user info dictionary.

Methods Documentation

catalogs_service_request(*args, **kwargs)

Queries the service and returns a table object.

Given a MAST fabric service and parameters, builds and excecutes a fabric microservice catalog query. See documentation here for information about how to build a MAST catalogs microservice request.

Parameters
servicestr

The MAST catalogs service to query. Should be present in self._MAST_CATALOGS_SERVICES

paramsdict

JSON object containing service parameters.

page_sizeint, optional

Default None. Can be used to override the default pagesize (set in configs) for 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.

**kwargs :

See Catalogs.MAST properties in documentation referenced above

Returns
tableA Table object.
catalogs_service_request_async(service, params, page_size=None, page=None, **kwargs)[source]

Given a MAST fabric service and parameters, builds and excecutes a fabric microservice catalog query. See documentation here for information about how to build a MAST catalogs microservice request.

Parameters
servicestr

The MAST catalogs service to query. Should be present in self._MAST_CATALOGS_SERVICES

paramsdict

JSON object containing service parameters.

page_sizeint, optional

Default None. Can be used to override the default pagesize (set in configs) for 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.

**kwargs :

See Catalogs.MAST properties in documentation referenced above

Returns
responselist of Response
get_token()[source]

Deprecated since version v0.3.9: The get_token function is deprecated, session token is now the token used for login.

login(token=None, store_token=False, reenter_token=False)

Log into the MAST portal.

Parameters
tokenstring, optional

Default is None. The token to authenticate the user. This can be generated at https://auth.mast.stsci.edu/token?suggested_name=Astroquery&suggested_scope=mast:exclusive_access. If not supplied, it will be prompted for if not in the keyring or set via $MAST_API_TOKEN

store_tokenbool, optional

Default False. If true, MAST token will be stored securely in your keyring.

reenter_tokenbool, optional

Default False. Asks for the token even if it is already stored in the keyring or $MAST_API_TOKEN environment variable. This is the way to overwrite an already stored password on the keyring.

logout()[source]

Log out of current MAST session.

resolve_object(objectname)[source]

Resolves an object name to a position on the sky.

Parameters
objectnamestr

Name of astronomical object to resolve.

Returns
responseSkyCoord

The sky position of the given object.

service_request(*args, **kwargs)

Queries the service and returns a table object.

Given a Mashup service and parameters, builds and excecutes a Mashup query. See documentation here for information about how to build a Mashup request.

Parameters
servicestr

The Mashup service to query.

paramsdict

JSON object containing service parameters.

pagesizeint, optional

Default None. Can be used to override the default pagesize (set in configs) for 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.

**kwargs :

See MashupRequest properties here for additional keyword arguments.

Returns
tableA Table object.
service_request_async(service, params, pagesize=None, page=None, **kwargs)[source]

Given a Mashup service and parameters, builds and excecutes a Mashup query. See documentation here for information about how to build a Mashup request.

Parameters
servicestr

The Mashup service to query.

paramsdict

JSON object containing service parameters.

pagesizeint, optional

Default None. Can be used to override the default pagesize (set in configs) for 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.

**kwargs :

See MashupRequest properties here for additional keyword arguments.

Returns
responselist of Response
session_info(silent=None, verbose=None)[source]

Displays information about current MAST user, and returns user info dictionary.

Parameters
silent :

Deprecated. Use verbose instead.

verbosebool, optional

Default True. Set to False to suppress output to stdout.

Returns
responsedict