astro query:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- astroquery v0.4.11 »
- MAST Queries (`astroquery.mast`) »
- MastClass

# MastClass

class astroquery.mast.MastClass(mast_token=None)

  Bases: `MastQueryWithLogin`

  MAST query class.

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

  Attributes Summary

  `cache_location` |

  Methods Summary

  `__call__`(*args, **kwargs) | init a fresh copy of self
  `authenticated`() |
  `clear_cache`() | Removes all cache files.
  `disable_cloud_dataset`() |
  `enable_cloud_dataset`([provider, profile, ...]) |
  `login`([token, store_token, reenter_token]) | Log into the MAST portal.
  `logout`() | Log out of current MAST session.
  `mast_query`(service[, columns]) | Given a Mashup service and parameters as keyword arguments, builds and excecutes a Mashup query.
  `reset_cache_location`() | Resets the cache location to the default astropy cache
  `resolve_object`(objectname, *[, resolver, ...]) | 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 executes a Mashup query.
  `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:
      provider str

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

      profile str

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

      verbose bool

        Default True. Logger to display extra info and warning.

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

    Log into the MAST portal.

    Parameters:
      token string, 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_token bool, optional

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

      reenter_token bool, 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.

  mast_query(service, columns=None, **kwargs)

    Given a Mashup service and parameters as keyword arguments, builds and excecutes a Mashup query.

    Parameters:
      service str

        The Mashup service to query.

      columns str, optional

        Specifies the columns to be returned as a comma-separated list, e.g. “ID, ra, dec”.

      **kwargs

        Service-specific parameters and MashupRequest properties. See the service documentation and the MashupRequest Class Reference for valid keyword arguments.

    Returns:
      response `Table`
  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:
      objectname str

        Name of astronomical object to resolve.

      resolver str, 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_all` is True, this parameter will be ignored. Default is None.

      resolve_all bool, 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:
      response `SkyCoord`, dict

        If `resolve_all` is False, returns a `SkyCoord` object with the resolved coordinates. If `resolve_all` is True, returns a dictionary where the keys are the resolver names and the values are `SkyCoord` objects with the resolved coordinates.

  service_request(*args, **kwargs)

    Queries the service and returns a table object.

    Given a Mashup service and parameters, builds and executes 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)

    Given a Mashup service and parameters, builds and executes 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 `Response`
  session_info(verbose=True)

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

    Parameters:
      verbose bool, optional

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

    Returns:
      response dict