MastMissionsClass¶
- class astroquery.mast.MastMissionsClass(*, mission='hst', service='search')[source]¶
Bases:
MastQueryWithLogin
MastMissions search class. Class that allows direct programmatic access to retrieve metadata via the MAST search API for a given mission.
Attributes Summary
Methods Summary
__call__
(*args, **kwargs)init a fresh copy of self
Removes all cache files.
enable_cloud_dataset
([provider, profile, ...])For a mission, return a list of all searchable columns and their descriptions
login
([token, store_token, reenter_token])Log into the MAST portal.
logout
()Log out of current MAST session.
query_criteria
(*args, **kwargs)Queries the service and returns a table object.
query_criteria_async
(*[, coordinates, ...])Given a set of search criteria, returns a list of mission metadata.
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 matching rows.
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 matching dataset IDs.
Resets the cache location to the default astropy cache
resolve_object
(objectname)Resolves an object name to a position on the sky.
session_info
([verbose])Displays information about current MAST user, and returns user info dictionary.
Attributes Documentation
- cache_location¶
Methods Documentation
- __call__(*args, **kwargs)¶
init a fresh copy of self
- authenticated()¶
- clear_cache()¶
Removes all cache files.
- disable_cloud_dataset()¶
Deprecated since version v0.4.8: This function is non-operational and will be removed in a future release.
Disables downloading public files from S3 instead of MAST.
- enable_cloud_dataset(provider='AWS', profile=None, verbose=True)¶
Deprecated since version v0.4.8: This function is non-operational and will be removed in a future release.
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.
- get_column_list()[source]¶
For a mission, return a list of all searchable columns and their descriptions
- Returns:
- response
Table
that contains columns names, types, and descriptions
- response
- 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://ssoportal.stsci.edu/idp/profile/SAML2/Redirect/SSO?execution=e1s1 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()¶
Log out of current MAST session.
- query_criteria(*args, **kwargs)¶
Queries the service and returns a table object.
Given a set of search criteria, returns a list of mission metadata.
- Parameters:
- coordinatesstr or
coordinates
object The target around which to search. It may be specified as a string or as the appropriate
coordinates
object.- objectnamestr
The name of the target around which to search.
- radiusstr or
Quantity
object, optional Default 3 degrees. The string must be parsable by
Angle
. The appropriateQuantity
object fromunits
may also be used. Defaults to 3 arcminutes.- limitint
Optional and default is 5000. the maximum number of dataset IDs in the results.
- offsetint
Optional and default is 0. the number of records you wish to skip before selecting records.
- select_cols: list
names of columns that will be included in the astropy table
- **criteria
Criteria to apply. At least one non-positional criterion must be supplied. Valid criteria are coordinates, objectname, radius (as in
query_region
andquery_object
functions), and all fields listed in the column documentation for the mission being queried. List of all valid fields that can be used to match results on criteria can be retrieved by callingget_column_list
function.
- coordinatesstr or
- Returns:
- tableA
Table
object.
- tableA
- query_criteria_async(*, coordinates=None, objectname=None, radius=<Quantity 3. arcmin>, limit=5000, offset=0, select_cols=[], **criteria)[source]¶
Given a set of search criteria, returns a list of mission metadata.
- Parameters:
- coordinatesstr or
coordinates
object The target around which to search. It may be specified as a string or as the appropriate
coordinates
object.- objectnamestr
The name of the target around which to search.
- radiusstr or
Quantity
object, optional Default 3 degrees. The string must be parsable by
Angle
. The appropriateQuantity
object fromunits
may also be used. Defaults to 3 arcminutes.- limitint
Optional and default is 5000. the maximum number of dataset IDs in the results.
- offsetint
Optional and default is 0. the number of records you wish to skip before selecting records.
- select_cols: list
names of columns that will be included in the astropy table
- **criteria
Criteria to apply. At least one non-positional criterion must be supplied. Valid criteria are coordinates, objectname, radius (as in
query_region
andquery_object
functions), and all fields listed in the column documentation for the mission being queried. List of all valid fields that can be used to match results on criteria can be retrieved by callingget_column_list
function.
- coordinatesstr or
- Returns:
- responselist of
Response
- responselist of
- query_object(*args, **kwargs)¶
Queries the service and returns a table object.
Given an object name, returns a list of matching rows.
- Parameters:
- objectnamestr
The name of the target around which to search.
- radiusstr or
Quantity
object, optional Default 3 arcmin. The string must be parsable by
Angle
. The appropriateQuantity
object fromunits
may also be used. Defaults to 3 arcminutes.- limitint
Optional and default is 5000. the maximum number of dataset IDs in the results.
- offsetint
Optional and default is 0. the number of records you wish to skip before selecting records.
- **criteria
Other mission-specific criteria arguments. All valid filters can be found using
get_column_list
function. For example, one can specify the output columns(select_cols) or use other filters(conditions).
- Returns:
- tableA
Table
object.
- tableA
- query_object_async(objectname, *, radius=<Quantity 3. arcmin>, limit=5000, offset=0, **criteria)[source]¶
Given an object name, returns a list of matching rows.
- Parameters:
- objectnamestr
The name of the target around which to search.
- radiusstr or
Quantity
object, optional Default 3 arcmin. The string must be parsable by
Angle
. The appropriateQuantity
object fromunits
may also be used. Defaults to 3 arcminutes.- limitint
Optional and default is 5000. the maximum number of dataset IDs in the results.
- offsetint
Optional and default is 0. the number of records you wish to skip before selecting records.
- **criteria
Other mission-specific criteria arguments. All valid filters can be found using
get_column_list
function. For example, one can specify the output columns(select_cols) or use other filters(conditions).
- Returns:
- responselist of
Response
- responselist of
- query_region(*args, **kwargs)¶
Queries the service and returns a table object.
Given a sky position and radius, returns a list of matching dataset IDs.
- Parameters:
- coordinatesstr or
coordinates
object The target around which to search. It may be specified as a string or as the appropriate
coordinates
object.- radiusstr or
Quantity
object, optional Default 3 degrees. The string must be parsable by
Angle
. The appropriateQuantity
object fromunits
may also be used. Defaults to 3 arcminutes.- limitint
Optional and default is 5000. the maximum number of dataset IDs in the results.
- offsetint
Optional and default is 0 the number of records you wish to skip before selecting records.
- **criteria
Other mission-specific criteria arguments. All valid filters can be found using
get_column_list
function. For example, one can specify the output columns(select_cols) or use other filters(conditions).
- coordinatesstr or
- Returns:
- tableA
Table
object.
- tableA
- query_region_async(coordinates, *, radius=<Quantity 3. arcmin>, limit=5000, offset=0, **criteria)[source]¶
Given a sky position and radius, returns a list of matching dataset IDs.
- Parameters:
- coordinatesstr or
coordinates
object The target around which to search. It may be specified as a string or as the appropriate
coordinates
object.- radiusstr or
Quantity
object, optional Default 3 degrees. The string must be parsable by
Angle
. The appropriateQuantity
object fromunits
may also be used. Defaults to 3 arcminutes.- limitint
Optional and default is 5000. the maximum number of dataset IDs in the results.
- offsetint
Optional and default is 0 the number of records you wish to skip before selecting records.
- **criteria
Other mission-specific criteria arguments. All valid filters can be found using
get_column_list
function. For example, one can specify the output columns(select_cols) or use other filters(conditions).
- coordinatesstr or
- Returns:
- responselist of
Response
- responselist of
- reset_cache_location()¶
Resets the cache location to the default astropy cache
- resolve_object(objectname)¶
Resolves an object name to a position on the sky.
- Parameters:
- objectnamestr
Name of astronomical object to resolve.
- Returns:
- response
SkyCoord
The sky position of the given object.
- response
- session_info(verbose=True)¶
Displays information about current MAST user, and returns user info dictionary.
- Parameters:
- verbosebool, optional
Default True. Set to False to suppress output to stdout.
- Returns:
- responsedict