GaiaClass

class astroquery.gaia.GaiaClass(tap_plus_conn_handler=None, datalink_handler=None, gaia_tap_server='https://gea.esac.esa.int/', gaia_data_server='https://gea.esac.esa.int/', tap_server_context='tap-server', data_server_context='data-server', verbose=False)[source]

Bases: astroquery.utils.tap.core.TapPlus

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

Constructor

Parameters
urlstr, mandatory if no host is specified, default None

TAP URL

hoststr, optional, default None

host name

server_contextstr, optional, default None

server context

tap_contextstr, optional, default None

tap context

upload_contextstr, optional, default None

upload context

table_edit_contextstr, optional, default None

context for all actions to be performed over a existing table

data_contextstr, optional, default None

data context

datalink_contextstr, optional, default None

datalink context

portint, optional, default ‘80’

HTTP port

sslportint, optional, default ‘443’

HTTPS port

default_protocol_is_httpsbool, optional, default False

Specifies whether the default protocol to be used is HTTPS

connhandlerconnection handler object, optional, default None

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

verbosebool, optional, default ‘True’

flag to display information about the process

Attributes Summary

MAIN_GAIA_TABLE

MAIN_GAIA_TABLE_DEC

MAIN_GAIA_TABLE_RA

ROW_LIMIT

VALID_DATALINK_RETRIEVAL_TYPES

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+

correct_table_units(table)

cross_match([full_qualified_table_name_a, ...])

Performs a cross-match between the specified tables The result is a join table (stored in the user storage area) with the identifies of both tables and the distance.

get_datalinks(ids[, verbose])

Gets datalinks associated to the provided identifiers TAP+ only

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

Launches a synchronous job

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

Launches an asynchronous job

load_data(ids[, data_release, ...])

Loads the specified table TAP+ only

load_user(user_id[, verbose])

Loads the specified user TAP+ only

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

Performs a login.

login_gui([verbose])

Performs a login using a GUI dialog

logout([verbose])

Performs a logout

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

Launches a job TAP & TAP+

query_object_async(coordinate[, radius, ...])

Launches a job (async) TAP & TAP+

Attributes Documentation

MAIN_GAIA_TABLE = None
MAIN_GAIA_TABLE_DEC = 'dec'
MAIN_GAIA_TABLE_RA = 'ra'
ROW_LIMIT = 50

Methods Documentation

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

Parameters
coordinateastropy.coordinate, mandatory

coordinates center point

radiusastropy.units, mandatory

radius

table_namestr, optional, default main gaia table name doing the cone search against
ra_column_namestr, optional, default ra column in main gaia table

ra column doing the cone search against

dec_column_namestr, optional, default dec column in main gaia table

dec column doing the cone search against

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

columns: list, optional, default []

if empty, all columns will be selected

Returns
A Job object
cone_search_async(coordinate, radius=None, table_name=None, ra_column_name='ra', dec_column_name='dec', background=False, output_file=None, output_format='votable', verbose=False, dump_to_file=False, columns=[])[source]

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

Parameters
coordinateastropy.coordinate, mandatory

coordinates center point

radiusastropy.units, mandatory

radius

table_namestr, optional, default main gaia table name doing the cone search against
ra_column_namestr, optional, default ra column in main gaia table

ra column doing the cone search against

dec_column_namestr, optional, default dec column in main gaia table

dec column doing the cone search against

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
static correct_table_units(table)[source]
cross_match(full_qualified_table_name_a=None, full_qualified_table_name_b=None, results_table_name=None, radius=1.0, background=False, verbose=False)[source]

Performs a cross-match between the specified tables The result is a join table (stored in the user storage area) with the identifies of both tables and the distance. TAP+ only

Parameters
full_qualified_table_name_astr, mandatory

a full qualified table name (i.e. schema name and table name)

full_qualified_table_name_bstr, mandatory

a full qualified table name (i.e. schema name and table name)

results_table_namestr, mandatory

a table name without schema. The schema is set to the user one

radiusfloat (arc. seconds), optional, default 1.0

radius (valid range: 0.1-10.0)

verbosebool, optional, default ‘False’

flag to display information about the process

Returns
Boolean indicating if the specified user is valid

Gets datalinks associated to the provided identifiers TAP+ only

Parameters
idsstr list, mandatory

list of identifiers

verbosebool, optional, default ‘False’

flag to display information about the process

Returns
A table 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

Parameters
querystr, mandatory

query to be executed

namestr, optional, default None

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

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. Available formats are: ‘votable’, ‘votable_plain’,

‘fits’, ‘csv’, ‘ecsv’ and ‘json’, default is ‘votable’. Returned results for ‘votable’ and ‘fits’ formats are compressed gzip files.

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

