GaiaClass

class astroquery.gaia.GaiaClass(tap_plus_handler=None)[source]

Bases: object

Proxy class to default TapPlus object (pointing to Gaia Archive)

Attributes Summary

MAIN_GAIA_TABLE

MAIN_GAIA_TABLE_DEC

MAIN_GAIA_TABLE_RA

Methods Summary

cone_search(coordinate[, radius, …])

Cone search sorted by distance (sync.) TAP & TAP+

cone_search_async(coordinate[, radius, …])

Cone search sorted by distance (async) TAP & TAP+

launch_job(query[, name, output_file, …])

Launches a synchronous job TAP & TAP+

launch_job_async(query[, name, output_file, …])

Launches an asynchronous job TAP & TAP+

list_async_jobs([verbose])

Returns all the asynchronous jobs TAP & TAP+

load_async_job([jobid, name, verbose])

Loads an asynchronous job TAP & TAP+

load_table(table[, verbose])

Loads the specified table TAP+ only

load_tables([only_names, …])

Loads all public tables TAP & TAP+

login([user, password, credentials_file, …])

Performs a login.

login_gui([verbose])

Performs a login using a GUI dialog TAP+ only

logout([verbose])

Performs a logout TAP+ only

query_object(coordinate[, radius, width, …])

Launches a job TAP & TAP+

query_object_async(coordinate[, radius, …])

Launches a job (async) TAP & TAP+

remove_jobs(jobs_list[, verbose])

Removes the specified jobs TAP+

save_results(job[, verbose])

Saves job results TAP & TAP+

search_async_jobs([jobfilter, verbose])

Searches for jobs applying the specified filter TAP+ only

Attributes Documentation

MAIN_GAIA_TABLE = 'gaiadr2.gaia_source'
MAIN_GAIA_TABLE_DEC = 'dec'
MAIN_GAIA_TABLE_RA = 'ra'

Methods Documentation

Cone search sorted by distance (sync.) TAP & TAP+

Parameters
coordinateastropy.coordinate, mandatory

coordinates center point

radiusastropy.units, mandatory

radius

output_filestr, 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_formatstr, optional, default ‘votable’

results format

verbosebool, optional, default ‘False’

flag to display information about the process

dump_to_filebool, optional, default ‘False’

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

Returns
A Job object
cone_search_async(coordinate, radius=None, background=False, output_file=None, output_format='votable', verbose=False, dump_to_file=False)[source]

Cone search sorted by distance (async) TAP & TAP+

Parameters
coordinateastropy.coordinate, mandatory

coordinates center point

radiusastropy.units, mandatory

radius

backgroundbool, optional, default ‘False’

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

output_filestr, 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_formatstr, optional, default ‘votable’

results format

verbosebool, optional, default ‘False’

flag to display information about the process

dump_to_filebool, optional, default ‘False’

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

Returns
A Job object
launch_job(query, name=None, output_file=None, output_format='votable', verbose=False, dump_to_file=False, upload_resource=None, upload_table_name=None)[source]

Launches a synchronous job TAP & TAP+

Parameters
querystr, mandatory

query to be executed

output_filestr, 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_formatstr, optional, default ‘votable’

results format

verbosebool, optional, default ‘False’

flag to display information about the process

dump_to_filebool, optional, default ‘False’

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

upload_resource: str, optional, default None

resource to be uploaded to UPLOAD_SCHEMA

upload_table_name: str, required if uploadResource is provided, default None

resource temporary table name associated to the uploaded resource

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)[source]

Launches an asynchronous job TAP & TAP+

Parameters
querystr, mandatory

query to be executed

output_filestr, 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_formatstr, optional, default ‘votable’

results format

verbosebool, optional, default ‘False’

flag to display information about the process

dump_to_filebool, optional, default ‘False’

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

backgroundbool, 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, optional, default None

resource to be uploaded to UPLOAD_SCHEMA

upload_table_name: str, required if uploadResource is provided, default None

resource temporary table name associated to the uploaded resource

Returns
A Job object
list_async_jobs(verbose=False)[source]

Returns all the asynchronous jobs TAP & TAP+

Parameters
verbosebool, 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)[source]

Loads an asynchronous job TAP & TAP+

Parameters
jobidstr, mandatory if no name is provided, default None

job identifier

namestr, mandatory if no jobid is provided, default None

job name

verbosebool, optional, default ‘False’

flag to display information about the process

Returns
A Job object
load_table(table, verbose=False)[source]

Loads the specified table TAP+ only

Parameters
tablestr, mandatory

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

verbosebool, optional, default ‘False’

flag to display information about the process

Returns
A table object
load_tables(only_names=False, include_shared_tables=False, verbose=False)[source]

Loads all public tables TAP & TAP+

Parameters
only_namesbool, TAP+ only, optional, default ‘False’

True to load table names only

include_shared_tablesbool, TAP+, optional, default ‘False’

True to include shared tables

verbosebool, optional, default ‘False’

flag to display information about the process

Returns
A list of table objects
login(user=None, password=None, credentials_file=None, verbose=False)[source]

Performs a login. TAP+ only User and password can be used or a file that contains user name and password (2 lines: one for user name and the following one for the password)

Parameters
userstr, mandatory if ‘file’ is not provided, default None

login name

passwordstr, mandatory if ‘file’ is not provided, default None

user password

credentials_filestr, mandatory if no ‘user’ & ‘password’ are provided

file containing user and password in two lines

verbosebool, optional, default ‘False’

flag to display information about the process

login_gui(verbose=False)[source]

Performs a login using a GUI dialog TAP+ only

Parameters
verbosebool, optional, default ‘False’

flag to display information about the process

logout(verbose=False)[source]

Performs a logout TAP+ only

Parameters
verbosebool, optional, default ‘False’

flag to display information about the process

query_object(coordinate, radius=None, width=None, height=None, verbose=False)[source]

Launches a job TAP & TAP+

Parameters
coordinateastropy.coordinates, mandatory

coordinates center point

radiusastropy.units, required if no ‘width’ nor ‘height’ are provided

radius (deg)

widthastropy.units, required if no ‘radius’ is provided

box width

heightastropy.units, required if no ‘radius’ is provided

box height

verbosebool, optional, default ‘False’

flag to display information about the process

Returns
The job results (astropy.table).
query_object_async(coordinate, radius=None, width=None, height=None, verbose=False)[source]

Launches a job (async) TAP & TAP+

Parameters
coordinateastropy.coordinates, mandatory

coordinates center point

radiusastropy.units, required if no ‘width’ nor ‘height’ are provided

radius

widthastropy.units, required if no ‘radius’ is provided

box width

heightastropy.units, required if no ‘radius’ is provided

box height

async_jobbool, optional, default ‘False’

executes the query (job) in asynchronous/synchronous mode (default synchronous)

verbosebool, optional, default ‘False’

flag to display information about the process

Returns
The job results (astropy.table).
remove_jobs(jobs_list, verbose=False)[source]

Removes the specified jobs TAP+

Parameters
jobs_liststr, mandatory

jobs identifiers to be removed

verbosebool, optional, default ‘False’

flag to display information about the process

save_results(job, verbose=False)[source]

Saves job results TAP & TAP+

Parameters
jobJob, mandatory

job

verbosebool, optional, default ‘False’

flag to display information about the process

search_async_jobs(jobfilter=None, verbose=False)[source]

Searches for jobs applying the specified filter TAP+ only

Parameters
jobfilterJobFilter, optional, default None

job filter

verbosebool, optional, default ‘False’

flag to display information about the process

Returns
A list of Job objects