satelliteRemovalAI4.pth, shipped with SASpro; nothing talks to a remote server.
The three buttons on the left control panel pick how the segmenter is applied:
_satellited suffix (for file-based). This mode shows a native progress dialog with a working Cancel button — use it to tune sensitivity before committing to a batch run._satellited) are skipped automatically, so you can re-run a batch to pick up new arrivals without duplicating work. Also skips files whose output already exists in the output folder — safe to interrupt and resume.Two buttons at the top of the control column pick input and output folders. The button text updates to show the chosen folder's name once set; the full path is kept in QSettings and restored on next open. Both folders are tracked by a QFileSystemWatcher: when the OS reports a directory change (file added, removed, renamed) the matching tree view on the right refreshes automatically.
The tree views show every supported file in each folder:
Supported formats for load: PNG, TIFF (8/16/32-bit), FITS (any bit depth), XISF, and camera raws (CR2, NEF, ARW, DNG, RAF, ORF, RW2, PEF, JPG, JPEG). Output format matches the input extension — a FITS sub produces a FITS output, an XISF produces XISF with its original per-image metadata preserved, and so on. Formats SASpro's legacy saver can't write to directly default to FITS 32-bit float.
The Satellite Removal Mode dropdown picks what the segmenter operates on:
Default is Full. Luminance is a good fallback when Full is over-correcting the chrominance of the surrounding sky (visible as a faint color cast where the trail was).
The segmenter's raw output is a soft confidence mask with values in [0, 1] — brighter where the model is more confident a pixel is on a trail. The Clipping Sensitivity slider (0.01-0.50, default 0.10) is the threshold applied to that mask:
Mask values below the sensitivity threshold are zeroed out (treated as background); values at or above are kept. Lower sensitivity = more aggressive segmentation — the model catches dimmer trails but may also false-positive on bright star edges or sharp nebula structures. Higher sensitivity = more conservative; only the obvious trails are cleaned. 0.10 is a good default; drop to 0.05 for subtle trails on dim backgrounds; raise to 0.20 if you're seeing false positives on your data.
Two checkboxes modify what happens where the mask is non-zero after thresholding:
Skip Save if No Satellite Trail Detected is a batch-mode optimization. The segmenter reports a boolean detected flag alongside the mask; if the max of the thresholded mask is zero, nothing was found and this checkbox causes the file to be skipped entirely rather than written out as a bitwise-identical copy. Useful for processing a 500-sub session where only 20 subs actually have trails — you end up with 20 output files to review, not 500. The input tree still lists all files; only the output tree shows the subset that actually needed work.
Delete Original Image After Saving is the most destructive option in the dialog and is treated accordingly. When checked and before any run begins, a confirmation dialog spells out exactly what will happen:
The dialog defaults to "No" and must be explicitly confirmed with "Yes" to proceed. Cancel on this confirmation aborts the run before any files are touched.
os.path.abspath comparison) before deleting. Everything else is up to you. If your output folder is the same as your input folder, the _satellited suffix produces a different filename and the original gets deleted. If you use delete-original with a bad sensitivity setting on a batch, you'll lose the originals of files that got over-aggressively "cleaned." Use it when you're confident, and preferably with the output folder on a different disk or in a different directory tree so the originals aren't gone forever if you ever want to re-run.
The Use GPU Acceleration dropdown is a simple Yes/No. "Yes" picks the best available GPU backend (CUDA on NVIDIA, DirectML on Windows for Intel/AMD, MPS on Apple Silicon where available). "No" forces CPU — considerably slower, but useful for debugging or for running satellite cleanup in the background while the GPU is tied up with something else (stacking, denoise on the main Cosmic Clarity dialog, another AI task).
GPU Compatibility Mode is the fallback for problematic hardware — low-VRAM GPUs, older cards, certain Windows laptop configurations where the normal AI path crashes. Compatibility Mode uses a conservative inference path with reduced batching and no half-precision autocast. Slower, but survives where the default path fails. Toggle it on if the first batch run throws a GPU error or produces visibly corrupted output; leave it off otherwise.
name_satellited.ext alongside originals). Enable Delete Original. Confirm the warning. Batch Process. Originals get deleted as cleaned versions are saved; disk usage stays flat. Use with care.
satelliteRemovalAI4.pth.The segmenter outputs a soft confidence mask in the unit interval:
Values near 1 indicate high confidence that a pixel is on a trail; values near 0 indicate background. The sensitivity threshold is a simple floor:
where 1 is the indicator function. The thresholded mask m' drives the output: pixels where m' = 0 are left as the original source; pixels where m' > 0 are either zeroed (clip trail on) or replaced with an AI-interpolated inpaint (clip trail off).
The engine reports a boolean detected flag alongside the processed image:
— true if any pixel survived the threshold. The Skip-Save-If-None checkbox tests this flag to decide whether to write the output file. The flag is also what the per-file log line reports ("Skip (no trail): filename" vs "Saved: filename").
When Clip Trail is on, the output is the source with masked pixels set to zero:
This is deterministic and visually obvious — downstream per-sub integration rejection schemes (sigma clipping, Winsorized, percentile) see pure zeros and reject them cleanly. The alternative (clip off) runs an AI inpaint over the masked region and composites:
which gives smoother single-sub appearance but writes "real-looking" pixel values that may be harder for a stacker to reject if the segmentation was imperfect.
Full mode runs the segmenter on the RGB input directly, producing a per-channel correction. Luminance mode first extracts a luminance channel using the standard Rec.709 weights:
runs the segmenter on Y alone, and composites the result back as a luminance replacement with the original chrominance preserved:
where f_sat is the trail-removal operation on luminance. Division is guarded against Y=0 (black pixels keep their RGB zeros). Luminance mode is ~3× faster than Full since only one channel is processed, and it preserves color in regions where the trail is primarily a brightness anomaly.
Live Monitor is the Batch loop with a polling sleep at the bottom:
(milliseconds, default 1000ms = 1s). The thread maintains a _seen set of already-processed filenames; each poll pass computes todo = current_files - seen and processes only the new entries. Files already in the output folder (same stem + _satellited suffix) are logged "Exists, skipping" and marked done without re-processing — safe to restart the monitor against the same input folder without redundant work.
Before unlinking an original, the engine checks:
If the two paths resolve to the same file (input and output folder set to the same location, suffix stripping somehow produces the input name back, user manually set output path to collide with input), the delete is skipped and the original is preserved. This is the only protection against delete-with-same-path accidents — no undo trash, no "delete after 30 days" grace window, no SASpro-level recoverable deleted-items store. The warn callout in §5 covers the rest.
XISF inputs carry per-image metadata (CFA layout, bayer pattern, instrument info, environmental data, calibration provenance) that stackers depend on. The load path extracts this as the xisf_meta field of the metadata dict; on save, SASpro passes it through to the writer as the image_meta parameter. If the metadata is a single dict rather than a list of dicts (XISF supports multi-image containers), it's wrapped in a one-element list before passing — the XISF writer expects a list. FITS metadata (headers) rides through on the standard header pathway independently; TIFF and PNG have no equivalent per-image metadata so the fields are passed as None.
Per-batch progress is reported as:
where done is the count of files already processed (or skipped) in the current pass and total is the pass's todo-list size. In Live Monitor mode the total resets each poll pass; the wait dialog shows "N / M files" during active processing and "0 / 0" during idle polling. Single-image mode uses a native QProgressDialog instead of the batch wait dialog, with the engine's per-tile progress callback driving the bar directly.
Every image loaded is normalized to float32 in [0, 1] before inference:
The clip bounds the input to the model's trained range (uint16 inputs scale by 1/65535 first); the output is clipped again before save to guarantee no out-of-range values reach disk. Saves use SASpro's standard legacy writer with 32-bit float as the default bit depth for FITS and TIFF; PNG and JPEG fall back to the writer's own 8-bit encode.
Satellite dialog settings persist under the satellite/ QSettings prefix:
satellite/input_folder, satellite/output_folder — folder paths.satellite/use_gpu, satellite/gpu_compat — GPU dropdown and compatibility checkbox.satellite/mode — Full or Luminance.satellite/clip_trail, satellite/skip_save, satellite/delete_original — the three behavior checkboxes.satellite/sensitivity — slider value as integer (1-50; divided by 100 to get the float threshold).Settings save on closeEvent and on every change via the dialog's save hook; folders are also saved after each successful chooser interaction so a crash mid-session preserves the folder selection for next launch.