Class FitsReaderOptions
Options for reading FITS.
public sealed record FitsReaderOptions : ReaderOptions, IEquatable<ReaderOptions>, IEquatable<FitsReaderOptions>
- Inheritance
-
FitsReaderOptions
- Implements
- Inherited Members
Examples
// ZScale shows faint detail the way astronomy viewers do; Asinh lifts the faint end and keeps the bright one.
using Raster zscale = Raster.Load("m51.fits", context, new FitsReaderOptions { Stretch = FitsStretch.ZScale });
// None keeps the physical values (BSCALE and BZERO applied, blanks as NaN) for measuring.
using Raster<GrayF32> values = Raster.Load<GrayF32>("m51.fits", context, new FitsReaderOptions { Stretch = FitsStretch.None });
// The header, and the values that became black and white, are in the details.
if (zscale.Metadata.FormatDetails is FitsDetails fits)
{
Console.WriteLine($"{fits.Header.GetString("OBJECT")}: BITPIX {fits.Bitpix}, {fits.StretchLow} to {fits.StretchHigh}");
}
// A three-plane cube as one RGB image instead of three gray ones.
using Raster colour = Raster.Load("m51-rgb.fits", context, new FitsReaderOptions { Rgb = true });
Properties
Default
Gets the default options.
public static FitsReaderOptions Default { get; }
Property Value
Image
Gets which image to read, from 0, in the order LoadAll gives them: each image HDU in turn, and each plane of a cube. null (the default) reads the first.
public int? Image { get; init; }
Property Value
- int?
Exceptions
- ArgumentOutOfRangeException
The value is negative.
Rgb
Gets whether a cube of three planes reads as one RGB image (red, green, blue) rather than three gray ones, all three stretched alike. Defaults to false.
public bool Rgb { get; init; }
Property Value
Stretch
Gets how the physical values become a picture. Defaults to MinMax.
public FitsStretch Stretch { get; init; }