Index: /trunk/FACT++/src/Fits.cc
===================================================================
--- /trunk/FACT++/src/Fits.cc	(revision 12276)
+++ /trunk/FACT++/src/Fits.cc	(revision 12277)
@@ -56,6 +56,7 @@
 //! @param dataPointer the memory location where the DIM data starts
 //! @param numDataBytes the number of bytes taken by the DIM data. 
+//! @param out Message object to use for propagating messages
 //	
-void Fits::InitDataColumns(const vector<Description> &desc, const vector<string>& dataFormat, void* dataPointer)
+void Fits::InitDataColumns(const vector<Description> &desc, const vector<string>& dataFormat, void* dataPointer, MessageImp* out)
 {
     fDataFormats = dataFormat;
@@ -63,11 +64,34 @@
 
     //we will copy this information here. It duplicates the data, which is not great, but it is the easiest way of doing it right now
-    if (desc.size() == dataFormat.size())
-    {
-        fDataColDesc = desc;
+    if ((desc.size() == dataFormat.size()+1) || //regular service
+        (desc.size() == dataFormat.size()+2))//service with ending string. skipped in fits
+    {//services have one (or two) more description than columns. skip the first entry while copying as it describes the table itself.
+        fDataColDesc.clear();
+        for (unsigned int i=0;i<dataFormat.size(); i++)
+        {
+            string name = desc[i+1].name;
+            if (name.length() > 68) name = name.substr(0, 68);
+            string comment = desc[i+1].comment;
+            if (comment.length() > 68) comment = comment.substr(0,68);
+            string unit = desc[i+1].unit;
+            if (unit.length() > 68)  unit = comment.substr(0,68);
+            fDataColDesc.push_back(Description(name, comment, unit));
+        }
         return;
     }
 
+    {//if we arrived here, this means that the columns descriptions could not be parsed
+        ostringstream str;
+        str << "Expected " << dataFormat.size() << " descriptions of columns, got " << desc.size()-1 << " for service: ";
+        if (desc.size() > 0)
+            str << desc[0].name;
+        else
+            str << "<unknown>";
+
+        out->Warn(str.str());
+    }
+
     fDataColDesc.clear();
+ //   fDataColDesc.push_back(Description("service", "comment", "unit"));
     for (unsigned int i=0;i<dataFormat.size();i++)
     {
@@ -133,5 +157,5 @@
             name = stt.str();
         }
-
+//cout << endl << "#####adding column: " << name << " " << fDataFormats[i] << " " << fDataColDesc[i].unit << endl << endl;
         fFile->AddColumn(name, fDataFormats[i], fDataColDesc[i].unit);
     }
@@ -249,4 +273,6 @@
         fFile->WriteKeyNT("TSTART", Time(doubleValue).Iso(),
                           "Time of the first received data");
+        fFile->WriteKeyNT("TSTOP", Time(fEndMjD).Iso(),
+                          "Time of the last receied data");
     }
     fEndMjD = *reinterpret_cast<double*>(fStandardPointers[0]);
Index: /trunk/FACT++/src/Fits.h
===================================================================
--- /trunk/FACT++/src/Fits.h	(revision 12276)
+++ /trunk/FACT++/src/Fits.h	(revision 12277)
@@ -78,5 +78,5 @@
 
     ///Adds columns specific to the service being logged.
-    void InitDataColumns(const vector<Description> &desc, const vector<string>& dataFormat, void* dataPointer);
+    void InitDataColumns(const vector<Description> &desc, const vector<string>& dataFormat, void* dataPointer, MessageImp* out);
 
     ///Opens a FITS file
Index: /trunk/FACT++/src/datalogger.cc
===================================================================
--- /trunk/FACT++/src/datalogger.cc	(revision 12276)
+++ /trunk/FACT++/src/datalogger.cc	(revision 12277)
@@ -645,5 +645,5 @@
     ostringstream str;
 
-    const Time ftime(time-boost::posix_time::hours(12));
+    const Time ftime(time);//removed this as already done by nightAsInt: -boost::posix_time::hours(12));
     str << ftime.NightAsInt();
 
@@ -811,6 +811,5 @@
      fNumSubAndFits = new DimDescribedService(GetName() + "/NUM_SUBS", "I:2", fNumSubAndFitsData,
                                "Shows number of services to which the data logger is currently subscribed and the total number of open files."
-                               "|Subscriptions[int]:number of dim services to which the data logger is currently subscribed."
-                               "|NumOpenFiles[int]:number of files currently open by the data logger");
+                               "|NumSubAndNumOpenFiles[int]:number of dim services to which the data logger is currently subscribed plus number of files currently open by the data logger");
 
      //services parameters
@@ -1851,6 +1850,6 @@
     const vector<string> dataFormatsLocal = sub.fConv->GetFitsFormat();
 
-    sub.nightlyFile.InitDataColumns(GetDescription(sub.server, sub.service), dataFormatsLocal, sub.dimInfo->getData());
-    sub.runFile.InitDataColumns(GetDescription(sub.server, sub.service), dataFormatsLocal, sub.dimInfo->getData());
+    sub.nightlyFile.InitDataColumns(GetDescription(sub.server, sub.service), dataFormatsLocal, sub.dimInfo->getData(), this);
+    sub.runFile.InitDataColumns(GetDescription(sub.server, sub.service), dataFormatsLocal, sub.dimInfo->getData(), this);
     sub.fitsBufferAllocated = true;
 }
