21 #include <unordered_set> 29 static const std::unordered_set<std::string> keys =
31 "DATASUM",
"END",
"EXTNAME",
"PCOUNT",
"NAXIS",
32 "NAXIS1",
"NAXIS2",
"RAWSUM",
"SIMPLE",
"TFIELDS",
33 "THEAP",
"XTENSION",
"ZHEAPPTR",
"ZNAXIS1",
"ZNAXIS2",
34 "ZPCOUNT",
"ZRATIO",
"ZSHRINK",
"ZTABLE",
"ZTILELEN",
37 static const std::unordered_set<std::string> short_keys =
39 "TFORM",
"TUNIT",
"TTYPE",
"ZCTYP",
"ZFORM",
42 if (keys.find(key)!=keys.end())
45 const std::string five = key.substr(0, 5);
46 return short_keys.find(five)!=short_keys.end();
56 case 'L': comment =
"[1-byte BOOL]";
break;
57 case 'A': comment =
"[1-byte CHAR]";
break;
58 case 'B': comment =
"[1-byte BOOL]";
break;
59 case 'I': comment =
"[2-byte INT]";
break;
60 case 'J': comment =
"[4-byte INT]";
break;
61 case 'K': comment =
"[8-byte INT]";
break;
62 case 'E': comment =
"[4-byte FLOAT]";
break;
63 case 'D': comment =
"[8-byte FLOAT]";
break;
64 case 'Q': comment =
"[var. Length]";
break;
78 case 'B': size = 1;
break;
79 case 'I': size = 2;
break;
81 case 'E': size = 4;
break;
83 case 'D': size = 8;
break;
84 case 'Q': size = 16;
break;
121 uint64_t s) : id{
'T',
'I',
'L',
'E'},
137 unsigned char n=1) : size(s),
152 : sequence(seq), header(0, order, seq.size())
157 : sequence(1), header(0, order, 1)
159 sequence[0] = compression;
162 #ifdef __MARS__ // needed for CINT 166 sequence[0] = compression;
static bool IsReservedKeyWord(const std::string &key)
struct FITS::Compression __attribute__
RowOrdering_t getOrdering() const
std::vector< uint16_t > sequence
void Memcpy(char *dest) const
BlockHeader(uint64_t s=0, char o=kOrderByRow, unsigned char n=1)
uint32_t getSizeOnDisk() const
uint16_t getNumProcs() const
static uint32_t SizeFromType(char type)
CompressionProcess_t getProc(uint32_t i) const
Compression(const CompressionProcess_t &compression=kFactRaw, const RowOrdering_t &order=kOrderByCol)
Compression(const std::vector< uint16_t > &seq, const RowOrdering_t &order=kOrderByCol)
static std::string CommentFromType(char type)
void SetBlockSize(uint64_t size)