Index: /trunk/sql/create_table_s70.sql
===================================================================
--- /trunk/sql/create_table_s70.sql	(revision 122)
+++ /trunk/sql/create_table_s70.sql	(revision 123)
@@ -25,5 +25,6 @@
 	nchan INT,
 	scanlen DOUBLE,
-	tbin DOUBLE,
+	tsamp DOUBLE,
+	nbits INT,
 --	period DECIMAL(32,24),
 --	dm DECIMAL(16,10),
Index: /trunk/src/pvo-FITS-fileIO.cc
===================================================================
--- /trunk/src/pvo-FITS-fileIO.cc	(revision 122)
+++ /trunk/src/pvo-FITS-fileIO.cc	(revision 123)
@@ -102,5 +102,6 @@
 	newUT = block.getKeyword<std::string>(UT);
 	date   = block.getKeyword<std::string>(DATE);
-
+	//	std::cerr << date << " " << block.getKeyword<int>(BLK_CNTR) <<"\n";
+	
 	// if we have gone over midnight.
 	if(dmsToDec(this->UT_initial) > dmsToDec(newUT) ) 
@@ -466,4 +467,15 @@
       if(block.getSurveyType()==S70) src_name = block.getFieldID();
       else src_name = deblank(block.getKeyword<std::string>(PSRNAME));
+
+      std::vector<std::string> commentfields  = 
+	block.getFullKeyword<std::string>(COMMENT);
+      std::string comment;
+      if(commentfields.size()>0){
+	comment = commentfields[0];
+	for(int j=1;j<commentfields.size();j++) 
+	  comment += " " + commentfields[j];
+      }
+      comment = deblank(comment);
+      
       std::string coord_md = block.getCoordMode();
       std::string eq_str   = block.getEquinox();
@@ -543,4 +555,11 @@
       //    this->addNewKeywords(block);
 
+      if(PVO::addCommentString){
+	fits_write_comment(this->fptr, 
+			   "The following line is the COMMENT string from the original data file.", &status);
+	fits_write_comment(this->fptr, (char *)comment.c_str(), &status);
+//      this->updateKeyword("OBSNOTES", comment);
+      }
+
       delete [] todaysdate;
 
