Index: trunk/external-alma/asdm2ASAP/ASDMReader.h
===================================================================
--- trunk/external-alma/asdm2ASAP/ASDMReader.h	(revision 2254)
+++ trunk/external-alma/asdm2ASAP/ASDMReader.h	(revision 2301)
@@ -143,5 +143,5 @@
    * @return scan number
    **/
-  unsigned int getScanNo() { return (unsigned int)(mainRow_[row_]->getScanNumber()) ; } ;
+  unsigned int getScanNoOfCurrentRow() { return (unsigned int)(mainRow_[row_]->getScanNumber()) ; } ;
 
   /**
@@ -150,5 +150,12 @@
    * @return subscan number
    **/
-  unsigned int getSubscanNo() { return (unsigned int)(mainRow_[row_]->getSubscanNumber()) ; } ;
+  unsigned int getSubscanNoOfCurrentRow() { return (unsigned int)(mainRow_[row_]->getSubscanNumber()) ; } ;
+
+  /**
+   * set data index
+   *
+   * @param idx for vmsData_
+   **/
+  void prepareData( unsigned int idx ) ;
 
   /**
@@ -159,4 +166,5 @@
    **/
   unsigned int getSubscanNo( unsigned int idx ) ;
+  unsigned int getSubscanNo() ;
 
   /**
@@ -167,4 +175,5 @@
    **/
   casa::uInt getIFNo( unsigned int idx ) ;
+  casa::uInt getIFNo() ;
 
   /**
@@ -175,4 +184,5 @@
    **/
   int getNumPol( unsigned int idx ) ;
+  int getNumPol() ;
 
   /**
@@ -190,12 +200,8 @@
                      double &incr,
                      std::string &freqref ) ;
-
-  /**
-   * get rest frequencies for given index
-   *
-   * @param idx for vmsData_
-   * @return rest frequencies
-   **/
-  vector<double> getRestFrequency( unsigned int idx ) ;
+  void getFrequency( double &refpix,
+                     double &refval,
+                     double &incr,
+                     std::string &freqref ) ;
 
   /**
@@ -206,4 +212,5 @@
    **/
   double getTime( unsigned int idx ) ;
+  double getTime() ;
 
   /**
@@ -214,32 +221,5 @@
    **/
   double getInterval( unsigned int idx ) ;
-
-  /**
-   * get source name for given index
-   *
-   * @param idx for vmsData_
-   * @return source name
-   **/
-  string getSourceName( unsigned int idx ) ;
-
-  /**
-   * get field name for given index
-   * field name = fieldName + "__" + fieldId
-   *
-   * @param idx for vmsData_
-   * @return field name
-   **/
-  string getFieldName( unsigned int idx ) ;
-
-  /**
-   * get source direction for given index
-   *
-   * @param idx for vmsData_
-   * @return source direction as vector<double>
-   **/
-  std::vector<double> getSourceDirection( unsigned int idx ) ;
-  void getSourceDirection( unsigned int idx, 
-                           std::vector<double> &dir, 
-                           std::string &ref  ) ;
+  double getInterval() ;
 
   /**
@@ -253,21 +233,4 @@
   
   /**
-   * get source proper motion for given index
-   *
-   * @param idx for vmsData_
-   * @return source proper motion as vector<double>
-   **/
-  std::vector<double> getSourceProperMotion( unsigned int idx ) ;
-
-  /**
-   * get systemic velocity of the source for given index
-   * at the moment return 0-th element of sysVel vector
-   *
-   * @param idx for vmsData_
-   * @return systemic velocity of the source
-   **/
-  double getSysVel( unsigned int idx ) ;
-
-  /**
    * get row-based flag for given index
    *
@@ -276,4 +239,5 @@
    **/
   unsigned int getFlagRow( unsigned int idx ) ;
+  unsigned int getFlagRow() ;
 
   /**
@@ -284,4 +248,5 @@
    **/
   std::vector<unsigned int> getDataShape( unsigned int idx ) ;
+  std::vector<unsigned int> getDataShape() ;
 
   /**
@@ -292,22 +257,16 @@
    **/
   float *getSpectrum( unsigned int idx ) ;
-
-  /**
-   * get channel flag data for given index 
-   *
-   * @param idx for vmsData_
-   * @return channel flag 
-   **/
-  //bool *getFlagChannel( unsigned int idx ) ;
+  float *getSpectrum() ;
+
+  /**
+   * get Tsys for given index
+   *
+   * @param idx for vmsData_
+   * @return Tsys
+   **/
+  std::vector< std::vector<float> > getTsys( unsigned int idx ) ;
+  std::vector< std::vector<float> > getTsys() ;
   
   /**
-   * get Tsys for given index
-   *
-   * @param idx for vmsData_
-   * @return Tsys
-   **/
-  std::vector< std::vector<float> > getTsys( unsigned int idx ) ;
-  
-  /**
    * get Tcal for given index
    *
@@ -316,4 +275,5 @@
    **/
   std::vector< std::vector<float> > getTcal( unsigned int idx ) ;
+  std::vector< std::vector<float> > getTcal() ;
 
   /**
@@ -327,4 +287,6 @@
                        std::vector< std::vector<float> > &tcal,
                        std::vector< std::vector<float> > &tsys ) ;
+  void getTcalAndTsys( std::vector< std::vector<float> > &tcal,
+                       std::vector< std::vector<float> > &tsys ) ;
   
   /**
@@ -335,4 +297,5 @@
    **/
   std::vector<float> getOpacity( unsigned int idx ) ;
