Table of Contents

Class FitsValueWriterBase

Namespace
FitsModel.FitsStream.Writer
Assembly
FitsModel.dll

Base class for processing values from FitsDataBlocks.

public abstract class FitsValueWriterBase : DataBlockWriterBase, IFitsDataBlockWriter, IFitsValueWriter
Inheritance
FitsValueWriterBase
Implements
Derived
Inherited Members

Constructors

FitsValueWriterBase(BitPix, bool, bool)

Base class for processing values from FitsDataBlocks.

protected FitsValueWriterBase(BitPix bitsPerPixel, bool calculateStats = false, bool accumulateValues = false)

Parameters

bitsPerPixel BitPix

Number of bits used for each data value.

calculateStats bool

If true, statistics will be calculated as values are read.

accumulateValues bool

If true, values will be stored for future processing.

Properties

AccumulateValues

If true, values should be stored for future processing.

public bool AccumulateValues { get; }

Property Value

bool

BitsPerPixel

Gets the number of bits used to represent each value in the FitsDataBlock.

public BitPix BitsPerPixel { get; }

Property Value

BitPix

CalculateStats

If true, statistics should be calculated as values are read.

public bool CalculateStats { get; }

Property Value

bool

NumValues

Number of values expected to be read. This prevents us from reading padding data from FitsDataBlocks.

public abstract long NumValues { get; }

Property Value

long

Methods

CreateValueWriter(BitPix, long, bool, bool)

Creates an instance of a FitsValueWriterBase that is appropriate for the specified bitPix value and the given number of values.

public static FitsValueWriterBase CreateValueWriter(BitPix bitPix, long numValues, bool calculateStats, bool accumulateValues)

Parameters

bitPix BitPix

The BitPix value that determines the data type of the writer to create.

numValues long

The number of values the writer will handle. Must be a non-negative value.

calculateStats bool

If true, statistics will be calculated as values are read.

accumulateValues bool

If true, values will be stored for future processing.

Returns

FitsValueWriterBase

CreateValueWriter(FitsHeader, bool, bool)

Creates a value writer for handling FITS data based on the specified header and options.

public static FitsValueWriterBase CreateValueWriter(FitsHeader header, bool calculateStats, bool accumulateValues)

Parameters

header FitsHeader

The FITS header containing metadata such as bits per pixel and the number of pixels.

calculateStats bool

A value indicating whether the writer should calculate statistical information, such as min and max values, during processing.

accumulateValues bool

A value indicating whether the writer should accumulate pixel values for further processing or analysis.

Returns

FitsValueWriterBase

A FitsValueWriterBase instance configured to process FITS data according to the specified header and options.

SetEndianess(byte[])

Converts the given byte array to the local machine's endianess if necessary.

public static void SetEndianess(byte[] bytes)

Parameters

bytes byte[]