Index: /trunk/src/PSRFits.cc
===================================================================
--- /trunk/src/PSRFits.cc	(revision 27)
+++ /trunk/src/PSRFits.cc	(revision 28)
@@ -115,82 +115,4 @@
  //--------------------------------------------------------------------------
   
-  void PSRFits::addNewKeywords(DataBlock &block)
-  {
-    /**
-     *   Adds new keywords to the PHU that have not yet been added into the 
-     *   PSRFITS definition.
-     *   Need to be in the PHU before calling this function.
-     */
-
-    int status = 0;
-    
-    // OBSFREQ
-    double f0 = block.getKeyword<double>(FREQ_CHAN1);
-    double bw = block.getKeyword<double>(CHANBW);
-    double nc = block.getKeyword<double>(NCHAN);
-    float fcent = f0 + ((nc+1)/2.) * (bw/nc);
-    fits_update_key(this->fptr, TFLOAT, "OBSFREQ", &fcent, 
-		    "[MHz] Observing frequency", &status);
-    if(status) FITSError("PSRFits::addNewKeywords 1", status);
-
-    // RA
-    std::string ra  = deblank(block.getKeyword<std::string>(RA));
-    status = 0;
-    fits_update_key(this->fptr, TSTRING, "RA", (char *)ra.c_str(),
-		    "Right Ascension", &status);
-    if(status) FITSError("PSRFits::addNewKeywords 2", status);
-
-    // DEC
-    std::string dec = deblank(block.getKeyword<std::string>(DEC));
-    status = 0;
-    fits_update_key(this->fptr, TSTRING, "Dec", (char *)dec.c_str(),
-		    "Declination", &status);
-    if(status) FITSError("PSRFits::addNewKeywords 3", status);
-    
-    // DATE-OBS
-    std::string dateobs = deblank(block.getKeyword<std::string>(DATE));
-    if(dateobs[0] == '0') dateobs = "20" + dateobs;
-    else                  dateobs = "19" + dateobs;
-    for(int i=0;i<dateobs.size();i++) if(dateobs[i]=='/') dateobs[i]='-';
-    dateobs += "T" + deblank(block.getKeyword<std::string>(UT));
-    dateobs = dateobs.substr(0, dateobs.size()-7);
-    status = 0;
-    fits_update_key(this->fptr, TSTRING, "DATE-OBS", (char *)dateobs.c_str(),
-		    "Date of observation (YY-MM-DDThh:mm:ss UTC)", &status);
-    if(status) FITSError("PSRFits::addNewKeywords 4", status);
-
-    // EQUINOX
-    std::string equinox_str = block.getEquinox();
-    if(equinox_str == Block::eq_b1950 || equinox_str == Block::eq_j2000){
-      float equinox;
-      if(equinox_str == Block::eq_b1950) equinox = 1950.;
-      else equinox = 2000.;
-      status = 0;
-      fits_update_key(this->fptr, TFLOAT, "EQUINOX", &equinox,
-		      "Equinox", &status);
-      if(status) FITSError("PSRFits::addNewKeywords 5", status);
-    }
-
-    // BEAM INFORMATION
-    float fval;
-    // BMAJ
-    fval = block.Survey().getBmaj();
-    status = 0;
-    fits_update_key(this->fptr, TFLOAT, "BMAJ", &fval, "", &status);
-    if(status) FITSError("PSRFits::addNewKeywords 6", status);
-    // BMIN
-    fval = block.Survey().getBmin();
-    status = 0;
-    fits_update_key(this->fptr, TFLOAT, "BMIN", &fval, "", &status);
-    if(status) FITSError("PSRFits::addNewKeywords 7", status);
-    // BPA
-    fval = block.Survey().getBpa();
-    status = 0;
-    fits_update_key(this->fptr, TFLOAT, "BPA", &fval, "", &status);
-    if(status) FITSError("PSRFits::addNewKeywords 8", status);
-    
-  }
- //--------------------------------------------------------------------------
-  
   int PSRFits::closeFile()
   {
Index: /trunk/src/PSRFits_fileIO.cc
===================================================================
--- /trunk/src/PSRFits_fileIO.cc	(revision 27)
+++ /trunk/src/PSRFits_fileIO.cc	(revision 28)
@@ -155,6 +155,5 @@
 
     // define the DAT_FREQ array;
-    float deltaFreq = block.getKeyword<float>(CHANBW) / 
-      float(this->subintTable.nch_file);
+    float deltaFreq = block.getKeyword<float>(CHANBW);
     this->subintTable.dat_freq = new float[this->subintTable.nch_file];
     this->subintTable.dat_freq[0] = block.getKeyword<float>(FREQ_CHAN1);
@@ -490,4 +489,82 @@
   }
  //--------------------------------------------------------------------------