+  std::vector<float> getOpacity() ;
   
   /**
@@ -352,4 +315,9 @@
                        float &windspeed,
                        float &windaz ) ;
+  void getWeatherInfo( float &temperature,
+                       float &pressure,
+                       float &humidity,
+                       float &windspeed,
+                       float &windaz ) ;
 
   /**
@@ -367,4 +335,8 @@
                         double &el,
                         std::vector<double> &srate ) ;
+  void getPointingInfo( std::vector<double> &dir,
+                        double &az,
+                        double &el,
+                        std::vector<double> &srate ) ;
 
   /**
@@ -379,28 +351,27 @@
 
   /**
-   * get list of dataDescId for given configDescId
-   *
-   * @param configDescId
-   * @return list of dataDescId
-   **/
-//   casa::Vector<casa::uInt> getDataDescIdList( casa::uInt cdid ) ;
-
-  /**
-   * get list of switchCycleId for given configDescId
-   *
-   * @param configDescId
-   * @return list of dataDescId
-   **/
-//   casa::Vector<casa::uInt> getSwitchCycleIdList( casa::uInt cdid ) ;
-
-  /**
-   * get list of feedId for given configDescId
-   *
-   * only return list of feedId that corresponds to specified antenna.
-   *
-   * @param configDescId
-   * @return list of valid feedId 
-   **/
-//   casa::Vector<casa::uInt> getFeedIdList( casa::uInt cdid ) ;
+   * get source properties 
+   * 
+   * @param idx for vmsData_
+   * @param srcname source name
+   * @param fieldname field name
+   * @param srcdir source direction
+   * @param srcpm source proper motion
+   * @param sysvel systemic velocity of the source
+   * @param restfreq rest frequency
+   **/
+  void getSourceProperty( unsigned int idx,
+                          std::string &srcname,
+                          std::string &fieldname,
+                          std::vector<double> &srcdir,
+                          std::vector<double> &srcpm,
+                          double &sysvel,
+                          std::vector<double> &restfreq ) ;
+  void getSourceProperty( std::string &srcname,
+                          std::string &fieldname,
+                          std::vector<double> &srcdir,
+                          std::vector<double> &srcpm,
+                          double &sysvel,
+                          std::vector<double> &restfreq ) ;
 
   /**
@@ -516,8 +487,8 @@
    **/
   void toJ2000( std::vector<double> &dir,
-                double az, 
-                double el,
-                double mjd,
-                casa::Vector<casa::Double> antpos ) ;
+                double &az, 
+                double &el,
+                double &mjd,
+                casa::Vector<casa::Quantity> &antpos ) ;
 
   /**
@@ -530,8 +501,8 @@
   * @return new direction
   **/
-  std::vector<double> toJ2000( std::vector<double> dir,
-                               casa::String dirref,
-                               double mjd,
-                               casa::Vector<casa::Double> antpos ) ;
+  std::vector<double> toJ2000( std::vector<double> &dir,
+                               casa::String &dirref,
+                               double &mjd,
+                               casa::Vector<casa::Quantity> &antpos ) ;
   /**
    * get nIF
@@ -548,4 +519,5 @@
    **/
   asdm::SysCalRow *getSysCalRow( unsigned int idx ) ;
+  asdm::SysCalRow *getSysCalRow() ;
 
   /**
@@ -595,8 +567,10 @@
    * vector< unsigned int > v_flag
    **/
-  const sdmbin::VMSData *vmsData_ ; 
+  const sdmbin::VMSData *vmsData_ ;
+ 
   casa::Int antennaId_ ; // antenna id
   casa::String antennaName_ ; // antenna name
-  casa::Vector<asdm::MainRow *> mainRow_ ; // list of pointers to all Main rows
+  casa::String stationName_ ; // station name
+  casa::Vector<casa::Quantity> antennaPosition_ ; // antenna position
   casa::Vector<casa::uInt> configDescIdList_ ; // list of valid configDescriptionId 
   casa::Vector<casa::uInt> feedIdList_ ; // list of valid feedId 
@@ -615,4 +589,21 @@
   casa::CountedPtr<casa::LogSinkInterface> logsink_ ; // Logger
   casa::String className_ ;
+  unsigned int dataIndex_ ;
+
+  // Tables/Rows for ASDM
+  casa::Vector<asdm::MainRow *> mainRow_ ; // list of pointers to all Main rows
+  //asdm::AntennaRow *antennaRow_p ; // pointer to target Antenna row
+  //asdm::StationRow *stationRow_p ; // pointer to target Station row that target antenna is located
+  asdm::SpectralWindowRow *specWinRow_p ; // pointer to SpectralWindow row
+  asdm::PolarizationRow *polarizationRow_p ; // pointer to Polarization row
+  asdm::FieldRow *fieldRow_p ; // pointer to Field row 
+
+  // Tags
+  asdm::Tag antennaTag_ ;
+  asdm::Tag specWinTag_ ;
+  asdm::Tag execBlockTag_ ;
+
+  // time
+  asdm::ArrayTimeInterval timeInterval_ ;
 } ;
 #endif // ASAP_ASDM_READER_H
