Index: branches/newfiller/src/Scantable.cpp
===================================================================
--- branches/newfiller/src/Scantable.cpp	(revision 1778)
+++ branches/newfiller/src/Scantable.cpp	(revision 1804)
@@ -224,9 +224,12 @@
   td.addColumn(ScalarColumnDesc<uInt>("FREQ_ID"));
   td.addColumn(ScalarColumnDesc<uInt>("MOLECULE_ID"));
+
   ScalarColumnDesc<Int> refbeamnoColumn("REFBEAMNO");
   refbeamnoColumn.setDefault(Int(-1));
   td.addColumn(refbeamnoColumn);
 
-  td.addColumn(ScalarColumnDesc<uInt>("FLAGROW"));
+  ScalarColumnDesc<uInt> flagrowColumn("FLAGROW");
+  flagrowColumn.setDefault(uInt(0));
+  td.addColumn(flagrowColumn);
 
   td.addColumn(ScalarColumnDesc<Double>("TIME"));
@@ -363,5 +366,5 @@
       for (int i = 0; i < size; ++i)
 	arr[i] = static_cast<T>(defValue[i]);
-      
+
       col.fillColumn(arr);
     } else {
@@ -951,11 +954,11 @@
           Vector<Double> vec(moleculeTable_.getRestFrequency(i));
           if (vec.nelements() > 0) {
-               if (firstline) { 
+               if (firstline) {
                    oss << setprecision(10) << vec << " [Hz]" << endl;
                    firstline=False;
                }
-               else{ 
+               else{
                    oss << setw(15)<<" " << setprecision(10) << vec << " [Hz]" << endl;
-               } 
+               }
           } else {
               oss << "none" << endl;
@@ -1169,7 +1172,7 @@
   //Quantum<Double> urf(rf, u);
   Quantum<Vector<Double> >urf(rf, u);
-  Vector<String> formattedname(0); 
+  Vector<String> formattedname(0);
   //cerr<<"Scantable::setRestFrequnecies="<<urf<<endl;
-  
+
   //uInt id = moleculeTable_.addEntry(urf.getValue("Hz"), name, "");
   uInt id = moleculeTable_.addEntry(urf.getValue("Hz"), mathutil::toVectorString(name), formattedname);
@@ -1349,5 +1352,5 @@
   Vector<Float> arr = specCol_( 0 ) ;
   int nChan = arr.nelements() ;
-  
+
   // if nmin < 0 or nmax < 0, nothing to do
   if (  nmin < 0 ) {
@@ -1357,5 +1360,5 @@
     throw( casa::indexError<int>( nmax, "asap::Scantable::reshapeSpectrum: Invalid range. Negative index is specified." ) ) ;
   }
-  
+
   // if nmin > nmax, exchange values
   if ( nmin > nmax ) {
@@ -1364,13 +1367,13 @@
     nmin = tmp ;
     LogIO os( LogOrigin( "Scantable", "reshapeSpectrum()", WHERE ) ) ;
-    os << "Swap values. Applied range is [" 
+    os << "Swap values. Applied range is ["
        << nmin << ", " << nmax << "]" << LogIO::POST ;
   }
-  
+
   // if nmin exceeds nChan, nothing to do
   if ( nmin >= nChan ) {
     throw( casa::indexError<int>( nmin, "asap::Scantable::reshapeSpectrum: Invalid range. Specified minimum exceeds nChan." ) ) ;
   }
-  
+
   // if nmax exceeds nChan, reset nmax to nChan
   if ( nmax >= nChan ) {
@@ -1388,5 +1391,5 @@
     }
   }
-  
+
   // reshape specCol_ and flagCol_
   for ( int irow = 0 ; irow < nrow() ; irow++ ) {
@@ -1408,20 +1411,20 @@
      ***/
     refval = refval - ( refpix - nmin ) * increment ;
-    refpix = 0 ;  
+    refpix = 0 ;
     freqTable_.setEntry( refpix, refval, increment, irow ) ;
   }
-  
+
   // update nchan
   int newsize = nmax - nmin + 1 ;
   table_.rwKeywordSet().define( "nChan", newsize ) ;
-  
+
   // update bandwidth
   // assumed all spectra in the scantable have same bandwidth
   table_.rwKeywordSet().define( "Bandwidth", increment * newsize ) ;
-  
+
   return ;
 }
 
-void asap::Scantable::reshapeSpectrum( int nmin, int nmax, int irow ) 
+void asap::Scantable::reshapeSpectrum( int nmin, int nmax, int irow )
 {
   // reshape specCol_ and flagCol_
@@ -1464,16 +1467,16 @@
   for ( int irow = 0 ; irow < nrow() ; irow++ ) {
     regridChannel( nChan, dnu, irow ) ;
-  } 
+  }
   coordinfo[0] = oldinfo ;
   setCoordInfo( coordinfo ) ;
 
 
-  // NOTE: this method does not update metadata such as 
+  // NOTE: this method does not update metadata such as
   //       FREQUENCIES subtable, nChan, Bandwidth, etc.
 
-  return ; 
-}
-
-void asap::Scantable::regridChannel( int nChan, double dnu, int irow ) 
+  return ;
+}
+
+void asap::Scantable::regridChannel( int nChan, double dnu, int irow )
 {
   // logging
@@ -1485,5 +1488,5 @@
   Vector<Float> newspec( nChan, 0 ) ;
   Vector<uChar> newflag( nChan, false ) ;
-  
+
   // regrid
   vector<double> abcissa = getAbcissa( irow ) ;
@@ -1504,5 +1507,5 @@
   zi[0] = z[0] - 0.5 * dnu ;
   zi[1] = z[0] + 0.5 * dnu ;
-  for ( int ii = 2 ; ii < nChan ; ii++ ) 
+  for ( int ii = 2 ; ii < nChan ; ii++ )
     zi[ii] = zi[ii-1] + dnu ;
   zi[nChan] = z[nChan-1] + 0.5 * dnu ;
@@ -1511,5 +1514,5 @@
   for ( int ii = 2 ; ii < oldsize ; ii++ )
     yi[ii] = abcissa[ii-1] + olddnu ;
-  yi[oldsize] = abcissa[oldsize-1] + 0.5 * olddnu ; 
+  yi[oldsize] = abcissa[oldsize-1] + 0.5 * olddnu ;
   if ( dnu > 0.0 ) {
     for ( int ii = 0 ; ii < nChan ; ii++ ) {
@@ -1666,5 +1669,5 @@
 //    ***/
 //   // NOTE: Assumed that all spectra have the same bandwidth
-//   pile += dnu ; 
+//   pile += dnu ;
 //   newspec[nChan-1] += frac * olddnu * oldspec[refChan] ;
 //   newflag[nChan-1] = newflag[nChan-1] || oldflag[refChan] ;
@@ -1685,5 +1688,5 @@
 //   newspec[nChan-1] /= wsum ;
 //   //ofs << "newspec[" << nChan - 1 << "] = " << newspec[nChan-1] << endl ;
-  
+
 //   specCol_.put( irow, newspec ) ;
 //   flagsCol_.put( irow, newflag ) ;
