Description
Cosmic rays (and equivalent glitches) are high-energy particle impacts on the sensor during an exposure, which deposit a large amount of charge locally and create a very bright point or a short vivid streak.
Their distinctive signature: they appear on only one sub, at a random position, with no counterpart in other subs or in the real sky.
They are more frequent as exposures are longer and, to a lesser extent, as site altitude increases (the effect is significant mainly at high altitude or in aircraft), but remain a marginal defect: a few impacts per sub, with no real consequences.
This is an environmental defect that stacking eliminates on its own. To be distinguished from a satellite trail (long, crossing the field) and from residual hot pixels (fixed on every sub).
Visual signature
Very bright points or short vivid streaks appear here and there, often with sharp edges, without a halo or stellar structure (no diffraction pattern).
The decisive sign: they are present on only one sub and absent from all others, at a position that corresponds to no sky object.
Their shape is random: from a single overexposed pixel to a small segment, sometimes slightly kinked depending on the angle of incidence of the particle.
On a stacked master with rejection, they disappear; they are only visible when inspecting individual subs or when rejection is poorly configured.
Differential diagnosis
Not to be confused with a satellite or aircraft trail: a trail is a long, thin line crossing part of the field, whereas a cosmic ray is a point or very short streak.
To be distinguished from residual hot pixels: a hot pixel is fixed and present on every sub at the same location; a cosmic ray only appears on one sub, at a random position.
To be separated from a faint star: a star appears on every sub and on the DSS reference; a cosmic impact is unique and absent from the real sky.
Not to be mistaken for an internal reflection: a ghost repeats on every sub of the same framing; a cosmic impact is isolated and does not repeat.
Probable causes
- High-energy particle impact on the sensor during the exposure
- Long exposures, which are more exposed to impacts
- High-altitude site (effect significant mainly at high altitude or in aircraft)
- Sporadic electronic glitches in the sensor
- Stack built from too few subs for effective rejection
- Statistical rejection poorly configured or disabled
Course of action
- Stack with statistical rejection (sigma clipping) to eliminate them automatically
- Accumulate enough subs for effective rejection
- Enable CosmeticCorrection for isolated points
- Verify rejection settings at stacking
- Inspect and discard a sub that is particularly heavily impacted if needed
- Do not process a single unstack sub for faint targets
The Doc's advice
Cosmic rays, honestly, are the least of your worries: if you stack with rejection (sigma clipping), they disappear on their own, since they are exactly the kind of outlier that rejection is designed to remove. The only case where they cause trouble is when you have very few subs: with 3-4 frames, rejection does not have enough samples to decide, and an impact can survive into the master. The fix is simple: stack more subs, and enable CosmeticCorrection to clean up isolated points. Otherwise, do not give them a second thought, they are cosmetic noise with no impact on the final image.
Think you can see this defect in your image?
Run a diagnosisFrequently asked questions
What is a cosmic ray in an astrophoto?
It is the trace left by a high-energy particle (cosmic ray or secondary radiation) hitting the sensor during an exposure. It deposits a burst of charge on one or a few pixels, creating a very bright point or a short vivid streak, with sharp edges and no diffraction pattern (unlike a star). Its defining feature: it appears on only one sub, at a random position. Long exposures and high-altitude sites receive more of them, but it remains anecdotal.
How do you get rid of cosmic rays?
Stacking with statistical rejection handles them automatically. Because a cosmic impact is present on only one sub, the rejection algorithm (sigma clipping, Winsorized, linear fit clipping, etc.) flags it as an outlier and excludes it from the combination. For this to work well, you need a sufficient number of subs (rejection needs samples to work from) and correctly set rejection parameters. As a complement, PixInsight's CosmeticCorrection cleans up any residual isolated points.
Cosmic ray or hot pixel: how to tell them apart?
By their behavior from one sub to the next. A hot pixel is a permanent sensor defect: it always appears at the same location, on every sub. A cosmic ray is a unique, random event: it affects only one sub, at any position. If you compare two or three subs and the bright point stays on the same pixel, it is a hot pixel (handled by darks and dithering); if it jumps to a different position or only appears once, it is a cosmic ray (handled by stacking rejection).
Should you worry about cosmic rays?
No, it is one of the most benign defects in deep-sky imaging. A few impacts per sub are normal and stacking removes them without a trace. They only become a nuisance in special cases: very few subs (rejection lacks samples), a single un-stacked frame, or rejection disabled. In those situations, add more subs or apply cosmetic correction. In normal use, they do not deserve any particular attention.