cabaret.GaiaQuery.query#
- static GaiaQuery.query(center: tuple[float, float] | SkyCoord | None = None, radius: float | Angle | None = None, bounds: tuple[float, float, float, float] | None = None, filter_bands: Filters | str | Sequence[Filters | str] = Filters.G, limit: int = 100000, timeout: float | None = None, tap_source: GaiaTAPSource | GaiaSQLiteSource | str | None = None, allow_nulls: bool = False, filter_band: Filters | str | None = None) Table[source]#
Query a Gaia DR3 TAP service within a given radius around the center.
- Parameters:
center (tuple or astropy.coordinates.SkyCoord) – The sky coordinates of the center of the FOV. If a tuple is given, it should contain the RA and DEC in degrees.
radius (float or astropy.units.Quantity) – The radius of the FOV in degrees. If a Quantity is given, it must be convertible to degrees.
bounds (tuple or None) – Field-of-view bounds specified as
(ra_min, ra_max, dec_min, dec_max)in degrees. RA values are interpreted modulo 360 (degrees) and may be given so thatra_min <= ra_maxfor a contiguous RA interval, orra_min > ra_maxto indicate an interval that wraps across RA=0 (for example(350.0, 10.0, -5.0, 5.0)). Declination bounds must satisfy-90 <= dec_min <= dec_max <= 90.filter_bands (Filters, str, or sequence thereof, optional) – One or more filter bands to include as magnitude columns. Accepts a single
Filtersmember or its name as a string, or a list of either. Pass"all"to request every available band (Filters.all()). Default isFilters.G. When multiple bands are requested, theORDER BYis determined by the first band (brightest-first, ASC for all magnitude columns). If any 2MASS band is included the 2MASS cross-match join is added.limit (int, optional) – The maximum number of sources to retrieve from the Gaia archive. By default, it is set to 100000.
timeout (float, optional) – The maximum time to wait for the Gaia query to complete, in seconds. If None, there is no timeout. By default, it is set to None.
tap_source (GaiaTAPSource, GaiaSQLiteSource, str, or None, optional) – Query backend to use. Accepts a
GaiaTAPSourcefor an online TAP service, aGaiaSQLiteSourcefor an offline SQLite database, a TAP endpoint URL as a string, asqlite:///...URI, or a direct path to a SQLite database file ending in.db,.sqlite, or.sqlite3. If None, the default TAP backend is used.allow_nulls (bool, optional) – If False (default), only rows where all requested band columns are non-NULL are returned (
IS NOT NULLfilter per band). Set to True to allow rows with missing magnitude values through.filter_band (Filters or str, optional) – Deprecated. Use
filter_bandsinstead.
- Returns:
The raw Astropy Table returned by the TAP service, with columns normalised to
ra,dec,pmra,pmdec, and one magnitude column per requested band named afterfilter_band.value(e.g.phot_g_mean_mag,h_m).- Return type:
Examples
>>> from cabaret.queries import GaiaQuery >>> from astropy.coordinates import SkyCoord >>> center = SkyCoord(ra=10.68458, dec=41.26917, unit='deg') >>> table = GaiaQuery.query(center, radius=0.1, limit=10, timeout=30)