Changeset 3106 for trunk/src/Scantable.h


Ignore:
Timestamp:
10/04/16 18:20:50 (8 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes/No?

Interface Changes: Yes/No?

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...


Check-in asap modifications from Jim regarding casacore namespace conversion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Scantable.h

    r3090 r3106  
    5757
    5858/**
    59   * This class contains and wraps a casa::Table, which is used to store
     59  * This class contains and wraps a casacore::Table, which is used to store
    6060  * all the information. This can be either a MemoryTable or a
    6161  * disk based Table.
     
    8383   * Default constructor
    8484   */
    85   explicit Scantable(casa::Table::TableType ttype = casa::Table::Memory);
     85  explicit Scantable(casacore::Table::TableType ttype = casacore::Table::Memory);
    8686
    8787  /**
     
    9090   */
    9191  explicit Scantable(const std::string& name,
    92                      casa::Table::TableType ttype = casa::Table::Memory);
     92                     casacore::Table::TableType ttype = casacore::Table::Memory);
    9393
    9494  /// @fixme this is only sensible for MemoryTables....
     
    101101
    102102  /**
    103    * get a const reference to the underlying casa::Table
    104    * @return const \ref casa::Table reference
    105    */
    106   const casa::Table& table() const;
    107 
    108   /**
    109    * get a reference to the underlying casa::Table with the Selection
     103   * get a const reference to the underlying casacore::Table
     104   * @return const \ref casacore::Table reference
     105   */
     106  const casacore::Table& table() const;
     107
     108  /**
     109   * get a reference to the underlying casacore::Table with the Selection
    110110   * object applied if set
    111    * @return casa::Table reference
    112    */
    113   casa::Table& table();
     111   * @return casacore::Table reference
     112   */
     113  casacore::Table& table();
    114114
    115115
     
    169169  int nscan() const;
    170170
    171   casa::MEpoch::Types getTimeReference() const;
    172 
    173 
    174   casa::MEpoch getEpoch(int whichrow) const;
     171  casacore::MEpoch::Types getTimeReference() const;
     172
     173
     174  casacore::MEpoch getEpoch(int whichrow) const;
    175175
    176176  /**
    177177   * Get global antenna position
    178    * @return casa::MPosition
    179    */
    180   casa::MPosition getAntennaPosition() const;
    181 
    182   /**
    183    * the @ref casa::MDirection for a specific row
     178   * @return casacore::MPosition
     179   */
     180  casacore::MPosition getAntennaPosition() const;
     181
     182  /**
     183   * the @ref casacore::MDirection for a specific row
    184184   * @param[in] whichrow the row number
    185    * return casa::MDirection
    186    */
    187   casa::MDirection getDirection( int whichrow ) const;
     185   * return casacore::MDirection
     186   */
     187  casacore::MDirection getDirection( int whichrow ) const;
    188188
    189189  /**
     
    249249   * param[in] rows    list of row numbers to be flagged
    250250   */
    251   void flagRow( const std::vector<casa::uInt>& rows = std::vector<casa::uInt>(), bool unflag=false);
     251  void flagRow( const std::vector<casacore::uInt>& rows = std::vector<casacore::uInt>(), bool unflag=false);
    252252
    253253  /**
     
    262262   * (CAS-1807 Wataru Kawasaki)
    263263   */
    264   void clip(const casa::Float uthres, const casa::Float dthres, bool clipoutside, bool unflag);
     264  void clip(const casacore::Float uthres, const casacore::Float dthres, bool clipoutside, bool unflag);
    265265
    266266  /**
     
    268268   * about which channel is clipped.
    269269   */
    270   std::vector<bool> getClipMask(int whichrow, const casa::Float uthres, const casa::Float dthres, bool clipoutside, bool unflag);
    271   void srchChannelsToClip(casa::uInt whichrow, const casa::Float uthres, const casa::Float dthres, bool clipoutside, bool unflag,
    272                           casa::Vector<casa::uChar> flgs);
     270  std::vector<bool> getClipMask(int whichrow, const casacore::Float uthres, const casacore::Float dthres, bool clipoutside, bool unflag);
     271  void srchChannelsToClip(casacore::uInt whichrow, const casacore::Float uthres, const casacore::Float dthres, bool clipoutside, bool unflag,
     272                          casacore::Vector<casacore::uChar> flgs);
    273273
    274274  /**
     
    347347
    348348  float getTsys(int whichrow) const
    349     { return casa::Vector<casa::Float>(tsysCol_(whichrow))(0); }
     349    { return casacore::Vector<casacore::Float>(tsysCol_(whichrow))(0); }
    350350  std::vector<float> getTsysSpectrum(int whichrow) const ;
    351351 
     
    400400  //std::string getTime(int whichrow=-1, bool showdate=true) const;
    401401  std::string getTime(int whichrow=-1, bool showdate=true,
    402                       casa::uInt prec=0) const;
     402                      casacore::uInt prec=0) const;
    403403  double getIntTime(int whichrow) const { return integrCol_(whichrow); }
    404404
     
    445445  void shift(int npix);
    446446
    447   casa::SpectralCoordinate getSpectralCoordinate(int whichrow) const;
     447  casacore::SpectralCoordinate getSpectralCoordinate(int whichrow) const;
    448448
    449449  void convertDirection(const std::string& newframe);
     
    475475   * @return antenna name string
    476476   */
    477   casa::String getAntennaName() const;
     477  casacore::String getAntennaName() const;
    478478
    479479  /**
     
    507507   * 30/07/2008 Takeshi Nakazato
    508508   **/
    509   void reshapeSpectrum( int nmin, int nmax ) throw( casa::AipsError );
     509  void reshapeSpectrum( int nmin, int nmax ) throw( casacore::AipsError );
    510510  void reshapeSpectrum( int nmin, int nmax, int irow ) ;
    511511
     
    522522  void regridSpecChannel( double dnu, int nchan=-1 ) ;
    523523
    524   bool isAllChannelsFlagged(casa::uInt whichrow);
     524  bool isAllChannelsFlagged(casacore::uInt whichrow);
    525525
    526526  std::vector<std::string> applyBaselineTable(const std::string& bltable,
     
    666666  static std::vector<bool> getMaskFromMaskList(const int nchan,
    667667                                          const std::vector<int>& masklist);
    668   static casa::Vector<casa::uInt> getMaskListFromMask(
     668  static casacore::Vector<casacore::uInt> getMaskListFromMask(
    669669                                           const std::vector<bool>& mask);
    670670  static std::vector<int> splitToIntList(const std::string& str,
     
    677677private:
    678678
    679   casa::Matrix<casa::Float> getPolMatrix( casa::uInt whichrow ) const;
     679  casacore::Matrix<casacore::Float> getPolMatrix( casacore::uInt whichrow ) const;
    680680
    681681  /**
     
    684684   * @return
    685685   */
    686   std::string formatSec(casa::Double x) const;
    687 
    688   std::string formatTime(const casa::MEpoch& me, bool showdate)const;
    689   std::string formatTime(const casa::MEpoch& me, bool showdate,
    690                          casa::uInt prec)const;
    691 
    692   /**
    693    *  Turns a casa::MDirection into a nicely formatted string
    694    * @param md an casa::MDirection
     686  std::string formatSec(casacore::Double x) const;
     687
     688  std::string formatTime(const casacore::MEpoch& me, bool showdate)const;
     689  std::string formatTime(const casacore::MEpoch& me, bool showdate,
     690                         casacore::uInt prec)const;
     691
     692  /**
     693   *  Turns a casacore::MDirection into a nicely formatted string
     694   * @param md an casacore::MDirection
    695695   * @param prec output precision of direction
    696696   * @return
    697697   */
    698   std::string formatDirection(const casa::MDirection& md, casa::Int prec=7) const;
     698  std::string formatDirection(const casacore::MDirection& md, casacore::Int prec=7) const;
    699699
    700700  /**
     
    702702   * @return just the name
    703703   */
    704   static casa::String generateName();
     704  static casacore::String generateName();
    705705
    706706  /**
     
    710710
    711711  /**
    712    * Set up the main casa::Table
     712   * Set up the main casacore::Table
    713713   */
    714714  void setupMainTable();
     
    724724  int rowToScanIndex(int therow);
    725725
    726   std::vector<uint> getNumbers(const casa::ScalarColumn<casa::uInt>& col) const;
     726  std::vector<uint> getNumbers(const casacore::ScalarColumn<casacore::uInt>& col) const;
    727727
    728728  /**
     
    733733  std::size_t nValidMask(const std::vector<bool>& mask);
    734734
    735   static const casa::uInt version_ = 4;
     735  static const casacore::uInt version_ = 4;
    736736
    737737  STSelector selector_;
    738738
    739   casa::Table::TableType type_;
     739  casacore::Table::TableType type_;
    740740
    741741  // the actual data
    742   casa::Table table_;
    743   casa::Table originalTable_;
     742  casacore::Table table_;
     743  casacore::Table originalTable_;
    744744
    745745  STTcal tcalTable_;
     
    752752
    753753  // Cached Columns to avoid reconstructing them for each row get/put
    754   casa::ScalarColumn<casa::Double> integrCol_;
    755   casa::MDirection::ScalarColumn dirCol_;
    756   casa::MEpoch::ScalarColumn timeCol_;
    757   casa::ScalarColumn<casa::Float> azCol_;
    758   casa::ScalarColumn<casa::Float> elCol_;
    759   casa::ScalarColumn<casa::String> srcnCol_, fldnCol_;
    760   casa::ScalarColumn<casa::uInt> scanCol_, beamCol_, ifCol_, polCol_, cycleCol_, flagrowCol_;
    761   casa::ScalarColumn<casa::Int> rbeamCol_, srctCol_;
    762   casa::ArrayColumn<casa::Float> specCol_, tsysCol_;
    763   casa::ArrayColumn<casa::uChar> flagsCol_;
     754  casacore::ScalarColumn<casacore::Double> integrCol_;
     755  casacore::MDirection::ScalarColumn dirCol_;
     756  casacore::MEpoch::ScalarColumn timeCol_;
     757  casacore::ScalarColumn<casacore::Float> azCol_;
     758  casacore::ScalarColumn<casacore::Float> elCol_;
     759  casacore::ScalarColumn<casacore::String> srcnCol_, fldnCol_;
     760  casacore::ScalarColumn<casacore::uInt> scanCol_, beamCol_, ifCol_, polCol_, cycleCol_, flagrowCol_;
     761  casacore::ScalarColumn<casacore::Int> rbeamCol_, srctCol_;
     762  casacore::ArrayColumn<casacore::Float> specCol_, tsysCol_;
     763  casacore::ArrayColumn<casacore::uChar> flagsCol_;
    764764
    765765  // id in frequencies table
    766   casa::ScalarColumn<casa::uInt> mfreqidCol_;
     766  casacore::ScalarColumn<casacore::uInt> mfreqidCol_;
    767767  // id in tcal table
    768   casa::ScalarColumn<casa::uInt> mtcalidCol_;
    769 
    770   casa::ArrayColumn<casa::String> histitemCol_;
    771   casa::ScalarColumn<casa::Int> mfitidCol_;
    772   casa::ScalarColumn<casa::uInt> mweatheridCol_;
    773 
    774   casa::ScalarColumn<casa::uInt> mfocusidCol_;
    775 
    776   casa::ScalarColumn<casa::uInt> mmolidCol_;
     768  casacore::ScalarColumn<casacore::uInt> mtcalidCol_;
     769
     770  casacore::ArrayColumn<casacore::String> histitemCol_;
     771  casacore::ScalarColumn<casacore::Int> mfitidCol_;
     772  casacore::ScalarColumn<casacore::uInt> mweatheridCol_;
     773
     774  casacore::ScalarColumn<casacore::uInt> mfocusidCol_;
     775
     776  casacore::ScalarColumn<casacore::uInt> mmolidCol_;
    777777
    778778  static std::map<std::string, STPol::STPolFactory *> factories_;
     
    789789   * 25/10/2009 Wataru Kawasaki
    790790   */
    791   template<class T, class T2> void attachAuxColumnDef(casa::ScalarColumn<T>&,
    792                                                        const casa::String&,
     791  template<class T, class T2> void attachAuxColumnDef(casacore::ScalarColumn<T>&,
     792                                                       const casacore::String&,
    793793                                                       const T2&);
    794   template<class T, class T2> void attachAuxColumnDef(casa::ArrayColumn<T>&,
    795                                                       const casa::String&,
    796                                                       const casa::Array<T2>&);
     794  template<class T, class T2> void attachAuxColumnDef(casacore::ArrayColumn<T>&,
     795                                                      const casacore::String&,
     796                                                      const casacore::Array<T2>&);
    797797
    798798  double getNormalPolynomial(int n, double x);
     
    950950                            bool& outTextFile,
    951951                            bool& csvFormat,
    952                             casa::String& coordInfo,
     952                            casacore::String& coordInfo,
    953953                            bool& hasSameNchan,
    954954                            const std::string& progressInfo,
    955955                            bool& showProgress,
    956956                            int& minNRow,
    957                             casa::Vector<casa::Double>& timeSecCol);
     957                            casacore::Vector<casacore::Double>& timeSecCol);
    958958  void finaliseBaselining(const bool outBaselineTable,
    959959                          STBaselineTable* pbt,
     
    968968  std::string getMaskRangeList(const std::vector<bool>& mask,
    969969                                int whichrow,
    970                                 const casa::String& coordInfo,
     970                                const casacore::String& coordInfo,
    971971                                bool hasSameNchan,
    972972                                bool verbose=false);
     
    976976  std::vector<bool> getCompositeChanMask(int whichrow, const std::vector<bool>& inMask);
    977977  std::vector<bool> getCompositeChanMask(int whichrow, const std::vector<bool>& inMask, const std::vector<int>& edge, std::vector<int>& currEdge, STLineFinder& lineFinder);
    978   void outputFittingResult(bool outLogger, bool outTextFile, bool csvFormat, const std::vector<bool>& chanMask, int whichrow, const casa::String& coordInfo, bool hasSameNchan, std::ofstream& ofs, const casa::String& funcName, const std::vector<int>& edge, const std::vector<float>& params, const int nClipped);
    979   void outputFittingResult(bool outLogger, bool outTextFile, bool csvFormat, const std::vector<bool>& chanMask, int whichrow, const casa::String& coordInfo, bool hasSameNchan, std::ofstream& ofs, const casa::String& funcName, const std::vector<float>& params, const int nClipped);
     978  void outputFittingResult(bool outLogger, bool outTextFile, bool csvFormat, const std::vector<bool>& chanMask, int whichrow, const casacore::String& coordInfo, bool hasSameNchan, std::ofstream& ofs, const casacore::String& funcName, const std::vector<int>& edge, const std::vector<float>& params, const int nClipped);
     979  void outputFittingResult(bool outLogger, bool outTextFile, bool csvFormat, const std::vector<bool>& chanMask, int whichrow, const casacore::String& coordInfo, bool hasSameNchan, std::ofstream& ofs, const casacore::String& funcName, const std::vector<float>& params, const int nClipped);
    980980  void parseProgressInfo(const std::string& progressInfo, bool& showProgress, int& minNRow);
    981981  void showProgressOnTerminal(const int nProcessed, const int nTotal, const bool showProgress=true, const int nTotalThreshold=1000);
    982982
    983   void applyChanFlag( casa::uInt whichrow, const std::vector<bool>& msk, casa::uChar flagval);
     983  void applyChanFlag( casacore::uInt whichrow, const std::vector<bool>& msk, casacore::uChar flagval);
    984984
    985985  double doCalculateModelSelectionCriteria(const std::string& valname,
     
    988988                                           const std::string& blfunc,
    989989                                           int order);
    990   double doGetRms(const std::vector<bool>& mask, const casa::Vector<casa::Float>& spec);
     990  double doGetRms(const std::vector<bool>& mask, const casacore::Vector<casacore::Float>& spec);
    991991  std::string packFittingResults(const int irow, const std::vector<float>& params, const float rms);
    992992  void parseBlInfo(const std::string& blInfo, int& whichrow, STBaselineFunc::FuncName& ftype, std::vector<int>& fpar, std::vector<bool>& mask, float& thresClip, int& nIterClip, bool& useLineFinder, float& thresLF, std::vector<int>& edgeLF, int& avgLF);
Note: See TracChangeset for help on using the changeset viewer.