GaiaQuery#
- class cabaret.GaiaQuery[source]#
Class to query Gaia DR3 data and retrieve sources.
The class provides methods to query a configurable TAP service and return either the raw Astropy Table, a flux-normalised multi-band Table, or a Sources instance with RA-DEC coordinates and fluxes.
The query backend is selected via
GaiaQuery.DEFAULT_TAP_SOURCE(class level) or the per-calltap_sourceargument. Accepts aGaiaTAPSourcefor an online TAP service, aGaiaSQLiteSourcefor an offline SQLite database, a TAP endpoint URL, asqlite:///...URI, or a direct path to a.db/.sqlite/.sqlite3file. The default isGaiaTAPSource.VIZIER(CDS VizieR), which hosts a copy of Gaia DR3.Examples
>>> from cabaret.queries import GaiaQuery >>> from astropy.coordinates import SkyCoord >>> center = SkyCoord(ra=10.68458, dec=41.269, unit="deg")
The Astropy Table from Gaia can be obtained with:
>>> table = GaiaQuery.query(center, radius=0.05, limit=10, timeout=30)
Whereas a Sources instance carrying coordinates and fluxes can be queried for with:
>>> sources = GaiaQuery.get_sources(center, radius=0.05, limit=10, timeout=30)
Methods
__init__()get_flux_table([center, radius, bounds, ...])Query and return a Table with all columns expressed as physical fluxes.
get_sources([center, radius, bounds, ...])Query a Gaia DR3 TAP service to retrieve the RA-DEC coordinates of stars within a given radius of a center position, along with their fluxes.
query([center, radius, bounds, ...])Query a Gaia DR3 TAP service within a given radius around the center.
Attributes
DEFAULT_TAP_SOURCEDefault TAP service used when
tap_source=Noneis passed to query methods.