Index: trunk/Mars/mcore/fits.h
===================================================================
--- trunk/Mars/mcore/fits.h	(revision 17009)
+++ trunk/Mars/mcore/fits.h	(revision 17035)
@@ -463,4 +463,6 @@
             return it==cols.end() ? 0 : it->second.num;
         }
+	
+
 
         // There may be a gap between the main table and the start of the heap:
@@ -660,5 +662,6 @@
                 // Check for table name. Skip until eof or requested table are found.
                 // skip the current table?
-                if (!tableName.empty() && tableName!=fTable.Get<string>("EXTNAME"))
+                if ((!tableName.empty() &&         tableName!=fTable.Get<string>("EXTNAME")) ||
+                    ( tableName.empty() && "ZDrsCellOffsets"==fTable.Get<string>("EXTNAME")))
                 {
                     const streamoff skip = fTable.GetTotalBytes();
@@ -711,10 +714,37 @@
     fits(const string &fname, const string& tableName="", bool force=false) : izstream(fname.c_str())
     {
+        gLog << "Here..." <<endl;
         Constructor(fname, "", tableName, force);
+        if ((fTable.is_compressed && !force) ||
+            (fTable.name == "ZDrsCellOffsets" && !force))
+        {
+#ifdef __EXCEPTIONS
+            throw runtime_error("You are trying to read a compressed fits with the base fits class. Please use factfits instead.");
+#else
+            gLog << ___err___ << "ERROR - You are trying to read a compressed fits with the base fits class. Please use factfits instead." << endl;
+#endif
+            clear(rdstate()|ios::badbit);
+        }
     }
 
     fits(const string &fname, const string &fout, const string& tableName, bool force=false) : izstream(fname.c_str())
     {
+        gLog << "There..." << endl;
         Constructor(fname, fout, tableName, force);
+        if ((fTable.is_compressed && !force) ||
+            (fTable.name == "ZDrsCellOffsets" && !force))
+        {
+#ifdef __EXCEPTIONS
+            throw runtime_error("You are trying to read a compressed fits with the base fits class. Please use factfits instead.");
+#else
+            gLog << ___err___ << "ERROR - You are trying to read a compressed fits with the base fits class. Please use factfits instead." << endl;
+#endif
+            clear(rdstate()|ios::badbit);
+        }
+    }
+
+    fits() : izstream()
+    {
+
     }
 
@@ -999,5 +1029,5 @@
     }
 
-    size_t GetNumRows() const { return fTable.num_rows; }
+//    size_t GetNumRows() const { return fTable.num_rows; }
     size_t GetRow() const { return fRow==(size_t)-1 ? 0 : fRow; }
 
@@ -1011,4 +1041,14 @@
 
     bool IsCompressedFITS() const { return fTable.is_compressed;}
+
+    virtual size_t GetNumRows() const
+    {
+        return fTable.Get<size_t>("NAXIS2");
+    }
+
+    virtual size_t GetBytesPerRow() const
+    {
+        return fTable.Get<size_t>("NAXIS1");
+    }
 };
 
Index: trunk/Mars/mcore/zfits.h
===================================================================
--- trunk/Mars/mcore/zfits.h	(revision 17009)
+++ trunk/Mars/mcore/zfits.h	(revision 17035)
@@ -37,24 +37,26 @@
 
     // Basic constructor
-    zfits(const string& fname, const string& tableName="",
-          bool force=false) : fits(fname, tableName, force),
-        fNumTiles(0),
-        fNumRowsPerTile(0),
-        fCurrentRow(-1),
-        fHeapOff(0),
-        fTileSize(0)
-    {
+    zfits(const string& fname, const string& tableName="", bool force=false) : fits(),
+                                                                               fNumTiles(0),
+                                                                               fNumRowsPerTile(0),
+                                                                               fCurrentRow(-1),
+                                                                               fHeapOff(0),
+                                                                               fTileSize(0)
+    {
+        open(fname.c_str());
+        Constructor(fname, "", tableName, force);
         InitCompressionReading();
     }
 
     // Alternative contstructor
-    zfits(const string& fname, const string& fout, const string& tableName,
-          bool force=false) : fits(fname, fout, tableName, force),
-              fNumTiles(0),
-              fNumRowsPerTile(0),
-              fCurrentRow(-1),
-              fHeapOff(0),
-              fTileSize(0)
-    {
+    zfits(const string& fname, const string& fout, const string& tableName, bool force=false) : fits(),
+                                                                                                fNumTiles(0),
+                                                                                                fNumRowsPerTile(0),
+                                                                                                fCurrentRow(-1),
+                                                                                                fHeapOff(0),
+                                                                                                fTileSize(0)
+    {
+        open(fname.c_str());
+        Constructor(fname, fout, tableName, force);
         InitCompressionReading();
     }
@@ -83,4 +85,19 @@
         return fits::IsFileOk() && rawsum;
     };
+
+    size_t GetNumRows() const
+    {
+        if (fTable.is_compressed)
+            return fTable.Get<size_t>("ZNAXIS2");
+        else
+            return fTable.Get<size_t>("NAXIS2");
+    }
+    size_t GetBytesPerRow() const
+    {
+        if (fTable.is_compressed)
+            return fTable.Get<size_t>("ZNAXIS1");
+        else
+            return fTable.Get<size_t>("NAXIS1");
+    }
 
 protected:
