Class FitsValueWriter<T>
- Namespace
- FitsModel.FitsStream.Writer
- Assembly
- FitsModel.dll
Parses FitsDataBlocks into a list of values of type T
.
public abstract class FitsValueWriter<T> : FitsValueWriterBase, IFitsDataBlockWriter, IFitsValueWriter where T : INumber<T>
Type Parameters
T
Data type that is used to represent values in a FitsDataBlock
- Inheritance
-
FitsValueWriter<T>
- Implements
- Derived
- Inherited Members
Constructors
FitsValueWriter(BitPix, long, bool, bool)
public FitsValueWriter(BitPix bitsPerPixel, long numValues, bool calculateStats = false, bool accumulateValues = false)
Parameters
bitsPerPixel
BitPixNumber of bits used to represent each value in the FitsDataBlock
numValues
longTotal number of values expected to be read.
calculateStats
boolIf true, statistics will be calculated as values are read.
accumulateValues
boolIf true, values will be stored for future processing.
Properties
DataStats
If CalculateStats is true, contains statistics about the values read so far.
public FitsDataStats DataStats { get; }
Property Value
NumValues
Number of values expected to be read. This prevents us from reading padding data from FitsDataBlocks.
public override long NumValues { get; }
Property Value
Values
Collection of values parsed from the data blocks.
public List<T> Values { get; }
Property Value
- List<T>
Methods
AddValueReader(IFitsValueReader<T>)
Adds a IFitsValueReader<T> instance that will be called each time a value is parsed from a data block.
public void AddValueReader(IFitsValueReader<T> reader)
Parameters
reader
IFitsValueReader<T>Reader that will process values as they are written.
ParseValue(byte[])
Parses a single value from the given byte array. Data is expected to be in the local machine's endianess.
protected abstract T ParseValue(byte[] bytes)
Parameters
bytes
byte[]Raw byte data for a single value in the local machine's endianess.
Returns
- T
WriteDataBlock(FitsDataBlock)
Parses the dataBlock
into values of type T
and adds them to the Values collection.
public override void WriteDataBlock(FitsDataBlock dataBlock)
Parameters
dataBlock
FitsDataBlockRaw value data in big-endian format.