Index: /trunk/Mars/mcore/FITS.h
===================================================================
--- /trunk/Mars/mcore/FITS.h	(revision 17775)
+++ /trunk/Mars/mcore/FITS.h	(revision 17776)
@@ -13,7 +13,78 @@
 
 #include <stdint.h>
+#include <string.h>
+
+#include <vector>
+#include <string>
+
+#ifndef __CINT__
+#include <unordered_set>
+#endif
 
 namespace FITS
 {
+    static inline bool IsReservedKeyWord(const std::string &key)
+    {
+#ifndef __CINT__
+        static const std::unordered_set<std::string> keys =
+        {
+            "DATASUM",  "END",      "EXTNAME",  "PCOUNT",   "NAXIS",
+            "NAXIS1",   "NAXIS2",   "RAWSUM",   "SIMPLE",   "TFIELDS",
+            "THEAP",    "XTENSION", "ZHEAPPTR", "ZNAXIS1",  "ZNAXIS2",
+            "ZPCOUNT",  "ZRATIO",   "ZSHRINK",  "ZTABLE",   "ZTILELEN",
+        };
+
+        static const std::unordered_set<std::string> short_keys =
+        {
+            "TFORM", "TUNIT", "TTYPE", "ZCTYP", "ZFORM",
+        };
+
+        if (keys.find(key)!=keys.end())
+            return true;
+
+        const std::string five = key.substr(0, 5);
+        return short_keys.find(five)!=short_keys.end();
+#endif
+    }
+
+    static inline std::string CommentFromType(char type)
+    {
+        std::string comment;
+
+        switch (type)
+        {
+        case 'L': comment = "[1-byte BOOL]";  break;
+        case 'A': comment = "[1-byte CHAR]";  break;
+        case 'B': comment = "[1-byte BOOL]";  break;
+        case 'I': comment = "[2-byte INT]";   break;
+        case 'J': comment = "[4-byte INT]";   break;
+        case 'K': comment = "[8-byte INT]";   break;
+        case 'E': comment = "[4-byte FLOAT]"; break;
+        case 'D': comment = "[8-byte FLOAT]"; break;
+        case 'Q': comment = "[var. Length]"; break;
+        }
+
+        return comment;
+    }
+
+    static inline uint32_t SizeFromType(char type)
+    {
+        size_t size = 0;
+
+        switch (type)
+        {
+        case 'L': 
+        case 'A': 
+        case 'B': size =  1; break;
+        case 'I': size =  2; break;
+        case 'J': 
+        case 'E': size =  4; break;
+        case 'K': 
+        case 'D': size =  8; break;
+        case 'Q': size = 16; break;
+        }
+
+        return size;
+    }
 
     //Identifier of the compression schemes processes
@@ -67,5 +138,6 @@
                                          ordering(o),
                                          numProcs(n)
-        {}
+        {
+        }
     } __attribute__((__packed__));
 #endif
