Table of Contents

Class FitsFile

Namespace
FitsModel
Assembly
FitsModel.dll

A simple collection of FitsHdu objects.

public class FitsFile : List<FitsHdu>, IList<FitsHdu>, ICollection<FitsHdu>, IList, ICollection, IReadOnlyList<FitsHdu>, IReadOnlyCollection<FitsHdu>, IEnumerable<FitsHdu>, IEnumerable
Inheritance
FitsFile
Implements
Inherited Members

Constructors

FitsFile()

Creates a new FitsFile with a single primary FitsHdu.

public FitsFile()

FitsFile(FitsHdu)

Creates a new FitsFile with the specified primary FitsHdu.

public FitsFile(FitsHdu hdu)

Parameters

hdu FitsHdu

FitsFile(List<FitsHdu>)

Creates a new FitsFile with the specified HDUs.

public FitsFile(List<FitsHdu> hdus)

Parameters

hdus List<FitsHdu>

Exceptions

FitsModelException

Thrown if no HDUs are provided or the primary and extension HDUs are not valid.

Methods

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetFirstImageHdu()

Gets and validates the first image HDU in this file if it exists.

public FitsHdu? GetFirstImageHdu()

Returns

FitsHdu

The first image in this file. null otherwise.

GetHashCode()

public override int GetHashCode()

Returns

int

GetPrimaryHdu()

Gets and validates this file's primary HDU if it exists.

public FitsHdu? GetPrimaryHdu()

Returns

FitsHdu

The primary HDU for this file. null otherwise

ToString()

String representation of the number of FitsHdus in this file.

public override string ToString()

Returns

string

ValidateFile()

Val

public void ValidateFile()

Exceptions

FitsModelException

WriteToStream(FitsDataBlockStream)

Writes the contents of this FITS file to a FitsDataBlockStream and uses its cancellation token to stop writing if needed.

public Task WriteToStream(FitsDataBlockStream dataBlockStream)

Parameters

dataBlockStream FitsDataBlockStream

Returns

Task

WriteToStream(Stream)

Writes this FITS File to a stream.

public Task WriteToStream(Stream stream)

Parameters

stream Stream

Returns

Task

WriteToStream(Stream, CancellationToken)

Writes the contents of this FITS file to a stream until the cancellation token is triggered.

public Task WriteToStream(Stream stream, CancellationToken cancellationToken)

Parameters

stream Stream

The stream to write to.

cancellationToken CancellationToken

Use this to indicate when we can finish writing to the stream.

Returns

Task