Developer’s corner

Documentation for find_gaia_dr2.py

Requirements: in order to be able to use find_gaia_dr2, you must first download and retrieve python-cdsclient, as instructed on this page.

All options can be retrieved typing find_gaia_dr2.py -h

The sections below give some examples for the most common usages.

Query by spatial constraints

Query by cone (around a position)

You can query around an ICRS position written in sexagesimal:

./find_gaia_dr2.py -r 100 "05 35 17.299 -05 23 28.00"

The -r option sets the search radius in arcsec

Position can also be given in decimal degrees:

./find_gaia_dr2.py -r 1000 56.75 +24.1167"

By default, only the first 100 matching rows are returned. This can be changed with the -m option:

./find_gaia_dr2.py -m 1500 -r 1000 56.75 +24.1167"

Query around an object name

You can also provide with an object name, that will be converted to a position by the Sesame service. The following query will output Gaia DR2 sources around Messier 13:

./find_gaia_dr2.py -r 240 Messier 13

Query by HEALPix pixel

If you want to retrieve data for a given HEALPix pixel (in ICRS coordinates frame, in the NESTED scheme), use the --ipix=<NORDER:NPIX> option.

./find_gaia_dr2.py --ipix 9:12345

will retrieve the data for the pixel #12345 at NORDER 9.

Query by source ID

./find_gaia_dr2.py --source_id=3403771275824689024

will retrieve the data for the source Gaia DR2 3403771275824689024

By default, only the VizieR default columns are displayed. The -a flag allows one to retrieve all columns:

./find_gaia_dr2.py -a --source_id=3403771275824689024

Set a constraint on some columns

You can put some constraints on all the indexed columns, using the following options:

--source_id=…
--random_index=…
--parallax=…
--parallax_error=…
--parallax_over_error=…
--pmra=…
--pmdec=…
--phot_g_mean_mag=…
--phot_bp_mean_mag=…
--–phot_rp_mean_mag=…
--–bp_rp=…
--–bp_g=…
--g_rp=…
--radial_velocity=…
--radial_velocity_error=…
--l=…
--b=…

For instance, to retrieve sources with a parallax greater than 2mas:

./find_gaia_dr2.py --parallax=">2"

Default format is ascii, this can be changed to tsv or votable using the --format flag:

./find_gaia_dr2.py --format tsv --parallax=">2"

Retrieve unformatted data

By default, floating numbers data are formatted according to the format defined in VizieR ReadMe.
If you wish to retrieve unformatted data, with full decimal precision, you can use the --no-format option

This option is only available when querying by position or by HEALPix pixel. Example:

./find_gaia_dr2.py --ipix 9:12345 --no-format
cdsclient/doc-find_gaia_dr2.txt · Last modified: 2018/04/25 11:25 by Thomas Boch

Thanks for acknowledging the CDS developer’s resources (libraries, source code, etc.)

© Université de Strasbourg/CNRS

    • Contact