Subtraction
Result: sci − ref
SUBTRACT THE SKY. SEE WHAT'S LEFT.
Two images minus each other, done right, leaves only what changed. This tutorial covers the two corrections that have to happen before subtraction means anything, and the two real subtraction methods the pipeline uses. Nine tutorials, read in order — this is the third.
Unlike the Overview page, nothing on this page is invented. This describes the real pipeline — the same one the viewer, survey and cell browsers actually run.
Subtracting the sky away
Two images minus each other, done right, leaves only what changed.
Once the science frame and the reference share a pixel grid, subtraction should erase everything static — but two corrections come first, and the order is not negotiable.
Match the blur. Equalize the point-spread first.
One frame is always a little sharper than the other. The rule is to degrade the sharper image toward the blurrier one — never to sharpen. You can't invent resolution that isn't there, and any attempt to sharpen manufactures fake detail exactly where subtraction needs to trust the pixels most.
Match the brightness. Equalize the flux next.
Only after blur is equalized does photometric scaling make sense — bringing both frames onto the same overall brightness scale, so an unchanged star actually cancels to zero instead of leaving a false residual.
ois. Kernel matching, found automatically.
Alard-Lupton kernel matching discovers the convolution kernel that turns the sharper image into the blurrier one on its own — no PSF model required going in.
PyZOGY. Proper subtraction, PSF supplied.
A statistically "proper" method that instead needs an explicit PSF model handed in for both images, using that shape to build a near-optimal difference.
12× noisier than ZTF's own difference — and that's expected
Checked against ZTF's own official difference image for the same exposure, this project's homemade subtraction carried roughly 12 times the residual noise. Not a flaw in the method — ZTF's reference is a deep, professionally built co-add; this project's is shallower by comparison.
Artifacts are not bugs. A perfectly clean difference image is never achievable. Dipoles — light/dark pairs at bright or saturated stars — and a faint mottled texture from correlated pixel noise are normal, expected byproducts of subtraction, not signs something went wrong.
What actually survives subtraction is simple: something appeared, something faded, or something moved.
Go watch it run.
Everything above is the real pipeline, explained in the order it runs. The browsers below are that same pipeline's actual output — a working ZTF difference-imaging system, not a mockup of one.
Or read what this project actually is