Index: /trunk/src/pvo-block.cc
===================================================================
--- /trunk/src/pvo-block.cc	(revision 122)
+++ /trunk/src/pvo-block.cc	(revision 123)
@@ -57,5 +57,6 @@
     {
       /**
-       * Read in the full set of header information into the headerString string.
+       * Read in the full set of header information into the
+       * headerString string.
        * \param file The file stream to read the block from.
        * \return False if the file is at eof, else read header and return true.
Index: /trunk/src/pvo-metadata.cc
===================================================================
--- /trunk/src/pvo-metadata.cc	(revision 122)
+++ /trunk/src/pvo-metadata.cc	(revision 123)
@@ -32,17 +32,23 @@
 
       int pos = this->filename.find("_");
+      std::string extension="";
       std::string surveyStr = this->filename.substr(0,pos);
-      if(surveyStr == "S70") this->survey = "S70";
-      else if(surveyStr == "PM") this->survey = "PM";
-      else if(surveyStr == "PH") this->survey = "PH";
-      else this->survey = nullString;
-
-      std::string file_loc = "";
+      size_t dot = this->filename.rfind('.');
+      if(dot!=std::string::npos) 
+	extension = this->filename.substr(dot,this->filename.size());
+      this->survey = nullString;
+      if(extension == ".sf"){
+	if(surveyStr == "S70") this->survey = "S70";
+	else if(surveyStr == "PM") this->survey = "PM";
+	else if(surveyStr == "PH") this->survey = "PH";
+      }
+
       int cwdSize=200;
       char *cwd = new char[200];
-      if(this->filename[0]!='/'){
-// 	this->fileloc = get_current_dir_name();
+      if(this->filename[0]!='/'){ 
+	// if the directory doesn't start with a /, it is the current
+	// directory.
 	getcwd(cwd,cwdSize);
-	file_loc=cwd;
+	this->fileloc = cwd;
 	this->fileloc += "/";
       }
@@ -101,9 +107,4 @@
       fitsfile.gotoHistory();
 
-      // TBIN in seconds.
-      if(fitsfile.readColumnValue("TBIN",1,&this->tbin)!=0) 
-	this->tbin = nullFloat;
-      if(!(this->tbin>0.)) this->tbin = nullFloat;
-
       if(fitsfile.readColumnValue("NCHAN",1,&this->nchan)!=0) 
 	this->nchan = nullInt;
@@ -113,4 +114,19 @@
 	this->chanbw = nullFloat;
       if(!(this->chanbw>0.)) this->chanbw = nullFloat;
+
+      ////////////////////
+      // From here, we get information from the SUBINT table.
+      fitsfile.gotoSubint();
+      // TSAMP in seconds.
+      //      if(fitsfile.readColumnValue("TBIN",1,&this->tbin)!=0) 
+      if(fitsfile.getKeyword<float>("TSAMP",this->tsamp)!=0) 
+	this->tsamp = nullFloat;
+      if(!(this->tsamp>0.)) this->tsamp = nullFloat;
+
+      // number of bits
+      if(fitsfile.getKeyword<int>("NBITS",this->nbits)!=0) 
+	this->nbits = nullInt;
+      if(!(this->nbits>0.)) this->nbits = nullInt;
+
 
     }
@@ -396,5 +412,7 @@
 	      << "NChan,"
 	      << "\"Scan length\","
-	      << "Tbin";	    
+	      << "Tsamp"
+	      << "Nbits";
+	    
       if(datalist[0].showSep())	fileout  << ",Offset\n";
       else fileout << "\n";
@@ -437,5 +455,6 @@
 		<< intToString(datalist[i].getNchan())      << ","
 		<< floatToString(datalist[i].getScanlen())  << ","
-		<< floatToString(datalist[i].getTbin());
+		<< floatToString(datalist[i].getTsamp())    << ","
+		<< intToString(datalist[i].getNbits());
 
 	if(datalist[0].showSep()) 
Index: /trunk/src/pvo-metadata.hh
===================================================================
--- /trunk/src/pvo-metadata.hh	(revision 122)
+++ /trunk/src/pvo-metadata.hh	(revision 123)
@@ -40,5 +40,5 @@
  Header Version The version of the PSRFITS definition used.\n\
  Survey         Which survey the data comes from:\n\
-                  left blank if not known or not a survey file.\n\
+                  left blank if not known or not a survey file (e.g. .rf files).\n\
  Source Name    The SRC_NAME FITS keyword (printed as SRC_NAME to screen).\n\
  RAJd           Right Ascension, in decimal degrees.\n\
@@ -53,5 +53,6 @@
  Nchan          Number of channels (from the HISTORY table).\n\
  Scan length    The SCANLEN keyword.\n\
- Tbin           Time per bin [ms] (from the HISTORY table).\n";
+ Tsam           Time per sample [ms] (from the SUBINT table).\n\
+ NBits          Number of bits per datum (from the SUBINT table).\n";
  
 
@@ -112,6 +113,8 @@
       float       getObsfreq(){return obsfreq;};
       void        setObsfreq(float f){obsfreq=f;};
-      float       getTbin(){return tbin;};
-      void        setTbin(float f){tbin=f;};
+      float       getTsamp(){return tsamp;};
+      void        setTsamp(float f){tsamp=f;};
+      int         getNbits(){return nbits;};
+      void        setNbits(int i){nbits=i;};
       float       getScanlen(){return scanlen;};
       void        setScanlen(float f){scanlen=f;};
@@ -148,6 +151,7 @@
       double      mjd;
       float       obsfreq;
-      float       tbin;
+      float       tsamp;
       float       scanlen;
+      int         nbits;
       int         nchan;
       float       chanbw;
Index: /trunk/src/pvo.hh
===================================================================
--- /trunk/src/pvo.hh	(revision 122)
+++ /trunk/src/pvo.hh	(revision 123)
@@ -13,4 +13,7 @@
   const std::string PVOCONESEARCH = "pvoconesearch";
   const std::string PVOTAPESUMMARY = "pvotapesummary";
+
+  /** flag to determine addition of the COMMENT string in the PHU */
+  const bool addCommentString = true;
 
   /** Standard NULL value for strings. */
Index: /trunk/src/pvotapesummary.cc
===================================================================
--- /trunk/src/pvotapesummary.cc	(revision 122)
+++ /trunk/src/pvotapesummary.cc	(revision 123)
@@ -103,5 +103,6 @@
     
   std::cout << std::setfill('-')  
-	    << std::setw(filenameSize+1+15+15+31+11+11+11+5) << "-";
+// 	    << std::setw(filenameSize+1+15+15+31+11+11+11+5) << "-";
+	    << std::setw(filenameSize+1+15+15+31+11+11+11+5+65) << "-";
 
   std::cout << "\n" << std::setfill(' ') 
@@ -113,5 +114,7 @@
 	    << std::setw(10)           << "SCANLEN"   << " "
 	    << std::setw(4)            << "MOVE"      << " "
-	    << std::setw(30)           << "DATE-OBS\n";
+// 	    << std::setw(30)           << "DATE-OBS\n";
+	    << std::setw(30)           << "DATE-OBS"  << " "
+	    << std::setw(64)           << "COMMENT\n";
      
   std::cout << std::setw(filenameSize) << ""      << " "
@@ -121,9 +124,12 @@
 	    << std::setw(10)           << "[MHz]" << " "
 	    << std::setw(10)           << "[s]"   << " "
-	    << std::setw(4)            << ""      <<" "
-	    << std::setw(30)           << "\n";
+	    << std::setw(4)            << ""      << " "
+// 	    << std::setw(30)           << "\n";
+ 	    << std::setw(30)           << ""      << " "
+ 	    << std::setw(30)           << "\n";
 
   std::cout<< std::setfill('-')  
-	   << std::setw(filenameSize+1+15+15+31+11+11+11+5) << "-";
+// 	   << std::setw(filenameSize+1+15+15+31+11+11+11+5) << "-";
+	   << std::setw(filenameSize+1+15+15+31+11+11+11+5+65) << "-";
   std::cout<< "\n"<< std::setfill(' ') ;
     
@@ -145,4 +151,11 @@
     double nc            = block.getKeyword<double>(NCHAN);
     float obsfreq        = f0 + ((nc-1)/2.) * bw;
+    std::vector<std::string> commentfields  = block.getFullKeyword<std::string>(COMMENT);
+    std::string comment;
+    if(commentfields.size()>0){
+      comment = commentfields[0];
+      for(int j=1;j<commentfields.size();j++) 
+	comment += " " + commentfields[j];
+    }
 
     std::cout.setf(std::ios::fixed);
@@ -155,5 +168,7 @@
 	      << std::setw(10)           << scanlen     << " "
 	      << std::setw(4)            << move        << " " 
-	      << std::setw(30)           << date_obs    << "\n";
+// 	      << std::setw(30)           << date_obs    << "\n";
+	      << std::setw(30)           << date_obs    << " "
+	      << std::setw(64)           << comment     << "\n";
 
     fin.close();
