astropy
Analyze Astronomical Data with Astropy Python Library
Also available from: davila7
Working with astronomical data requires handling complex coordinate systems, file formats, and calculations. This skill provides guidance for using Astropy to process celestial coordinates, FITS files, and cosmological computations.
Download the skill ZIP
Upload in Claude
Go to Settings → Capabilities → Skills → Upload skill
Toggle on and start using
Test it
Using "astropy". How do I convert a coordinate from ICRS to Galactic?
Expected outcome:
- Create a SkyCoord object with your RA and Dec values in ICRS frame
- Access the .galactic attribute to transform to Galactic coordinates
- The result contains .l (longitude) and .b (latitude) in degrees
Using "astropy". What is the luminosity distance at redshift 1.5?
Expected outcome:
- Using Planck18 cosmology, the luminosity distance at z=1.5 is approximately 11.1 Gpc
- The angular diameter distance is about 1.78 Gpc
- The lookback time is roughly 9.4 billion years
Security Audit
SafeThis skill is a documentation reference for the Astropy Python library. All 406 static findings are false positives. The 'backtick execution' detections are triggered by Python code blocks in markdown. The 'C2 keywords' are astronomy terms like 'distance' and 'separation'. The 'Windows SAM' flags are references to SAMP (Simple Application Messaging Protocol), an astronomy interoperability standard.
Risk Factors
⚙️ External commands (356)
📁 Filesystem access (4)
⚡ Contains scripts (1)
🌐 Network access (5)
Quality Score
What You Can Build
Convert Celestial Coordinates
Transform coordinates between different reference frames for observation planning or catalog cross-matching.
Process FITS Astronomy Files
Read and analyze FITS format telescope images and catalogs for research or data pipeline development.
Calculate Cosmological Distances
Compute luminosity distances, lookback times, and Hubble parameters for distant galaxy analysis.
Try These Prompts
How do I convert ICRS coordinates (RA=10.5 deg, Dec=41.2 deg) to Galactic coordinates using astropy?
Show me how to open a FITS file, read the image data from the first extension, and access header keywords like EXPTIME.
Calculate the luminosity distance and lookback time to a galaxy at redshift z=2.5 using the Planck18 cosmology.
I have two astronomical catalogs with RA/Dec columns. How do I cross-match them within 1 arcsecond using astropy coordinates?
Best Practices
- Always attach units to quantities using astropy.units to prevent dimensional errors
- Use context managers when opening FITS files to ensure proper resource cleanup
- Process coordinate arrays rather than looping for better performance
Avoid
- Do not hardcode unit conversions manually when astropy can handle them automatically
- Avoid looping over individual coordinates when array operations are available
- Do not assume coordinate frames match without explicit verification
Frequently Asked Questions
What is astropy used for?
How do I install astropy?
What coordinate systems does astropy support?
Can astropy read FITS files?
What cosmological models are available?
How do I handle time in astropy?
Developer Details
Author
K-Dense-AILicense
BSD-3-Clause license
Repository
https://github.com/K-Dense-AI/claude-scientific-skills/tree/main/scientific-skills/astropyRef
main