LLM Skills
~/catalog/data analysis//SKILL
Data analysisGitHub source

Astropy

/SKILL

Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology.

K-Dense-AIK-Dense-AI
31.9k
June 15, 2026
MIT License
// skill content

--- name: astropy description: Core Python library for astronomy and astrophysics workflows that require Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy. license: BSD-3-Clause license compatibility: Requires Python 3.11+ with Astropy installed (see "uv" for package installation). Some features (object name resolution, site lookups, remote FITS reads, IERS updates) require network access. metadata: {"version": "1.2", "skill -author": "K-Dense Inc."} --- # Astropy ## Overview Astropy is the core Python package for astronomy, providing essential functionality for astronomical research and data analysis. Use Astropy for coordinate transformations, unit and quantity calculations, FITS file operations, cosmological calculations, precise time handling, tabular data manipulation, and astronomical image processing. ## When to Use This Skill Use Astropy when tasks involve: - Converting between celestial coordinate systems (ICRS, Galactic, FK5, AltAz, etc.) - Working with physical units and quantities (converting Jy tomJys, parsecs to km, etc.) - Reading, writing, or manipulating FITS files (images or tables) - Cosmological calculations (luminosity distance, lookback time, Hubble parameter) - Precise time handling with different time scales (UTC, TAI, TT, TDB) and formats (JD, MJD, ISO) - Table operations (reading catalogs, cross-matching, filtering, joining) - WCS transformations between pixel and world coordinates - Astronomical constants and calculations ## Quick Start ``python import astropy.units as u from astropy.coordinates import SkyCoord from astropy.time import Time from astropy.io import fits from astropy.table import Table from astropy.cosmology import Planck18 # Units and quantities distance = 100 * u.pc distance_km = distance.to(u.km) # Coordinates coord = SkyCoord(ra=10.5*u.degree, dec=41.2*u.degree, frame='icrs') coord_galactic = coord.galactic # Time t = Time('2023-01-15 12:30:00') jd = t.jd # Julian Date # FITS files data = fits.getdata('image.fits') header = fits.getheader('image.fits') # Tables table = Table.read('catalog.fits') # Cosmology d_L = Planck18.luminosity_distance(z=1.0) ` ## Core Capabilities ### 1. Units and Quantities ( astropy.units ) Handle physical quantities with units, perform unit conversions, and ensure dimensional consistency in calculations. **Key operations:** - Create quantities by multiplying values with units - Convert between units using .to() method - Perform arithmetic with automatic unit handling - Use equivalencies for domain-specific conversions (spectral, doppler, parallax) - Work with logarithmic units (magnitudes, decibels) **See:** references/ units.md for comprehensive documentation, unit systems, equivalencies, performance optimization, and unit arithmetic. ### 2. Coordinate Systems ( astropy.coordinates ) Represent celestial positions and transform between different coordinate frames. **Key operations:** - Create coordinates with SkyCoord in any frame (ICRS, Galactic, FK5, AltAz, etc.) - Transform between coordinate systems - Calculate angular separations and position angles - Match coordinates to catalogs - Include distance for 3D coordinate operations - Handle proper motions and radial velocities - Query named objects from online databases **See:** references/ coordinates.md for detailed coordinate frame descriptions, transformations, observer-dependent frames (AltAz), catalog matching, and performance tips. ### 3. Cosmological Calculations ( astropy.cosmology ) Perform cosmological calculations using standard cosmological models. **Key operations:** - Use built-in cosmologies (Planck18, WMAP9, etc.) - Create custom cosmological models - Calculate distances (luminosity, comoving, angular diameter) - Compute ages and lookback times - Determine Hubble parameter at any redshift - Calculate density parameters and volumes - Perform inverse calculations (find z for given distance) **See:** references/ cosmology.md` for available models, distance calculations, time calculations, density parameters, and neutrino effects.

// original public source
K-Dense-AI/scientific-agent-skills
/skills/astropy/SKILL.md
License: MIT License
Independent project, not affiliated with Anthropic. This skill remains the property of its original author.
// install this skill
Paste this command in your terminal at the root of your project:
mkdir -p .claude/commands && curl -o ".claude/commands/SKILL.md" "https://raw.githubusercontent.com/K-Dense-AI/scientific-agent-skills/main/skills/astropy/SKILL.md"
Then in Claude Code, type /SKILL to activate it.
open_in_newOpen original source
// save
Save available after sign in.
loginSign in to save
// information
CreatorK-Dense-AI
Stars 31.9k
LicenseMIT License
UpdatedJune 15, 2026
Format.md
AccessFree
// similar

Skills Data analysis

View allarrow_forward