astropy

Perform unit-aware astronomical computations with coordinates, FITS I/O, and cosmology.

16|7|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/jackspace/ClaudeSkillz --skill astropy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: astropy
Source: https://github.com/jackspace/ClaudeSkillz/tree/main/skills/scientific-pkg-astropy
Command: npx skills add https://github.com/jackspace/ClaudeSkillz --skill astropy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Astropy provides core astronomical functionality for coordinates, units, FITS I/O, cosmology, time, and tables to enable reproducible astro data analysis.

Core Features & Use Cases

  • Units & Quantities: Do unit conversions with physical correctness.
  • Coordinate systems: Transform between ICRS, Galactic, AltAz, etc.
  • FITS and Tables: Read/write FITS, and manipulate tables.
  • Cosmology & Time: Planck18 distances, lookback times, and precise time scales.
  • WCS & NDData: World coordinate systems and data containers.

Quick Start

Convert coordinates, read FITS, and compute a cosmology distance in a simple script.

Frequently Asked Questions about astropy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I transform astronomical coordinates between different reference frames?

Coordinate transformations between ICRS, Galactic, FK5, and AltAz frames are handled by astropy.coordinates. Define your input coordinates with a frame, then use the `.transform_to()` method to convert to any target frame, automatically applying proper rotations and epoch corrections.

Can I read and write FITS files with unit-aware data handling?

Yes. astropy.io.fits reads and writes FITS files, while astropy.units ensures all numerical values carry explicit physical units. Combine them to load FITS data, attach units to columns, and write results back with full unit preservation and metadata integrity.

How do I compute cosmological distances and lookback times?

Use astropy.cosmology with Planck18 parameters to calculate luminosity distances, comoving distances, and lookback times at any redshift. Specify your cosmology model, provide redshifts, and retrieve distances with proper physical units attached.

What's the best way to handle precise astronomical time scales in my analysis?

astropy.time converts between UTC, TAI, TT, and other astronomical time scales with nanosecond precision. Create Time objects from your input format, specify the scale, and transform to any target scale automatically while accounting for leap seconds and relativity.

Do I need separate tools to convert between physical units like magnitudes and flux?

No. astropy.units handles unit conversions with physical correctness, including non-linear conversions for magnitudes and flux densities. Define quantities with units, chain conversions, and the framework validates dimensional consistency throughout your workflow.

Can astropy work with large astronomical catalogs and cross-matching tasks?

Yes. astropy.table manages tabular data with unit awareness, and coordinate tools enable efficient cross-matching between catalogs. Load FITS tables, apply coordinate transformations, and match sources using angular separation—all with preserved metadata and units.