Link Search Menu Expand Document

Design

The entry point to DeLaFits is the TFitsContainer class from the DeLaFitsClasses unit. TFitsContainer parses a TStream instance and stores a reference to it. After successfully parsing the stream, the container contains a list of HDUs, which are instances of the TFitsItem class. Each HDU includes both the header and data sections, which are instances of the TFitsItemHead and TFitsItemData classes.

class diagram: container

The HDU header consists of keyword records, and to work with them, you need to create instances of the TFitsCard class.

class diagram: card

HDU extensions are implemented in separate units as inheritors of the TFitsItem, TFitsItemHead, and TFitsItemData classes. Use the Container.ItemClasses[Index] property to set the specific HDU extension type.

IMAGE extension

The DeLaFitsImage unit contains the implementation of the IMAGE extension.

class diagram: image

The TFitsImageData class contains methods for working with the physical values of the extension data section.

class diagram: image values

The DeLaFitsPicture unit inherits the DeLaFitsImage unit classes and works with IMAGE extension data as an array of two-dimensional frames. This approach is convenient because observers often use two-dimensional SIFs to store optical observation results.

class diagram: picture

To read and write the physical values (pixels) of a frame and render it to a bitmap, create an instance of the TFitsFrame class.

class diagram: frame

TABLE extension

The DeLaFitsTable unit contains the implementation of the TABLE extension.

class diagram: table

The TFitsTableData class contains properties and methods for working with table records and fields, similar to well-known Delphi/Lazarus dataset components. TFitsField instances are created automatically but can be customized. They contain methods for reading and writing the physical values of the fields in the active table record.

class diagram: field

Exception

The EFitsException class is the base class for all DeLaFits exceptions. Each DeLaFits exception has Topic and Code properties to determine the exact cause of the error. DeLaFits uses unique exception classes to increase the verbosity of error messages.

class diagram: exception