Svenesis Satellite Trail Cleaner
Version 1.0.0 – GPL-3.0-or-later
🚧 First stable release (v1.0.0). Not yet submitted to the official Siril Script Repository. Download directly from GitHub.
The Satellite Trail Cleaner identifies and removes linear satellite or aircraft trails from individual astrophotography sub-exposures before stacking. Unlike Siril’s standard sigma-clipped rejection – which requires 8+ frames to work reliably – this tool cleans affected frames individually, making it invaluable for short sequences, single-night campaigns, or LRGB stacks with limited per-filter counts.
When to Use This Tool
⚠️ This tool only helps with specific images – it is not a universal trail remover. The script even includes a color-coded workflow advisor banner that flags folders where the cleaner is the wrong choice.
✅ Best suited for
- Short sequences (typically fewer than 8 frames per filter) where Siril’s sigma-clipped stack rejection cannot reliably remove trails
- Single-night campaigns and LRGB stacks with limited per-filter counts
- Calibrated sub-exposures – FITS, XISF, TIFF, or RAW that has already been calibrated (darks, bias, flats)
- Linear trails: satellites (including “flashing” satellites with bright pearls), aircraft, and bright meteor streaks
⛔ When NOT to use it
- Uncalibrated RAW files with strong sensor banding – the built-in banding detector classifies frames as
clean / moderate / strong / severeand will warn you. Calibrate first (darks/bias) before running the cleaner. - Large, well-distributed stacks (8+ frames per filter) – Siril’s standard sigma-clipped rejection handles those reliably and is the better choice. The cleaner is designed to fill exactly this gap, not to replace stack-based rejection.
- Curved or non-linear features (smoke trails, fish-eye distortion) – the Radon transform expects straight lines
- As a substitute for calibration – the tool repairs trails, not gradients, hot pixels, or noise patterns
Detection – STScI Median Radon Transform
The script uses the same satellite-detection pipeline NASA’s Space Telescope Science Institute employs on HST/ACS imagery (Stark et al. 2022, ACS ISR 2022-08 – PDF). The Median Radon Transform is mathematically robust to bright stars, preventing the false-positive “fan” patterns that plague traditional Hough or Canny detectors.
- Matched-filter peak detection with three precomputed line-width kernels
- Per-candidate validation via Gaussian fitting
- Optional persistence testing to reject non-uniform features
- Automatic endpoint extension to image boundaries
- Bright-halo mask growth absorbs satellite flashes and pearls
Inpainting – Six Methods with Smart Recommendations
The tool offers six inpaint strategies, each suited to different trail characteristics:
- Perpendicular Strip Median (default) – preserves sky gradients; excellent for “flashing satellite” trails with bright pearls
- Harmonic / Laplace (∇²u = 0) – maximum-principle solver preventing ringing
- Nearest Neighbor + Smooth – fast, ~1 s per frame
- OpenCV Fast Marching (Telea) – sub-200 ms, good fallback
- OpenCV Navier-Stokes – fastest option
- Biharmonic (experimental) – mathematically smooth but may overshoot
Sky-noise matching: a post-processing step adds Gaussian noise matching the local sky σ, making filled regions statistically indistinguishable from real sky for stack-rejection algorithms.
Intelligent Workflow Features
- Recommendation banner – analyzes the specific trail profile (sky gradient, pearl count, mask compactness) and recommends the best-suited method with a one-click Apply button
- Star protection (default ON) – isotropy filter distinguishes radially-symmetric stellar peaks from elongated satellite pearls, preventing accidental removal of real stars beneath trails
- Interactive line picker – every detected trail appears as a clickable green overlay; toggle remove/keep before applying
- Workflow advisor banner – color-coded guidance (red / orange / yellow / hidden) indicates whether the cleaner is appropriate for your folder
File Format Support
Format-preserving round-trips for all common astrophotography formats:
- FITS – header preserved verbatim; plate-solving data retained
- XISF (PixInsight native) – FITSKeywords and XISFProperties carried forward, including astrometric solutions
- TIFF – bit-exact dtype control; PlanarConfiguration honored
- RAW (CR2/CR3/NEF/ARW/DNG/ORF/PEF/RAF/RW2/SRW/MRW/X3F/KDC) – debayered to FITS; original preserved
Original files move to an originals/ subfolder – all changes are reversible.
Batch Processing & Performance
- Parallel pipeline – frame N+1’s load and detection runs in a worker thread while the main thread inpaints and writes frame N (~1.5–2× speedup on 20+ frame batches)
- Progress feedback – running counters for Cleaned / Skipped / Errors plus elapsed and remaining time
- Thread management – cross-platform BLAS thread sanity prevents oversubscription on macOS Apple Silicon, Linux, and Windows
Output & Documentation
Non-destructive results:
- Cleaned images replace original filenames (existing pipelines unaffected)
- Audit trail:
trail_cleanup_report.txt(human-readable TSV) and.json(machine-structured records per frame) - Frames with no detected trails remain untouched
The audit log captures detection status, line count, pixels replaced, inpaint method used, dilation settings, scan mode, RGB-reduce mode, version, and timestamp.
Dependencies
sirilpy (bundled); auto-installed: numpy, PyQt6, astropy, opencv-python-headless, photutils, scikit-image, acstools, xisf, tifffile