Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Covers FITS file handling, coordinate transforms, photometry, spectra, catalog cross-matching, and sky survey archive access with Astropy.
32% 64%+32 ptsof test cases passed
Passed 14 of 22 test cases with the skill, and 7 of 22 without it.
3 of 3 safety checks passed
Not used yet
A skill for processing and analyzing astronomical data using standard astrophysics tools. Covers FITS file handling, coordinate transformations, photometric analysis, spectral analysis, catalog cross-matching, and accessing major sky survey archives.
FITS (Flexible Image Transport System) is the standard data format in astronomy:
from astropy.io import fits
import numpy as np
def inspect_fits(filepath: str) -> dict:
"""
Inspect the structure of a FITS file.
Returns information about each HDU (Header/Data Unit).
"""
with fits.open(filepath) as hdul:
info = []
for i, hdu in enumerate(hdul):
entry = {
"index": i,
"name": hdu.name,
"type": type(hdu).__name__,
}
if hdu.data is not None:
entry["shape"] = hdu.data.shape
entry["dtype"] = str(hdu.data.dtype)
if hasattr(hdu, "columns") and hdu.columns is not None:
entry["columns"] = [c.name for c in hdu.columns]
info.append(entry)
return {"filename": filepath, "n_hdus": len(hdul), "hdus": info}
def read_fits_image(filepath: str, hdu_index: int = 0) -> tuple:
"""Read a FITS image and its WCS (World Coordinate System)."""
from astropy.wcs import WCS
with fits.open(filepath) as hdul:
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.