科研 Skill
天文星表检索
astro-catalog-queries
Queries astronomical archives (Gaia, SDSS, VizieR, MAST, NED, SIMBAD) via astroquery/TAP/ADQL and cross-matches results. Use when sourcing or combining survey data by position.
SKILL.md
Astronomical Catalog Queries
Purpose
Covers how to query major astronomical archives and catalogs
programmatically, build cone-search and ADQL queries, handle paging
and row limits, and cross-match results across surveys by sky
position. The astropy-astronomy skill touches a single Gaia/SIMBAD
example inline; this skill is the dedicated reference for querying
multiple archives, handling their different APIs and quirks, and
combining results into a clean working catalog.
Use when a task requires fetching real astronomical data rather than simulating it: building a target list, checking what surveys cover a field, cross-identifying an object across catalogs, or downloading a cutout image or spectrum for further analysis.
When to Use
- Need photometry, astrometry, or spectroscopic parameters for known objects from Gaia, SDSS, 2MASS, WISE, or similar surveys.
- Need to cross-match a local source list against a reference catalog by sky position.
- Need to run a custom ADQL query against a TAP service (Gaia archive, SDSS CasJobs-style services) for a cut on magnitude, color, proper motion, or parallax.
- Need to resolve an object name to coordinates (SIMBAD/NED) or fetch a cutout image/spectrum for a known target.
Prerequisites
astroquery,astropyinstalled (pip install astroquery astropy); specific submodules query NASA/ESA/university-hosted services over the network, so a working internet connection is required at run time — these are not bundled offline databases.- Network access to the relevant archive's TAP/VO service; some services (e.g., Gaia archive large queries) may require registering for anonymous vs. authenticated query limits, covered below.
Workflow
1. Choose the right query interface
- Cone search (small area, known center):
astroquery.vizier.Vizier,astroquery.sdss.SDSS,astroquery.gaia.Gaia.query_object_async— simplest interface, good for "give me everything within N arcmin of this position." - ADQL/TAP (complex cuts, large catalogs):
astroquery.gaia.Gaia.launch_job_async(adql_query)orastroquery.utils.tap.TapPlusfor a generic TAP service — needed for magnitude/color/parallax cuts, joins, or row counts beyond a simple cone search's row limit. - Name resolution:
astroquery.simbad.Simbad.query_object(name)for basic identification, orastroquery.ipac.ned.Ned.query_objectfor extragalactic objects, to get coordinates from a name (e.g., "M51", "NGC 5457") or vice versa. - Image/spectrum cutouts:
astroquery.skyview.SkyView.get_imagesfor multi-survey image cutouts;astroquery.sdss.SDSS.get_spectrafor SDSS spectra by position or plate/MJD/fiber ID;astroquery.mast.Observationsfor HST/JWST/TESS/Kepler data products.
2. Build a cone search
from astroquery.vizier import Vizier
from astropy.coordinates import SkyCoord
import astropy.units as u
coord = SkyCoord.from_name("M51") # name resolution via SIMBAD/Sesame
Vizier.ROW_LIMIT = -1 # remove the default 50-row cap
result = Vizier.query_region(coord, radius=5 * u.arcmin,
catalog="I/350/gaiaedr3") # Gaia EDR3
table = result[0]
Always set an explicit ROW_LIMIT — the default silently truncates
results to 50 rows, a common source of "my catalog looks incomplete"
bugs.
3. Build an ADQL query for cuts beyond a cone search
from astroquery.gaia import Gaia
query = """
SELECT source_id, ra, dec, phot_g_mean_mag, parallax, pmra, pmdec
FROM gaiadr3.gaia_source
WHERE 1 = CONTAINS(
POINT('ICRS', ra, dec),
CIRCLE('ICRS', 202.47, 47.20, 0.0833)) -- 5 arcmin around M51
AND phot_g_mean_mag < 18
AND parallax > 0.2
"""
job = Gaia.launch_job_async(query)
results = job.get_results()
Use launch_job_async (not the synchronous launch_job) for queries
that may take more than a few seconds — the archive queues long jobs
and the async call polls for completion automatically.
4. Cross-match across catalogs
- For catalogs already loaded as
astropy.table.Tablewith RA/Dec columns, cross-match withastropy.coordinates.match_to_catalog_sky:
from astropy.coordinates import SkyCoord
import astropy.units as u
cat_a = SkyCoord(ra=table_a["ra"], dec=table_a["dec"], unit="deg")
cat_b = SkyCoord(ra=table_b["ra"], dec=table_b["dec"], unit="deg")
idx, sep2d, _ = cat_a.match_to_catalog_sky(cat_b)
matched = sep2d < 1 * u.arcsec # keep only matches within 1 arcsec
- For server-side cross-matching of large catalogs (millions of rows),
use the Gaia archive's
Gaia.cross_matchor VizieR'sxmatchservice (astroquery.xmatch.XMatch.query) instead of downloading both catalogs and matching locally. - Always choose a match radius informed by the positional uncertainties of both catalogs (typically a few tenths of an arcsec to a few arcsec depending on survey epoch and proper motion), and report the chosen radius — an unjustified radius is a common review comment.
5. Handle rate limits, paging, and caching
- Large archives (Gaia, SDSS) throttle or queue large synchronous
queries; prefer async jobs and add
TOP n/WHEREcuts during development, removing them only for the final run. astroquerycaches query results locally by default (astroquery.cache) — useful for reruns during development, but clear or bypass the cache (cache=False) when the underlying catalog may have been updated (e.g., a new Gaia data release).- Respect each archive's usage policy and attribution requirements (most surveys require citing a specific data-release paper, not just "Gaia" or "SDSS" generically — check the archive's citation page).
Limitations
- Requires live network access to third-party services (ESA Gaia archive, SDSS SkyServer, MAST, NASA/IPAC); none of this works offline, and service outages or schema changes on the provider side are outside this skill's control.
- ADQL syntax and available tables differ across TAP services (Gaia archive vs. a generic VO TAP endpoint); the examples here target the Gaia archive specifically and may need adjustment for other services.
- Row limits, query timeouts, and anonymous-vs-authenticated quotas vary by archive and can change; check the specific archive's current documentation for large queries.
- Does not cover proprietary/embargoed data access (e.g., unreleased
HST/JWST proposals), which requires authenticated access through
astroquery.mastwith credentials managed outside this skill.
Quality Checklist
- Row limit explicitly set (not left at a silent default) for cone searches.
- Cross-match radius chosen based on stated positional uncertainties, not an arbitrary round number.
- Async queries used for anything beyond a trivial cone search.
- Catalog/data-release version recorded (e.g., "Gaia DR3", not just "Gaia") for reproducibility and citation.
- Cache behavior considered when re-running against a catalog that may have been updated.
示例提示词
帮我从Gaia和SDSS星表查询某天区的恒星数据并做交叉证认。
所属插件
安装该插件会一并获得同领域的 22 个 Skill / MCP。
同插件的其他科研 Skill
- 天文光谱分析Reduces 1D astronomical spectra with specutils: continuum normalization, line fitting, redshift/radial-velocity measurement, equivalent widths. Use for spectral classification or velocity work.
- 天文观测数据分析Runs applied astronomy pipelines with astropy/astroquery: catalog cross-matching, Gaia/SIMBAD queries, aperture photometry, CMB power spectra. Use for end-to-end data-analysis workflows.
- Astropy天文数据处理Covers core Astropy APIs for units, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use as the API reference, before reaching for applied workflows.
- 谷歌量子计算框架Builds noise-aware quantum circuits for Google Quantum AI hardware and runs characterization experiments. Use for Google-hardware targeting; use qiskit for IBM or pennylane for differentiable ML.
- 有限元法求解偏微分方程Solves PDEs with finite elements using FEniCS/dolfinx: weak forms, gmsh meshing, Poisson/elasticity problems, boundary conditions, ParaView export. Use for continuum-physics simulation.
- 计算流体力学模拟Runs pseudospectral CFD simulations in Python: Navier-Stokes, shallow water, stratified flows with FFT-based solvers. Use for turbulence, vortex dynamics, or geophysical flow simulation.
- LAMMPS经典分子动力学Runs classical molecular dynamics with LAMMPS: force field selection, NVT/NPT ensembles, RDF/MSD post-processing, OVITO visualization. Use for atomistic materials or molecular simulation.
- 三维科学可视化Creates 3D scientific visualizations with Mayavi: vector fields, isosurfaces, volume rendering, animated 3D plots. Use for visualizing volumetric or vector-field physics data.
- 蒙特卡洛物理模拟Simulates physical systems with Monte Carlo methods: statistical integration, MCMC sampling, the Ising model, error estimation. Use for stochastic physics simulation.
- 地震学数据处理Analyzes seismological data with ObsPy: FDSN waveform download, response removal, phase picking, moment tensor inversion. Use for earthquake and seismic-waveform analysis.
- 粒子图像测速分析Extracts velocity fields from PIV image pairs with OpenPIV: cross-correlation, vector validation, vorticity/strain-rate statistics. Use for experimental fluid-flow measurement.
- 量子机器学习框架Trains quantum circuits with autodiff across IBM/Google/Rigetti/IonQ devices: VQE, QAOA, hybrid models with PyTorch/JAX. Use for gradient-based variational quantum algorithms.
- 恒星测光分析Performs PSF and aperture photometry with photutils: source detection, PSF fitting, background estimation, multi-epoch light curves. Use for precision stellar photometry beyond one aperture sum.
- 物理信息神经网络Builds physics-informed neural networks, neural ODEs, and data-driven force fields with PyTorch, DeepXDE, torchdiffeq. Use for ML-based physics simulation and surrogate modeling.
- IBM量子计算框架Runs IBM Quantum workflows end to end: Runtime primitives, transpilation, hardware backend selection, error mitigation. Use when targeting IBM Quantum hardware or Runtime.
- Qiskit量子线路实验Implements Qiskit algorithms: circuit construction, VQE/QAOA workflows, noise-model simulation, statevector-vs-shot comparisons. Use for algorithm design and local simulation.
- 开放量子系统模拟Simulates open quantum systems with QuTiP: master equations, Lindblad dynamics, decoherence, cavity QED. Use for open-system physics, not circuit-based quantum computing.
- SciPy数值计算工具Solves ODEs/PDEs, runs FFT analysis, optimization, and sparse linear algebra with SciPy for physics problems. Use as the general-purpose numerical-computing toolkit.
- SymPy符号计算Performs symbolic computation for physics with SymPy: algebra, calculus, Lagrangian mechanics, quantum operators, code generation. Use for exact derivations, not numerical solving.
- 物理量纲与不确定度传播Tracks physical units and propagates measurement uncertainty with pint/uncertainties: GUM budgets, Monte Carlo propagation, dimensionless-group checks. Use to sanity-check a result or unit.
- 多维标注数组NetCDF分析Analyzes labeled multi-dimensional arrays with xarray: NetCDF/HDF5 I/O, lazy Dask loading, rechunking, Zarr stores, CF conventions. Use for gridded scientific data handling.
常见问题
天文星表检索能做什么?
Queries astronomical archives (Gaia, SDSS, VizieR, MAST, NED, SIMBAD) via astroquery/TAP/ADQL and cross-matches results. Use when sourcing or combining survey data by position。
如何安装天文星表检索?
在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「天文星表检索」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。
天文星表检索需要哪些权限?
该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。
天文星表检索经过官方审核吗?
是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。