GaiaClass

class astroquery.gaia.GaiaClass(tap_plus_conn_handler=None, datalink_handler=None)[source]

Bases: astroquery.utils.tap.TapPlus

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

Constructor

Parameters

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

TAP URL

host : str, optional, default None

host name

server_context : str, optional, default None

server context

tap_context : str, optional, default None

tap context

upload_context : str, optional, default None

upload context

table_edit_context : str, optional, 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.

verbose : bool, 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

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+

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

load_data(ids[, retrieval_type, valid_data, …])

Loads the specified table TAP+ only

load_user(user_id[, verbose])

Loads the specified user TAP+ only

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 = 'gaiadr2.gaia_source'
MAIN_GAIA_TABLE_DEC = 'dec'
MAIN_GAIA_TABLE_RA = 'ra'
ROW_LIMIT = 50

Methods Documentation

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

Parameters

coordinate : astropy.coordinate, mandatory

coordinates center point

radius : astropy.units, mandatory

radius

table_name : str, optional, default main gaia table

table name doing the cone search against

ra_column_name : str, optional, default ra column in main gaia table

ra column doing the cone search against

dec_column_name : str, optional, default dec column in main gaia table

dec column doing the cone search against

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

columns: list, optional, default []

if empty, all columns will be selected

Returns

A Job object

cone_search_async(coordinate, radius=None, table_name='gaiadr2.gaia_source', 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

coordinate : astropy.coordinate, mandatory

coordinates center point

radius : astropy.units, mandatory

radius

table_name : str, optional, default main gaia table

table name doing the cone search against

ra_column_name : str, optional, default ra column in main gaia table

ra column doing the cone search against

dec_column_name : str, optional, default dec column in main gaia table

dec column doing the cone search against

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

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

Returns

A Job object

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_a : str, mandatory

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

full_qualified_table_name_b : str, mandatory

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

results_table_name : str, mandatory

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

radius : float (arc. seconds), optional, default 1.0

radius (valid range: 0.1-10.0)

verbose : bool, 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

ids : str list, mandatory

list of identifiers

verbose : bool, optional, default ‘False’

flag to display information about the process

Returns

A table object

load_data(ids, retrieval_type='epoch_photometry', valid_data=True, band=None, format='VOTABLE', output_file=None, verbose=False)[source]

Loads the specified table TAP+ only

Parameters

ids : str list, mandatory

list of identifiers

retrieval_type : str, optional, default ‘epoch_photometry’

retrieval type identifier

valid_data : bool, 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)

band : str, 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.

format : str, optional, default ‘votable’

loading format

output_file : string, optional, default None

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

verbose : bool, 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_id : str, mandatory

user id to load

verbose : bool, optional, default ‘False’

flag to display information about the process

Returns

A user

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

Launches a job TAP & TAP+

Parameters

coordinate : astropy.coordinates, mandatory

coordinates center point

radius : astropy.units, required if no ‘width’/’height’ are provided

radius (deg)

width : astropy.units, required if no ‘radius’ is provided

box width

height : astropy.units, required if no ‘radius’ is provided

box height

verbose : bool, 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

coordinate : astropy.coordinates, mandatory

coordinates center point

radius : astropy.units, required if no ‘width’/’height’ are provided

radius

width : astropy.units, required if no ‘radius’ is provided

box width

height : astropy.units, required if no ‘radius’ is provided

box height

async_job : bool, optional, default ‘False’

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

verbose : bool, optional, default ‘False’

flag to display information about the process

Returns

The job results (astropy.table).