public Bitmap DecodeSingleFrame(Stream stream)
{
FITSImageInfo imageInfo = ReadHeader(stream);
// check if there any image frame
if (imageInfo.TotalFrames == 0)
{
throw new ArgumentException("The FITS stream does not contain any image in main section.");
}
// read and return first frame
return ReadImageFrame(stream, imageInfo);
}