+  
+  void PSRFits::addNewKeywords(DataBlock &block)
+  {
+    /**
+     *   Adds new keywords to the PHU that have not yet been added into the 
+     *   PSRFITS definition.
+     *   Need to be in the PHU before calling this function.
+     */
+
+    int status = 0;
+    
+    // OBSFREQ
+    double f0 = block.getKeyword<double>(FREQ_CHAN1);
+    double bw = block.getKeyword<double>(CHANBW);
+    double nc = block.getKeyword<double>(NCHAN);
+    float fcent = f0 + ((nc-1)/2.) * bw;
+    fits_update_key(this->fptr, TFLOAT, "OBSFREQ", &fcent, 
+		    "[MHz] Observing frequency", &status);
+    if(status) FITSError("PSRFits::addNewKeywords 1", status);
+
+    // RA
+    std::string ra  = deblank(block.getKeyword<std::string>(RA));
+    status = 0;
+    fits_update_key(this->fptr, TSTRING, "RA", (char *)ra.c_str(),
+		    "Right Ascension", &status);
+    if(status) FITSError("PSRFits::addNewKeywords 2", status);
+
+    // DEC
+    std::string dec = deblank(block.getKeyword<std::string>(DEC));
+    status = 0;
+    fits_update_key(this->fptr, TSTRING, "Dec", (char *)dec.c_str(),
+		    "Declination", &status);
+    if(status) FITSError("PSRFits::addNewKeywords 3", status);
+    
+    // DATE-OBS
+    std::string dateobs = deblank(block.getKeyword<std::string>(DATE));
+    if(dateobs[0] == '0') dateobs = "20" + dateobs;
+    else                  dateobs = "19" + dateobs;
+    for(int i=0;i<dateobs.size();i++) if(dateobs[i]=='/') dateobs[i]='-';
+    dateobs += "T" + deblank(block.getKeyword<std::string>(UT));
+    dateobs = dateobs.substr(0, dateobs.size()-7);
+    status = 0;
+    fits_update_key(this->fptr, TSTRING, "DATE-OBS", (char *)dateobs.c_str(),
+		    "Date of observation (YY-MM-DDThh:mm:ss UTC)", &status);
+    if(status) FITSError("PSRFits::addNewKeywords 4", status);
+
+    // EQUINOX
+    std::string equinox_str = block.getEquinox();
+    if(equinox_str == Block::eq_b1950 || equinox_str == Block::eq_j2000){
+      float equinox;
+      if(equinox_str == Block::eq_b1950) equinox = 1950.;
+      else equinox = 2000.;
+      status = 0;
+      fits_update_key(this->fptr, TFLOAT, "EQUINOX", &equinox,
+		      "Equinox", &status);
+      if(status) FITSError("PSRFits::addNewKeywords 5", status);
+    }
+
+    // BEAM INFORMATION
+    float fval;
+    // BMAJ
+    fval = block.Survey().getBmaj();
+    status = 0;
+    fits_update_key(this->fptr, TFLOAT, "BMAJ", &fval, "", &status);
+    if(status) FITSError("PSRFits::addNewKeywords 6", status);
+    // BMIN
+    fval = block.Survey().getBmin();
+    status = 0;
+    fits_update_key(this->fptr, TFLOAT, "BMIN", &fval, "", &status);
+    if(status) FITSError("PSRFits::addNewKeywords 7", status);
+    // BPA
+    fval = block.Survey().getBpa();
+    status = 0;
+    fits_update_key(this->fptr, TFLOAT, "BPA", &fval, "", &status);
+    if(status) FITSError("PSRFits::addNewKeywords 8", status);
+    
+  }
+ //--------------------------------------------------------------------------
 
   void PSRFits::writeHistory(int argc, char * argv[])
