Astropy: Python for Astronomy
v7.2 — 2026 Edition. A comprehensive guide to Astropy, the core package for Astronomy in Python, covering units, coordinates, tables, FITS files, modeling, and cosmology (v7.2).
Episodes
The Heart of Astropy: Units and Quantities
3m 39sDiscover the foundational concepts of Astropy: units and quantities. Learn how to combine scalar values and arrays with physical units to automatically handle dimensional analysis.
Time Scales and Precision: The astropy.time Module
4m 08sExplore how Astropy handles sub-nanosecond precision over the age of the universe. We cover UTC, TAI, Barycentric Dynamical Time, and the Time object.
Navigating the Sky: The SkyCoord Class
3m 43sLearn how to define and transform celestial coordinates using the SkyCoord class. We explore the ICRS, Galactic frames, and catalog cross-matching.
Beyond RA and Dec: 3D Tracking and Velocities
3m 42sMove beyond static 2D coordinates. Learn how to add distances, calculate 3D separations, model proper motions, and compute radial velocity corrections.
Tabular Data Mastery: The QTable Class
3m 38sDiscover why Astropy has its own QTable class instead of relying purely on Pandas. Learn how to store multidimensional columns, Quantities, and Mixins.
Advanced Table Operations: Masking and Joins
3m 41sTake your QTable skills to the next level by handling missing data with MaskedColumns and executing database-style joins.
The Unified I/O Interface
3m 43sLearn how Astropy abstracts file reading and writing into a single unified interface. We'll cover handling FITS tables, VOTables, and ASCII formats seamlessly.
Demystifying FITS Headers and HDUs
3m 34sDive into the raw astropy.io.fits module to manipulate Header Data Units (HDUs). Learn how to parse, edit, and fix non-standard FITS headers.
Handling Massive FITS Files and Cloud Storage
3m 34sLearn how to handle massive FITS datasets that don't fit in RAM using memory mapping, and discover how to stream cutouts from cloud buckets using fsspec.
Gridded Data: The NDData and CCDData Classes
3m 53sStep up from raw numpy arrays to CCDData. Learn how to bundle 2D image data with masks, WCS metadata, and robust physical uncertainties.
World Coordinate Systems: Mapping Pixels to the Sky
4m 02sTranslate camera pixels into celestial coordinates using the WCS package. Understand the high-level API and the math behind FITS projections.
Analytical Models and Fitting
3m 39sDive into the astropy.modeling module. Learn how to construct 1D and 2D models, apply parameter constraints, and run linear or non-linear fitters.
Compound Models and Custom Fits
3m 37sExpand your modeling toolkit by combining multiple mathematical models and defining your own custom fitters and unit-aware models.
Time Series Analysis: Hunting Exoplanets
4m 18sAnalyze periodic data using the astropy.timeseries module. We walk through folding light curves and discovering periods with the Box Least Squares algorithm.
Cosmological Calculations: Sizing up the Universe
3m 29sPerform complex universe-scale calculations using the astropy.cosmology module. Compute lookback times, luminosity distances, and find redshifts based on age.