Index: trunk/FACT++/src/fitsCompressor.cc
===================================================================
--- trunk/FACT++/src/fitsCompressor.cc	(revision 17672)
+++ trunk/FACT++/src/fitsCompressor.cc	(revision 17674)
@@ -19,29 +19,4 @@
 
 using namespace std;
-
-typedef struct TileHeader
-{
-  char     id[4];
-  uint32_t numRows;
-  uint64_t size;
-  TileHeader(uint32_t nRows=0,
-             uint64_t s=0) : id({'T', 'I', 'L', 'E'}),
-                             numRows(nRows),
-                             size(s)
-  { };
-} __attribute__((__packed__)) TileHeader;
-
-typedef struct BlockHeader
-{
-    uint64_t      size;
-    char          ordering;
-    unsigned char numProcs;
-    BlockHeader(uint64_t      s=0,
-                char          o=zfits::kOrderByRow,
-                unsigned char n=1) : size(s),
-                                     ordering(o),
-                                     numProcs(n)
-    {}
-} __attribute__((__packed__)) BlockHeader;
 
 class CompressedFitsFile
@@ -1200,5 +1175,5 @@
         switch (_columns[i].getColumnOrdering())//getCompression())
         {
-            case zfits::kOrderByRow:
+            case FITS::kOrderByRow:
                 for (uint32_t k=0;k<thisRoundNumRows;k++)
                 {//regular, "semi-transposed" copy
@@ -1208,5 +1183,5 @@
             break;
 
-            case zfits::kOrderByCol :
+            case FITS::kOrderByCol :
                 for (int j=0;j<_columns[i].numElems();j++)
                     for (uint32_t k=0;k<thisRoundNumRows;k++)
@@ -1348,13 +1323,13 @@
             switch (sequence[j])
             {
-                case zfits::kFactRaw:
+                case FITS::kFactRaw:
 //                    if (head.numProcs == 1)
                         compressedOffset += compressUNCOMPRESSED(&(_compressedBuffer[threadIndex][compressedOffset]), &(_transposedBuffer[threadIndex][offset]), thisRoundNumRows, _columns[i].sizeOfElems(), _columns[i].numElems());
                 break;
-                case zfits::kFactSmoothing:
+                case FITS::kFactSmoothing:
                         applySMOOTHING(&(_compressedBuffer[threadIndex][compressedOffset]), &(_transposedBuffer[threadIndex][offset]), thisRoundNumRows, _columns[i].sizeOfElems(), _columns[i].numElems());
                 break;
-                case zfits::kFactHuffman16:
-                    if (head.ordering == zfits::kOrderByCol)
+                case FITS::kFactHuffman16:
+                    if (head.ordering == FITS::kOrderByCol)
                         compressedOffset += compressHUFFMAN(&(_compressedBuffer[threadIndex][compressedOffset]), &(_transposedBuffer[threadIndex][offset]), thisRoundNumRows, _columns[i].sizeOfElems(), _columns[i].numElems());
                     else
@@ -1368,5 +1343,5 @@
 
         //check if compressed size is larger than uncompressed
-        if (sequence[0] != zfits::kFactRaw &&
+        if (sequence[0] != FITS::kFactRaw &&
             compressedOffset - previousOffset > _columns[i].sizeOfElems()*_columns[i].numElems()*thisRoundNumRows+sizeof(BlockHeader)+sizeof(uint16_t)*sequence.size())
         {//if so set flag and redo it uncompressed
@@ -1377,7 +1352,7 @@
             he.size = compressedOffset - previousOffset;
             he.numProcs = 1;
-            he.ordering = zfits::kOrderByRow;
+            he.ordering = FITS::kOrderByRow;
             memcpy(&(_compressedBuffer[threadIndex][previousOffset]), (char*)(&he), sizeof(BlockHeader));
-            _compressedBuffer[threadIndex][previousOffset+sizeof(BlockHeader)] = zfits::kFactRaw;
+            _compressedBuffer[threadIndex][previousOffset+sizeof(BlockHeader)] = FITS::kFactRaw;
             offset += thisRoundNumRows*_columns[i].sizeOfElems()*_columns[i].numElems();
            _catalog[currentCatalogRow][i].first = compressedOffset - _catalog[currentCatalogRow][i].second;
@@ -1580,5 +1555,5 @@
             return -1;
         }
-        fileNameOut = fileNameIn.substr(0, pos) + ".fz";
+        fileNameOut = fileNameIn + ".fz";
     }
 
@@ -1710,10 +1685,10 @@
         //get header structures
         BlockHeader rawHeader;
-        BlockHeader smoothmanHeader(0, zfits::kOrderByRow, 2);
+        BlockHeader smoothmanHeader(0, FITS::kOrderByRow, 2);
         vector<uint16_t> rawProcessings(1);
-        rawProcessings[0] = zfits::kFactRaw;
+        rawProcessings[0] = FITS::kFactRaw;
         vector<uint16_t> smoothmanProcessings(2);
-        smoothmanProcessings[0] = zfits::kFactSmoothing;
-        smoothmanProcessings[1] = zfits::kFactHuffman16;
+        smoothmanProcessings[0] = FITS::kFactSmoothing;
+        smoothmanProcessings[1] = FITS::kFactHuffman16;
 //        smoothmanProcessings[2] = FACT_RAW;
 
