HapcutClass¶
- class astroquery.mast.HapcutClass[source]¶
Bases:
MastQueryWithLoginMAST Hubble Advanced Product (HAP) cutout query class.
Class for accessing HAP image cutouts.
Attributes Summary
Methods Summary
__call__(*args, **kwargs)init a fresh copy of self
Removes all cache files.
download_cutouts(coordinates, *[, size, ...])Download cutout images around the given coordinates with indicated size.
enable_cloud_dataset([provider, profile, ...])get_cutouts(coordinates, *[, size])Get cutout image(s) around the given coordinates with indicated size, and return them as a list of
HDUListobjects.login([token, store_token, reenter_token])Log into the MAST portal.
logout()Log out of current MAST session.
Resets the cache location to the default astropy cache
resolve_object(objectname, *[, resolver, ...])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.
- download_cutouts(coordinates, *, size=5, path='.', inflate=True, verbose=False)[source]¶
Download cutout images around the given coordinates with indicated size.
- Parameters:
- coordinatesstr or
astropy.coordinatesobject The target around which to search. It may be specified as a string or as the appropriate
astropy.coordinatesobject.- sizeint, array-like,
Quantity Optional, default 5 pixels. The size of the cutout array. If
sizeis a scalar number or a scalarQuantity, then a square cutout ofsizewill be created. Ifsizehas two elements, they should be in(ny, nx)order. Scalar numbers insizeare assumed to be in units of pixels.Quantityobjects must be in pixel or angular units.- pathstr
Optional. The directory in which the cutouts will be saved. Defaults to current directory.
- inflatebool
Optional, default True. Cutout target pixel files are returned from the server in a zip file, by default they will be inflated and the zip will be removed. Set inflate to false to stop before the inflate step.
- coordinatesstr or
- Returns:
- response
Table
- response
- 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_cutouts(coordinates, *, size=5)[source]¶
Get cutout image(s) around the given coordinates with indicated size, and return them as a list of
HDUListobjects.- Parameters:
- coordinatesstr or
astropy.coordinatesobject The target around which to search. It may be specified as a string or as the appropriate
astropy.coordinatesobject.- sizeint, array-like,
Quantity Optional, default 5 pixels. The size of the cutout array. If
sizeis a scalar number or a scalarQuantity, then a square cutout ofsizewill be created. Ifsizehas two elements, they should be in(ny, nx)order. Scalar numbers insizeare assumed to be in units of pixels.Quantityobjects must be in pixel or angular units.
- coordinatesstr or
- Returns:
- responseA list of
HDUListobjects.
- responseA list of
- 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.
- reset_cache_location()¶
Resets the cache location to the default astropy cache
- resolve_object(objectname, *, resolver=None, resolve_all=False)¶
Resolves an object name to a position on the sky.
- Parameters:
- objectnamestr
Name of astronomical object to resolve.
- resolverstr, optional
The resolver to use when resolving a named target into coordinates. Valid options are “SIMBAD” and “NED”. If not specified, the default resolver order will be used. Please see the STScI Archive Name Translation Application (SANTA) for more information. If
resolve_allis True, this parameter will be ignored. Default is None.- resolve_allbool, optional
If True, will try to resolve the object name using all available resolvers (“NED”, “SIMBAD”). Function will return a dictionary where the keys are the resolver names and the values are the resolved coordinates. Default is False.
- Returns:
- 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