Astrometry Pipeline
A Python pipeline that measures how bright a supernova is from telescope images. It calibrates the camera against known reference stars, then reports the supernova's brightness in standard astronomical magnitudes, with uncertainties.

A telescope image is a grid of counts, not a measurement. Getting from one to the other means knowing where every star sits on the sky, how much light landed inside your aperture, how much of that was just sky, and how your particular camera's color response differs from the standard system every other astronomer publishes in. Skip any of those and you have a number that means something only to your own detector.
The parts that carry the weight.
Register two filters
The pipeline opens two stacked FITS images — a green (g) and a red (r) exposure — and reads each header's World Coordinate System. Every reference star's sky coordinates are converted to pixel positions with all_world2pix, so both frames and the star catalog line up on the same grid.
Aperture photometry and sky subtraction
For each calibration star it sums the counts inside a fixed-radius aperture, estimates the background from a surrounding annulus, and subtracts the average sky per pixel. That yields a clean instrumental flux, which becomes an instrumental magnitude via −2.5·log₁₀(flux).
Least-squares color transform
Cameras don't see color the way the standard system does. The code fits two linear transforms by ordinary least squares, solving the normal equations directly with NumPy: one mapping instrumental g−r to standard g−r, and one for the g zero-point.
Solve the supernova and propagate error
It runs the same aperture measurement on the supernova, applies the fitted transforms to recover its standard g and r magnitudes, and propagates uncertainty from the fit residuals — the root-mean-square scatter about each line — into a final error on g, r, and g−r.
Why it's built this way.
- 01
The error bar comes from the calibration fit itself rather than from an assumption. If the reference stars scatter about the transform, that scatter is what the uncertainty is made of.
- 02
Two filters, not one. A single band gives you a brightness on your own camera's scale; the color term is what makes the number comparable to anyone else's.
- 03
Hand-coded line by line with Astropy and NumPy, so every transformation and edge case is understood and owned rather than inherited from a package that might be doing something else.