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
BitPixNumber of bits used for each data value.
calculateStats
boolIf true, statistics will be calculated as values are read.
accumulateValues
boolIf 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
BitsPerPixel
Gets the number of bits used to represent each value in the FitsDataBlock.
public BitPix BitsPerPixel { get; }
Property Value
CalculateStats
If true, statistics should be calculated as values are read.
public bool CalculateStats { get; }
Property Value
NumValues
Number of values expected to be read. This prevents us from reading padding data from FitsDataBlocks.
public abstract long NumValues { get; }
Property Value
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
BitPixThe BitPix value that determines the data type of the writer to create.
numValues
longThe number of values the writer will handle. Must be a non-negative value.
calculateStats
boolIf true, statistics will be calculated as values are read.
accumulateValues
boolIf true, values will be stored for future processing.
Returns
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
FitsHeaderThe FITS header containing metadata such as bits per pixel and the number of pixels.
calculateStats
boolA value indicating whether the writer should calculate statistical information, such as min and max values, during processing.
accumulateValues
boolA 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[]