astro query:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- astroquery v0.4.11 »
- TAP/TAP+ (`astroquery.utils.tap`) »
- Tap

# Tap

class astroquery.utils.tap.Tap(*, url=None, host=None, server_context=None, tap_context=None, port=80, sslport=443, default_protocol_is_https=False, connhandler=None, upload_context=None, table_edit_context=None, data_context=None, datalink_context=None, verbose=False, use_names_over_ids=False)

  Bases: `object`

  TAP class Provides TAP capabilities

  Constructor

  Parameters:
    url str, mandatory if no host is specified, default None

      TAP URL

    host str, optional, default None

      host name

    server_context str, mandatory, default None

      server context

    tap_context str, mandatory, default None

      tap context

    upload_context str, optional, default None

      upload context

    table_edit_context str, mandatory, default None

      context for all actions to be performed over a existing table

    data_context str, optional, default None

      data context

    datalink_context str, optional, default None

      datalink context

    port int, optional, default ‘80’

      HTTP port

    sslport int, optional, default ‘443’

      HTTPS port

    default_protocol_is_https bool, optional, default False

      Specifies whether the default protocol to be used is HTTPS

    connhandler connection handler object, optional, default None

      HTTP(s) connection hander (creator). If no handler is provided, a new one is created.

    use_names_over_ids When `True` use the `name` attributes of columns as the

      names of columns in the `astropy.table.Table` instance. Since names are not guaranteed to be unique, this may cause some columns to be renamed by appending numbers to the end. Otherwise, (default), use the ID attributes as the column names.

    verbose bool, optional, default ‘False’

      flag to display information about the process

  Methods Summary

  `launch_job`(query, *[, name, output_file, ...]) | Launches a synchronous job
  `launch_job_async`(query, *[, name, ...]) | Launches an asynchronous job
  `list_async_jobs`(*[, verbose]) | Returns all the asynchronous jobs
  `load_async_job`(*[, jobid, name, verbose, ...]) | Loads an asynchronous job
  `load_table`(table, *[, verbose]) | Loads the table metadata, for the specified table.
  `load_tables`(*[, verbose]) | Loads all public table metadata.
  `save_results`(job, *[, verbose]) | Saves job results
  `search_async_jobs`(*[, jobfilter, verbose]) | Searches for jobs applying the specified filter

  Methods Documentation

  launch_job(query, *, name=None, output_file=None, output_format='votable', verbose=False, dump_to_file=False, upload_resource=None, upload_table_name=None, maxrec=None, format_with_results_compressed=('votable', 'fits', 'ecsv'))

    Launches a synchronous job

    Parameters:
      query str, mandatory

        query to be executed

      name str, optional, default None

        custom name defined by the user for the job that is going to be created

      output_file str, optional, default None

        file name where the results are saved if dumpToFile is True. If this parameter is not provided, the jobid is used instead

      output_format str, optional, default ‘votable’

        results format

      verbose bool, optional, default ‘False’

        flag to display information about the process

      dump_to_file bool, optional, default ‘False’

        if True, the results are saved in a file instead of using memory

      upload_resource str, bytes, os.PathLike object or astropy.table.table.Table object, optional, default None

        votable to be uploaded to UPLOAD_SCHEMA

      upload_table_name str, optional, default None

        resource temporary table name associated to the uploaded resource. This argument is required if upload_resource is provided.

      maxrec int, optional, default None

        maximum number of rows to return (TAP `MAXREC` parameter)

      format_with_results_compressed: tuple, zipped result formats

        list of result formats that are returned as zipped files

    Returns:
      A Job object
  launch_job_async(query, *, name=None, output_file=None, output_format='votable', verbose=False, dump_to_file=False, background=False, upload_resource=None, upload_table_name=None, autorun=True, maxrec=None, format_with_results_compressed=('votable', 'fits', 'ecsv'))

    Launches an asynchronous job

    Parameters:
      query str, mandatory

        query to be executed

      name str, optional, default None

        custom name defined by the user for the job that is going to be created

      output_file str, optional, default None

        file name where the results are saved if dumpToFile is True. If this parameter is not provided, the jobid is used instead

      output_format str, optional, default ‘votable’

        result formats

      verbose bool, optional, default ‘False’

        flag to display information about the process

      dump_to_file bool, optional, default ‘False’

        if True, the results are saved in a file instead of using memory

      background bool, optional, default ‘False’

        when the job is executed in asynchronous mode, this flag specifies whether the execution will wait until results are available

      upload_resource str, bytes, os.PathLike object or astropy.table.table.Table object, optional, default None

        votable to be uploaded to UPLOAD_SCHEMA

      upload_table_name str, optional, default None

        resource temporary table name associated to the uploaded resource. This argument is required if upload_resource is provided.

      autorun boolean, optional, default True

        if ‘True’, sets ‘phase’ parameter to ‘RUN’, so the framework can start the job.

      maxrec int, optional, default None

        maximum number of rows to return (TAP `MAXREC` parameter)

      format_with_results_compressed: tuple, zipped result formats

        list of result formats that are returned as zipped files

    Returns:
      A Job object
  list_async_jobs(*, verbose=False)

    Returns all the asynchronous jobs

    Parameters:
      verbose bool, optional, default ‘False’

        flag to display information about the process

    Returns:
      A list of Job objects
  load_async_job(*, jobid=None, name=None, verbose=False, load_results=True)

    Loads an asynchronous job

    Parameters:
      jobid str, mandatory if no name is provided, default None

        job identifier

      name str, mandatory if no jobid is provided, default None

        job name

      verbose bool, optional, default ‘False’

        flag to display information about the process

      load_results bool, optional, default ‘True’

        load results associated to this job

    Returns:
      A Job object
  load_table(table, *, verbose=False)

    Loads the table metadata, for the specified table. If the user is logged in, the table can refer to a table in the user’s private area.

    Parameters:
      table str, mandatory

        full qualified table name (i.e. schema name + table name)

      verbose bool, optional, default ‘False’

        flag to display information about the process

    Returns:
      A TapTableMeta object
  load_tables(*, verbose=False)

    Loads all public table metadata. If the user is logged in, it also returns metadata for those tables in the user’s private area.

    Parameters:
      verbose bool, optional, default ‘False’

        flag to display information about the process

    Returns:
      A list of TapTableMeta objects
  save_results(job, *, verbose=False)

    Saves job results

    Parameters:
      job Job, mandatory

        job

      verbose bool, optional, default ‘False’

        flag to display information about the process

  search_async_jobs(*, jobfilter=None, verbose=False)

    Searches for jobs applying the specified filter

    Parameters:
      jobfilter JobFilter, optional, default None

        job filter

      verbose bool, optional, default ‘False’

        flag to display information about the process

    Returns:
      A list of Job objects