MastClass

class astroquery.mast.MastClass(username=None, password=None, session_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

get_token(*args, **kwargs) Returns MAST token cookie.
login(*args, **kwargs)
logout() Log out of current MAST session.
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(*args, **kwargs) Displays information about current MAST user, and returns user info dictionary.

Methods Documentation

get_token(*args, **kwargs)[source]

Returns MAST token cookie.

Returns:
response : Cookie
login(*args, **kwargs)
logout()[source]

Log out of current MAST session.

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:
service : str

The Mashup service to query.

params : dict

JSON object containing service parameters.

pagesize : int, 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.

page : int, 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:
table : A 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:
service : str

The Mashup service to query.

params : dict

JSON object containing service parameters.

pagesize : int, 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.

page : int, 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:
response : list of requests.Response
session_info(*args, **kwargs)[source]

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

Parameters:
silent : bool, optional

Default False. Suppresses output to stdout.

Returns:
response : dict