Index: branches/mergetest/src/Scantable.h
===================================================================
--- branches/mergetest/src/Scantable.h	(revision 1785)
+++ branches/mergetest/src/Scantable.h	(revision 1789)
@@ -29,4 +29,9 @@
 
 #include <coordinates/Coordinates/SpectralCoordinate.h>
+
+#include <casa/Arrays/Vector.h>
+#include <casa/Quanta/Quantum.h>
+
+#include <casa/Exceptions/Error.h>
 
 #include "Logger.h"
@@ -226,4 +231,31 @@
 
   /**
+   * Flag the data in a row-based manner. (CAS-1433 Wataru Kawasaki)
+   * param[in] rows    list of row numbers to be flagged
+   */
+  void flagRow( const std::vector<casa::uInt>& rows = std::vector<casa::uInt>(), bool unflag=false);
+
+  /**
+   * Get flagRow info at the specified row. If true, the whole data 
+   * at the row should be flagged.
+   */
+  bool getFlagRow(int whichrow) const
+    { return (flagrowCol_(whichrow) > 0); }
+
+  /**
+   * Flag the data outside a specified range (in a channel-based manner).
+   * (CAS-1807 Wataru Kawasaki)
+   */
+  void clip(const casa::Float uthres, const casa::Float dthres, bool clipoutside, bool unflag);
+
+  /**
+   * Return a list of booleans with the size of nchan for a specified row, to get info 
+   * about which channel is clipped.
+   */
+  std::vector<bool> getClipMask(int whichrow, const casa::Float uthres, const casa::Float dthres, bool clipoutside, bool unflag);
+  void srchChannelsToClip(casa::uInt whichrow, const casa::Float uthres, const casa::Float dthres, bool clipoutside, bool unflag, 
+			  casa::Vector<casa::uChar> flgs);
+
+  /**
    * Return a list of row numbers with respect to the original table.
    * @return a list of unsigned ints
@@ -276,4 +308,7 @@
   std::vector<uint> getScanNos() const { return getNumbers(scanCol_); }
   int getScan(int whichrow) const { return scanCol_(whichrow); }
+
+  //TT addition
+  std::vector<uint> getMolNos() {return getNumbers(mmolidCol_); }
 
   /**
@@ -300,5 +335,7 @@
     { return azCol_(whichrow); }
   float getParAngle(int whichrow) const
-  { return focus().getParAngle(mfocusidCol_(whichrow)); }
+    { return focus().getParAngle(mfocusidCol_(whichrow)); }
+  int getTcalId(int whichrow) const
+    { return mtcalidCol_(whichrow); }
 
   std::string getSourceName(int whichrow) const
@@ -353,8 +390,22 @@
   std::vector<double> getRestFrequencies() const
     { return moleculeTable_.getRestFrequencies(); }
-
+  std::vector<double> getRestFrequency(int id) const
+    { return moleculeTable_.getRestFrequency(id); }
+
+  /**
   void setRestFrequencies(double rf, const std::string& name = "",
                           const std::string& = "Hz");
-  void setRestFrequencies(const std::string& name);
+  **/
+  // Modified by Takeshi Nakazato 05/09/2008
+  /***
+  void setRestFrequencies(vector<double> rf, const vector<std::string>& name = "",
+                          const std::string& = "Hz");
+  ***/
+  void setRestFrequencies(vector<double> rf,
+                          const vector<std::string>& name = vector<std::string>(1,""),
+                          const std::string& = "Hz");
+
+  //void setRestFrequencies(const std::string& name);
+  void setRestFrequencies(const vector<std::string>& name);
 
   void shift(int npix);
@@ -415,4 +466,25 @@
     { focus().setParallactify(flag); }
 
+  /**
+   * Reshape spectrum
+   * @param[in] nmin, nmax minimum and maximum channel
+   * @param[in] irow       row number
+   * 
+   * 30/07/2008 Takeshi Nakazato  
+   **/
+  void reshapeSpectrum( int nmin, int nmax ) throw( casa::AipsError );
+  void reshapeSpectrum( int nmin, int nmax, int irow ) ;
+
+  /**
+   * Change channel number under fixed bandwidth
+   * @param[in] nchan, dnu new channel number and spectral resolution
+   * @param[in] irow       row number
+   *
+   * 27/08/2008 Takeshi Nakazato
+   **/
+  void regridChannel( int nchan, double dnu ) ;
+  void regridChannel( int nchan, double dnu, int irow ) ;
+
+ 
 private:
 
@@ -489,5 +561,5 @@
   casa::ScalarColumn<casa::Float> elCol_;
   casa::ScalarColumn<casa::String> srcnCol_, fldnCol_;
-  casa::ScalarColumn<casa::uInt> scanCol_, beamCol_, ifCol_, polCol_, cycleCol_;
+  casa::ScalarColumn<casa::uInt> scanCol_, beamCol_, ifCol_, polCol_, cycleCol_, flagrowCol_;
   casa::ScalarColumn<casa::Int> rbeamCol_, srctCol_;
   casa::ArrayColumn<casa::Float> specCol_, tsysCol_;
@@ -510,4 +582,20 @@
   void initFactories();
 
+  /**
+   * Add an auxiliary column to the main table and attach it to a 
+   * cached column. Use for adding new columns that the original asap2
+   * tables do not have. 
+   * @param[in] col      reference to the cached column to be attached
+   * @param[in] colName  column name in asap table
+   * @param[in] defValue default value to fill in the column
+   *
+   * 25/10/2009 Wataru Kawasaki
+   */
+  template<class T, class T2> void attachAuxColumnDef(casa::ScalarColumn<T>&,
+						       const casa::String&,
+						       const T2&);
+  template<class T, class T2> void attachAuxColumnDef(casa::ArrayColumn<T>&,
+						      const casa::String&,
+						      const casa::Array<T2>&);
 };
 
