read_fits¶
Read a 1D spectrum from a FITS file (local path or http(s) URL).
| Category | Input / output |
| Backend | astropy - wraps the domain-standard astropy implementation |
| Version | 2.0.0 |
| Reads | - |
| Writes | spectrum |
Linear WCS: λ = CRVAL1 + (p − CRPIX1)·CDELT1 with 1-based CRPIX1. Logarithmic axes: IRAF DC-FLAG = 1 means CRVAL1/CDELT1 are log10(λ) (axis = 10(…)); a CTYPE1 ending in '-LOG' (WAVE-LOG, AWAV-LOG) is a WCS Paper III logarithmic axis, λ = CRVAL1·exp((p − CRPIX1)·CDELT1 / CRVAL1). v2.0.0: the '-LOG' case is now decoded with the Paper III formula — v1 applied 10 to it, which returned inf for any CRVAL1 in Å (CTYPE1='WAVE-LOG', CRVAL1=5000, CDELT1=1, CRPIX1=1: v1 [inf, inf, inf], v2 [5000, 5001.0001, 5002.0004], matching astropy.wcs). The IRAF DC-FLAG branch is unchanged.
Parameters¶
| Parameter | Default | Required | Description |
|---|---|---|---|
path |
None |
yes | Local path or http(s) URL of the FITS file to read. |
Use it¶
References¶
- FITS Standard 4.0 — Pence et al. 2010, A&A 524, A42
- astropy.io.fits — Astropy Collaboration 2022, ApJ 935, 167
- Greisen, Calabretta, Valdes & Allen 2006, A&A 446, 747 — WCS Paper III (spectral coordinates; '-LOG' axes).
Related algorithms¶
read_ascii_spectrum- Read a 1D spectrum from a two- or three-column text file.read_echelle_fits- Read a multi-order échelle FITS file intoctx.spectra.read_sdss_spectrum- Read an SDSS-format spectrum (spec-*.fits) intoctx.spectrum.read_votable_spectrum- Read a 1D spectrum from a VOTable file (the IVOA Virtual Observatory format).