CassiniFlow is a modern, high-performance, cross-platform astrophotography preprocessing application built with .NET 10, C# 14, and Avalonia UI, with both a graphical interface and a command-line interface (CLI).
Designed as a modern alternative to traditional preprocessing tools such as PIPP, CassiniFlow handles large video streams, automatic planetary centering and stabilization, atmospheric seeing quality assessment, and low-memory frame selection. It also provides astrophotographic calibration and direct export to your favorite stacking applications, including AutoStakkert!, Siril, and RegiStax.
- SER (Lucam Recorder): High-speed 8-bit and 16-bit reading and writing (Mono, Bayer RAW, RGB), with precise per-frame UTC timestamp preservation (trailer timestamps).
- FITS (Flexible Image Transport System): Reading and exporting monochrome and color 16-bit astronomical FITS files.
- Universal Video Containers: High-speed decoding of AVI, MP4, MOV, and other formats through OpenCvSharp, with automatic fallback and transparent transcoding via the FFmpeg CLI engine.
- Standard Images: Image sequences and standard image formats (BMP, etc.).
- WinJUPOS Integration: Automatic generation of WinJUPOS-compatible filenames (
YYYY-MM-DD-HHMM_S-System) to facilitate subsequent planetary derotation.
-
Bayer Demosaicing (RAW Processing):
- Supports all standard Bayer patterns:
RGGB,BGGR,GBRG,GRBG. - Algorithms: Bilinear, HQ Linear, and Malvar-He-Cutler (gradient-corrected).
- Supports all standard Bayer patterns:
-
Planetary Detection & Centering:
- Automatic planetary limb detection and center of gravity (CoG) calculation.
- Automatic apparent diameter measurement in pixels (
PlanetSizeAnalyzer). - Automatic rotational alignment (
AutoRotationAligner). - Automatic rejection of empty, corrupted, or overexposed frames.
-
Atmospheric Seeing Quality Assessment & Frame Selection:
- Sharpness evaluation using gradient energy and Laplacian variance.
- Single-Pass Bounded Top-K Heap: Maintains RAM consumption below 900 MB, even when processing sequences containing more than 10,000 16-bit frames.
-
Dynamic or Fixed Cropping: Centered stabilization and cropping (e.g. 512×512, 800×800, or automatically adjusted to the planetary disk).
-
Astrophotographic Calibration:
- Master Dark subtraction.
- Master Flat division.
- Automatic hot pixel removal.
-
Processing Modes:
- Batch Mode: Automated file-by-file processing.
- Join Mode: Chronological concatenation of multiple consecutive video sequences into a single timestamped SER file.
-
CassiniFlow.Desktop: Modern and responsive graphical interface built with Avalonia 11:
- Real-time image viewer (
AstroViewerControl) featuring smooth zoom, pan, and centering crosshairs. - Native on-the-fly bilingual support (English / French).
- Preconfigured processing profiles (Jupiter, Saturn, Moon, Sun, etc.).
- Compatible with Windows and Linux (tested on Ubuntu / WSLg).
- Real-time image viewer (
-
CassiniFlow.Cli: Headless command-line executable, ideal for scripting pipelines and automating batch processing.
CassiniFlow follows Hexagonal Architecture (Ports & Adapters) and Domain-Driven Design (DDD) principles.
┌────────────────────────┐ ┌────────────────────────┐
│ CassiniFlow.Desktop │ │ CassiniFlow.Cli │
│ (Avalonia UI) │ │ (Console) │
└───────────┬────────────┘ └───────────┬────────────┘
│ │
▼ ▼
┌────────────────────────────────────────────────────────┐
│ CassiniFlow.Application │
│ Use Cases (RunPipeline, Preview, MeasurePlanet) │
│ Pipeline Step Pattern │
└───────────┬───────────────────────────────▲────────────┘
│ │
▼ │
┌────────────────────────┐ │
│ CassiniFlow.Domain │ │
│ (Pure, zero dependencies) │
│ AstroFrame, Centroid, │ │
│ QualityScore, Invariants │
└────────────────────────┘ │
│
┌───────────────────────────────────────────┴────────────┐
│ CassiniFlow.Infrastructure │
│ Codecs (SER, FITS), Adapters (OpenCV, FFmpeg CLI) │
│ Readers/Writers Factories, ProfileSerializer │
└────────────────────────────────────────────────────────┘
- Zero-Allocation Processing Loops: Extensive use of
Span<T>,ReadOnlySpan<T>,Memory<T>, andArrayPool<T>to process tens of gigabytes of video data while minimizing garbage collection (GC) pressure. - Cross-Platform: Native execution on Windows and Linux, supporting x64 and ARM64 architectures.
- .NET 10.0 SDK or later.
- (Optional, for MP4 and non-SER video streams): FFmpeg installed and available in your system
PATH.
Clone the repository and build the solution:
git clone https://github.com/cloud0259/CassiniFlow.git
cd CassiniFlow
dotnet build CassiniFlow.slnx -c Releasedotnet test CassiniFlow.slnxTo launch the application with its graphical interface:
dotnet run --project src/CassiniFlow.Desktop/CassiniFlow.Desktop.csproj -c Release
- Drag and drop your SER, FITS, or video files into the application.
- Select a predefined profile (e.g. Planetary, Solar/Lunar Surface, etc.) or customize your processing parameters.
- Preview centering and image quality using the interactive viewer.
- Click Start Processing to export the calibrated and stabilized result.
For headless processing or script-based automation:
dotnet run --project src/CassiniFlow.Cli/CassiniFlow.Cli.csproj -- [options]
-
Center Jupiter, crop to 512×512, and retain the top 25% highest-quality frames:
CassiniFlow.Cli -i "captures/jupiter_raw.ser" -o "output/" --center --crop 512,512 --quality-limit 25% --debayer RGGB
-
Stabilize a lunar crescent and export as a 16-bit SER file:
CassiniFlow.Cli -i "captures/moon.avi" -o "output/moon_stabilized.ser" --center --format ser16
-
Join Mode: Concatenate multiple sequences with automatic WinJUPOS-compatible naming:
CassiniFlow.Cli -i "captures/*.ser" --mode join -o "output/" --winjupos
Contributions are welcome!
If you would like to contribute to CassiniFlow:
- Fork the repository.
- Create a dedicated branch (
git checkout -b feat/new-feature). - Follow the project's coding conventions (Hexagonal Architecture, DDD,
dotnet format). - Write unit tests to validate your changes in
CassiniFlow.Tests. - Submit a detailed Pull Request.
This project is distributed under the permissive MIT License. See the LICENSE file for more details.