Table of Contents

Class PreviewGenerator

Namespace
FitsModel.FitsStream.Imager
Assembly
FitsModel.dll

Reads a stream and generates preview images for any image HDUs in encountered.

public class PreviewGenerator : DataBlockWriterBase, IFitsDataBlockWriter, IFitsHduReader
Inheritance
PreviewGenerator
Implements
Inherited Members

Constructors

PreviewGenerator()

Creates a new FitsFile that includes an additional HDU for each image HDU. The data contains normalized pixel byte values based on basic statistical values.

public PreviewGenerator()

PreviewGenerator(double, double)

public PreviewGenerator(double normMin, double normMax)

Parameters

normMin double
normMax double

Properties

NormMax

If set, these values will be used for normalization instead of the default of mean +/- stddev.

public double NormMax { get; }

Property Value

double

NormMin

If set, these values will be used for normalization instead of the default of mean +/- stddev.

public double NormMin { get; }

Property Value

double

Methods

GetFitsFile()

Returns the FITS file that has been read from the stream. Throws an exception if no file has been read.

public FitsFile GetFitsFile()

Returns

FitsFile

Exceptions

FitsModelException

GetPreviewFitsFile()

Gets a new FitsFile containing only the preview HDUs.

public FitsFile GetPreviewFitsFile()

Returns

FitsFile

ReadHdu(FitsHdu)

Called when an HDU is read from the FITS stream.

public void ReadHdu(FitsHdu hdu)

Parameters

hdu FitsHdu

SaveFits(FileInfo)

Saves the currently read FITS file to the specified file path. Throws an exception if no file has been read.

public Task SaveFits(FileInfo fileInfo)

Parameters

fileInfo FileInfo

Returns

Task

SaveImage(FileInfo, bool)

Saves the preview image to the provided file path.

public void SaveImage(FileInfo file, bool forceCrossPlat = false)

Parameters

file FileInfo
forceCrossPlat bool

If true, forces the use of cross-platform image saving methods.

WriteDataBlock(FitsDataBlock)

Called to write a data block from the FITS stream.

public override void WriteDataBlock(FitsDataBlock dataBlock)

Parameters

dataBlock FitsDataBlock