cabaret.GaiaQuery.get_sources

cabaret.GaiaQuery.get_sources#

static GaiaQuery.get_sources(center: tuple[float, float] | SkyCoord | None = None, radius: float | Angle | None = None, bounds: tuple[float, float, float, float] | None = None, filter_band: Filters | str = Filters.G, dateobs: datetime | None = None, limit: int = 100000, timeout: float | None = None, tap_source: GaiaTAPSource | GaiaSQLiteSource | str | None = None) Sources[source]#

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.

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 or None) – 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 that ra_min <= ra_max for a contiguous RA interval, or ra_min > ra_max to 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_band (Filters or str, optional) – The filter to use for the flux column. Default is Filters.G.

  • dateobs (datetime.datetime, optional) – The date of the observation. If given, the proper motions of the sources will be taken into account. By default, it is set to None.

  • limit (int, optional) – The maximum number of sources to retrieve from the Gaia archive. By default, it is set to 10000.

  • 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 GaiaTAPSource for an online TAP service, a GaiaSQLiteSource for an offline SQLite database, a TAP endpoint URL as a string, a sqlite:///... URI, or a direct path to a SQLite database file ending in .db, .sqlite, or .sqlite3. If None, the default TAP backend is used.

Returns:

A Sources instance containing the coordinates and fluxes of the retrieved sources.

Return type:

Sources

Notes

Fluxes are always returned in photons/s/m² via _mag_to_photons().

Raises:

ImportError – If the astroquery package is not installed.

Examples

>>> from cabaret.queries import GaiaQuery
>>> from astropy.coordinates import SkyCoord
>>> center = SkyCoord(ra=10.68458, dec=41.26917, unit='deg')
>>> sources = GaiaQuery.get_sources(
...     center, radius=0.1, timeout=30, limit=10
... )