Example #1
0
        private FitsHeader GetHeaderData()
        {
            if (Status != 0)
            {
                return(null);
            }

            var status = 0;

            var fitsHeader = new FitsHeader();

            var ndx = 1;

            while (true)
            {
                string keyName    = null;
                string keyValue   = null;
                string keyComment = null;

                CFits.ReadHeaderRecord(_fitsPointer, ndx++, ref keyName, ref keyValue, ref keyComment, ref status);

                if (status == (int)ErrorStatusCode.KEY_OUT_BOUNDS)
                {
                    break;
                }
                else if (status != 0)
                {
                    Status = status;
                    var errText = CFits.GetErrorStatus(status);

                    throw new Exception("FITS ReadHeaderRecord error - " + errText);
                }

                var keyUnits = "";

                ExtractUnits(ref keyUnits, ref keyComment);
                var item = new FitsHeaderItem(keyName, keyValue, keyUnits, keyComment);

                fitsHeader.Add(item);
            }

            Header = fitsHeader;

            return(fitsHeader);
        }
Example #2
0
 public static string GetErrorText(int status)
 {
     return(CFits.GetErrorStatus(status));
 }