What problem does it solve?
This Skill simplifies astronomical data analysis by providing access to Astropy APIs, enabling unit conversions, coordinate transformations, FITS file operations, and more, all within your code.
Core Features & Use Cases
- Unit Conversions and Quantities: Handle physical quantities with units and perform unit conversions.
- Coordinate Systems: Convert between celestial coordinate systems and calculate positions and separations.
- Cosmological Calculations: Perform distance and time calculations using standard cosmological models.
- FITS File Handling: Read, write, and manipulate FITS files for image and table data.
- Table Operations: Work with tabular data, including reading, writing, and performing database-style operations.
- Time Handling: Manipulate times and dates with support for various time scales and formats.
- WCS Transformations: Convert between pixel coordinates in images and world coordinates.
- Use Case: Suppose you need to analyze data from a FITS file obtained by an observatory. Use this Skill to read the file, convert celestial coordinates, perform cosmological calculations, and plot the results.
Quick Start
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
distance = 100 * u.pc
distance_km = distance.to(u.km)
coord = SkyCoord(ra=10.5*u.degree, dec=41.2*u.degree, frame='icrs')
coord_galactic = coord.galactic
t = Time('2023-01-15 12:30:00')
jd = t.jd
data = fits.getdata('image.fits')
header = fits.getheader('image.fits')
table = Table.read('catalog.fits')
d_L = Planck18.luminosity_distance(z=1.0)