resource to be uploaded to UPLOAD_SCHEMA

upload_table_namestr, optional, default None

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

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

Launches an asynchronous job

Parameters
querystr, mandatory

query to be executed

namestr, optional, default None

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

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. Available formats are: ‘votable’, ‘votable_plain’,

‘fits’, ‘csv’ and ‘json’, default is ‘votable’. Returned results for ‘votable’ ‘ecsv’ and ‘fits’ format are compressed gzip files.

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

resource to be uploaded to UPLOAD_SCHEMA

upload_table_namestr, optional, default None

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

autorunboolean, optional, default True

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

Returns
A Job object
load_data(ids, data_release=None, data_structure='INDIVIDUAL', retrieval_type='ALL', valid_data=True, band=None, avoid_datatype_check=False, format='votable', output_file=None, overwrite_output_file=False, verbose=False)[source]

Loads the specified table TAP+ only

Parameters
idsstr list, mandatory

list of identifiers

data_release: str, optional, default None

data release from which data should be taken. E.g. ‘Gaia DR2’ By default, it takes the current default one.

data_structure: str, optional, default ‘INDIVIDUAL’

it can be ‘INDIVIDUAL’, ‘COMBINED’, ‘RAW’: ‘INDIVIDUAL’ means products are provided in separate files for each sourceId. All files are zipped in a single bundle, even if only one source/file is considered ‘COMBINED’ means products are provided in a single file concatenating the data of all sourceIds together. How this is organised depends on the chosen format ‘RAW’ means products are provided following a Data Model similar to that used in the MDB, meaning in particular that parameters stored as arrays will remain as such. Like in the COMBINED structure, a single file is provided for the data of all sourceIds together, but in this case there will be always be one row per sourceId

retrieval_typestr, optional, default ‘ALL’ to retrieve all data from the list of sources

retrieval type identifier. For GAIA DR2 possible values are [‘EPOCH_PHOTOMETRY’] For future GAIA DR3 (Once published), possible values will be [‘EPOC_PHOTOMETRY’, ‘RVS’, ‘XP_CONTINUOUS’, ‘XP_SAMPLED’, ‘MCMC_GSPPHOT’ or ‘MCMC_MSC’]

valid_databool, optional, default True

By default, the epoch photometry service returns only valid data, that is, all data rows where flux is not null and rejected_by_photometry flag is not true. In order to retrieve all data associated to a given source without this filter, this request parameter should be included (valid_data=False)

bandstr, optional, default None, valid values: G, BP, RP

By default, the epoch photometry service returns all the available photometry bands for the requested source. This parameter allows to filter the output lightcurve by its band.

avoid_datatype_check: boolean, optional, default False.

By default, this value will be set to False. If it is set to ‘true’ the Datalink items tags will not be checked.

formatstr, optional, default ‘votable’

loading format. Other available formats are ‘csv’, ‘ecsv’,’json’,’votable_plain’ and ‘fits’

output_filestring, optional, default None

file where the results are saved. If it is not provided, the http response contents are returned.

overwrite_output_fileboolean, optional, default False

To overwrite the output_file if it already exists.

verbosebool, optional, default ‘False’

flag to display information about the process

Returns
A table object
load_user(user_id, verbose=False)[source]

Loads the specified user TAP+ only

Parameters
user_idstr, mandatory

user id to load

verbosebool, optional, default ‘False’

flag to display information about the process

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

Performs a login. User and password arguments can be used or a file that contains username and password (2 lines: one for username and the following one for the password). If no arguments are provided, a prompt asking for username and password will appear.

Parameters
userstr, default None

login name

passwordstr, default None

user password

credentials_filestr, default None

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

Parameters
verbosebool, optional, default ‘False’

flag to display information about the process

logout(verbose=False)[source]

Performs a logout

Parameters
verbosebool, optional, default ‘False’

flag to display information about the process

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

Launches a job TAP & TAP+

Parameters
coordinateastropy.coordinates, mandatory

coordinates center point

radiusastropy.units if no ‘width’/’height’ are provided

radius (deg)

widthastropy.units if no ‘radius’ is provided

box width

heightastropy.units if no ‘radius’ is provided

box height

verbosebool, optional, default ‘False’

flag to display information about the process

columns: list, optional, default []

if empty, all columns will be selected

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

Launches a job (async) TAP & TAP+

Parameters
coordinateastropy.coordinates, mandatory

coordinates center point

radiusastropy.units if no ‘width’/’height’ are provided

radius

widthastropy.units if no ‘radius’ is provided

box width

heightastropy.units if no ‘radius’ is provided

box height

verbosebool, optional, default ‘False’

flag to display information about the process

columns: list, optional, default []

if empty, all columns will be selected

Returns
The job results (astropy.table).