Index: trunk/FACT++/src/fitsdump.cc
===================================================================
--- trunk/FACT++/src/fitsdump.cc	(revision 12672)
+++ trunk/FACT++/src/fitsdump.cc	(revision 12674)
@@ -671,5 +671,6 @@
 
     int status = 0;
-    for (int i=1; i<=fTable->rows(); i++)
+    int endIndex = (fColMap.find("Time") == fColMap.end()) ? fTable->rows()-1 : fTable->rows();
+    for (int i=1; i<=endIndex; i++)
     {
         fits_read_tblbytes(fFile->fitsPointer(), i, 1, size, fitsBuffer, &status);
@@ -893,5 +894,5 @@
     for (unsigned int i=0;i<list.size();i++)
         totalSize += ranges[i].second - ranges[i].first;
-    cout << "Total size: " << totalSize << endl;
+ //   cout << "Total size: " << totalSize << endl;
     vector<QwtPlotCurve*> curves(totalSize);
     int ii=0;
@@ -941,12 +942,26 @@
       }
       //add the time column to the given columns
-      MyColumn* timeCol = static_cast<MyColumn*>(fColMap.find("Time")->second);
-      if (!timeCol)
+      if (fColMap.find("Time") == fColMap.end() && fColMap.find("UnixTimeUTC") == fColMap.end())
       {
           cerr << "Error: time column could not be found in given table. Aborting" << endl;
           return false;
       }
+      MyColumn* timeCol;
+      bool unixTime = false;
+      int endIndex = 0;
+      if (fColMap.find("Time") != fColMap.end())
+      {
+          timeCol = static_cast<MyColumn*>(fColMap.find("Time")->second);
+          ranges.push_back(make_pair(0,1));
+          endIndex = fTable->rows();
+      }
+      if (fColMap.find("UnixTimeUTC") != fColMap.end())
+      {
+          timeCol = static_cast<MyColumn*>(fColMap.find("UnixTimeUTC")->second);
+          ranges.push_back(make_pair(0,2));
+          endIndex = fTable->rows()-1;
+          unixTime = true;
+      }
       columns.push_back(timeCol);
-      ranges.push_back(make_pair(0,1));
       /////
       const int size = offsets[offsets.size()-1];
@@ -966,5 +981,6 @@
       yValues = new double[fTable->rows()];
 
-      for (int i=1; i<=fTable->rows(); i++)
+
+      for (int i=1; i<=endIndex; i++)
       {
           fits_read_tblbytes(fFile->fitsPointer(), i, 1, size, fitsBuffer, &status);
@@ -986,5 +1002,20 @@
 //              cout << (*it)[i-1] << " ";
           }
-          str >> yValues[i-1];
+          if (unixTime)
+          {
+              long u1, u2;
+              str >> u1 >> u2;
+ //             cout << u1 << " " << u2;
+              boost::posix_time::ptime unixTimeT( boost::gregorian::date(1970, boost::gregorian::Jan, 1),
+                      boost::posix_time::seconds(u1) +  boost::posix_time::microsec(u2));
+
+              Time mjdTime(unixTimeT);
+              yValues[i-1] = mjdTime.Mjd();
+ //             cout << " " << mjdTime.Mjd() << endl;
+          }
+          else
+          {
+              str >> yValues[i-1];
+          }
           if (i==1)
           {
@@ -999,5 +1030,5 @@
       auto jt = xValues.begin();
       for (auto it=curves.begin(); it != curves.end(); it++, jt++)
-          (*it)->setRawData(yValues, *jt, fTable->rows());
+          (*it)->setRawData(yValues, *jt, endIndex);
 
       QStack<QRectF> stack;
@@ -1033,6 +1064,11 @@
     a.exec();
 
+
     for (auto it = curves.begin(); it != curves.end(); it++)
+    {
+       (*it)->detach();
         delete *it;
+    }
+    grid->detach();
     for (auto it = xValues.begin(); it != xValues.end(); it++)
         delete[] *it;
