Skip to content

Structural Overview

Jussi Saarivirta edited this page Aug 1, 2021 · 3 revisions

Overview

The standard way to use the solver library (outside CLI solving), is to add the library WatneyAstrometry.Core as a dependency to your project.

A few things to note here:

  • The core library does not rely on any specific image formats: instead it uses an IImage interface, and image readers are supposed to provide the image data as pixel buffer via that interface. Image readers (implementations for IImageReader) can also be registered to the Solver as IImage providers.
  • Basic image format support is provided by the optional WatneyAstrometry.ImageReaders library, which provides an IImageReader implementation that can handle JPG and PNG files. It's a separate library to not bring any additional dependencies to the core library.
  • The core library contains a simple FITS reader implementation (DefaultFitsReader) for reading monochrome FITS files out of the box. This was mainly included for testing purposes, but reads simple monochrome FITS files just fine. This can be replaced with a more advanced FITS reader by implementing the IImageReader interface.
  • Additionally a quad database (a set of binary-packed files) is needed to perform any solving.

Components

The core library is comprised of these main components:

  • Solver: the main solver, that handles the actual solving and utilizes the other components of the library.
  • DefaultStarDetector: the default implementation of the star detector. Detects stars from an image.
  • CompactQuadDatabase: a file-based database of quads built from catalog stars, in a compact form.
  • NearbySearchStrategy and BlindSearchStrategy: providers of search patterns, for searching nearby areas of a coordinate and for full sky blind search.
  • DefaultFitsReader: a simple implementation of a FITS reader that can process monochrome FITS images.

Overriding / custom implementations

It's possible to replace the default implementations DefaultStarDetector (and DefaultStarDetectionFilter), DefaultFitsReader and CompactQuadDatabase with your own, if you desire to do so. All of them implement interfaces (IStarDetector, IStarDetectionFilter, IImageReader, IQuadDatabase) and the implementations can be registered to the Solver using factory methods:

var solver = new Solver()
  .UseStarDetector(() => /* IStarDetector */ new DefaultStarDetector() { DetectionFilter = new DefaultStarDetectionFilter() })
  .UseQuadDatabase(() => /* IQuadDatabase */ new CompactQuadDatabase().UseDataSource("/path/to/quaddb"))
  .RemoveImageReader<DefaultFitsReader>() // removes the default .fit, .fits reader
  .UseImageReader<MyFancyFitsReader>() // add my own
  ;