SDSS queries official DR20 spectral records and retrieves available spectra while preserving release provenance and quality flags. The creator introduces it as day two of a science-data Skill series for exploring sky-survey data.
SDSS: query sky-survey records and retrieve spectra
Query official SDSS DR20 spectral records by sky region or exact identifier, retrieve available FITS spectra, and retain release provenance and quality flags alongside legacy photometry.
Source facts
- Repository
- simongfarmer/skills
- Last source activity
- October 5, 2026 at 21:54
- Detected SKILL.md language
- English
- Stars
- 1
- Forks
- 0
Uses
Provide ICRS right ascension and declination in decimal degrees with a radius in arcminutes, or an exact identifier and its namespace. Resolve named objects with an authoritative astronomy resolver first; this helper does not resolve names.
Prerequisites
Python 3.11 or later and public HTTPS access to skyserver.sdss.org, the Science Archive Server and api.sdss.org for Valis delivery. The helper uses the standard library and needs no credentials. Resolve scripts relative to the installed skill folder.
How to use
The documented cone query is python scripts/sdss.py cone --ra 229.525575753922 --dec 42.7458537608544 --radius 2. An exact target uses target --id-type sdss_id --id ID. Keep identifiers as strings and distinguish allspec_id records, sdss_id targets and specobjid pipeline spectra. Results follow ID order; when has_more is true, repeat the identical query with --after NEXT_AFTER and retain every page and stopping cap. Use photo-cone or photo-id for DR17 photometry. Download an exact available record with spectrum --id ALLSPEC_ID --output spectrum.fits > spectrum.json. Retain the original FITS bytes, SHA-256, full record, delivery URL and catalog/archive provenance. Supported DR20 BOSS v6_2_1 daily lite products can use --delivery valis after an exact archive-path check; other products use SAS.
Limitations
A target can have multiple observations, and not every imaged target has a spectrum. Empty queries do not establish an empty sky. DR17 imaging and its exact legacy spectrum association must remain distinct from nearby DR20 records; DR20 adds no new SDSS imaging. Morphology or RGB images do not establish object class or photometry. Preserve class, redshift, uncertainties, warnings and instrument metadata; missing values and sentinels are unavailable measurements. A finite redshift with zero warning is not a quality guarantee, and the helper does not load SDSS's visually inspected BHM catalog. Do not infer cosmological distance from stellar redshift. Service failures, unsupported URLs and size limits are reported without automatic fallback. Analysis requires the official file model and a maintained FITS reader.
Install options
The review-first prompt is selected by default. You can switch to a direct command or download a local copy.
Review the source files
Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.
Showing SKILL.md
- name
- sdss
- description
- Query official SDSS DR20 spectral records by sky region or exact target identifier, retrieve available spectra, and interpret classifications, redshifts and legacy photometry with their release provenance and quality flags.
- license
- MIT