Changeset 3106 for trunk/src/Scantable.h
- Timestamp:
- 10/04/16 18:20:50 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Scantable.h
r3090 r3106 57 57 58 58 /** 59 * This class contains and wraps a casa ::Table, which is used to store59 * This class contains and wraps a casacore::Table, which is used to store 60 60 * all the information. This can be either a MemoryTable or a 61 61 * disk based Table. … … 83 83 * Default constructor 84 84 */ 85 explicit Scantable(casa ::Table::TableType ttype = casa::Table::Memory);85 explicit Scantable(casacore::Table::TableType ttype = casacore::Table::Memory); 86 86 87 87 /** … … 90 90 */ 91 91 explicit Scantable(const std::string& name, 92 casa ::Table::TableType ttype = casa::Table::Memory);92 casacore::Table::TableType ttype = casacore::Table::Memory); 93 93 94 94 /// @fixme this is only sensible for MemoryTables.... … … 101 101 102 102 /** 103 * get a const reference to the underlying casa ::Table104 * @return const \ref casa ::Table reference105 */ 106 const casa ::Table& table() const;107 108 /** 109 * get a reference to the underlying casa ::Table with the Selection103 * 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 110 110 * object applied if set 111 * @return casa ::Table reference112 */ 113 casa ::Table& table();111 * @return casacore::Table reference 112 */ 113 casacore::Table& table(); 114 114 115 115 … … 169 169 int nscan() const; 170 170 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; 175 175 176 176 /** 177 177 * Get global antenna position 178 * @return casa ::MPosition179 */ 180 casa ::MPosition getAntennaPosition() const;181 182 /** 183 * the @ref casa ::MDirection for a specific row178 * @return casacore::MPosition 179 */ 180 casacore::MPosition getAntennaPosition() const; 181 182 /** 183 * the @ref casacore::MDirection for a specific row 184 184 * @param[in] whichrow the row number 185 * return casa ::MDirection186 */ 187 casa ::MDirection getDirection( int whichrow ) const;185 * return casacore::MDirection 186 */ 187 casacore::MDirection getDirection( int whichrow ) const; 188 188 189 189 /** … … 249 249 * param[in] rows list of row numbers to be flagged 250 250 */ 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); 252 252 253 253 /** … … 262 262 * (CAS-1807 Wataru Kawasaki) 263 263 */ 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); 265 265 266 266 /** … … 268 268 * about which channel is clipped. 269 269 */ 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); 273 273 274 274 /** … … 347 347 348 348 float getTsys(int whichrow) const 349 { return casa ::Vector<casa::Float>(tsysCol_(whichrow))(0); }349 { return casacore::Vector<casacore::Float>(tsysCol_(whichrow))(0); } 350 350 std::vector<float> getTsysSpectrum(int whichrow) const ; 351 351 … … 400 400 //std::string getTime(int whichrow=-1, bool showdate=true) const; 401 401 std::string getTime(int whichrow=-1, bool showdate=true, 402 casa ::uInt prec=0) const;402 casacore::uInt prec=0) const; 403 403 double getIntTime(int whichrow) const { return integrCol_(whichrow); } 404 404 … … 445 445 void shift(int npix); 446 446 447 casa ::SpectralCoordinate getSpectralCoordinate(int whichrow) const;447 casacore::SpectralCoordinate getSpectralCoordinate(int whichrow) const; 448 448 449 449 void convertDirection(const std::string& newframe); … … 475 475 * @return antenna name string 476 476 */ 477 casa ::String getAntennaName() const;477 casacore::String getAntennaName() const; 478 478 479 479 /** … … 507 507 * 30/07/2008 Takeshi Nakazato 508 508 **/ 509 void reshapeSpectrum( int nmin, int nmax ) throw( casa ::AipsError );509 void reshapeSpectrum( int nmin, int nmax ) throw( casacore::AipsError ); 510 510 void reshapeSpectrum( int nmin, int nmax, int irow ) ; 511 511 … … 522 522 void regridSpecChannel( double dnu, int nchan=-1 ) ; 523 523 524 bool isAllChannelsFlagged(casa ::uInt whichrow);524 bool isAllChannelsFlagged(casacore::uInt whichrow); 525 525 526 526 std::vector<std::string> applyBaselineTable(const std::string& bltable, … … 666 666 static std::vector<bool> getMaskFromMaskList(const int nchan, 667 667 const std::vector<int>& masklist); 668 static casa ::Vector<casa::uInt> getMaskListFromMask(668 static casacore::Vector<casacore::uInt> getMaskListFromMask( 669 669 const std::vector<bool>& mask); 670 670 static std::vector<int> splitToIntList(const std::string& str, … … 677 677 private: 678 678 679 casa ::Matrix<casa::Float> getPolMatrix( casa::uInt whichrow ) const;679 casacore::Matrix<casacore::Float> getPolMatrix( casacore::uInt whichrow ) const; 680 680 681 681 /** … … 684 684 * @return 685 685 */ 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 string694 * @param md an casa ::MDirection686 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 695 695 * @param prec output precision of direction 696 696 * @return 697 697 */ 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; 699 699 700 700 /** … … 702 702 * @return just the name 703 703 */ 704 static casa ::String generateName();704 static casacore::String generateName(); 705 705 706 706 /** … … 710 710 711 711 /** 712 * Set up the main casa ::Table712 * Set up the main casacore::Table 713 713 */ 714 714 void setupMainTable(); … … 724 724 int rowToScanIndex(int therow); 725 725 726 std::vector<uint> getNumbers(const casa ::ScalarColumn<casa::uInt>& col) const;726 std::vector<uint> getNumbers(const casacore::ScalarColumn<casacore::uInt>& col) const; 727 727 728 728 /** … … 733 733 std::size_t nValidMask(const std::vector<bool>& mask); 734 734 735 static const casa ::uInt version_ = 4;735 static const casacore::uInt version_ = 4; 736 736 737 737 STSelector selector_; 738 738 739 casa ::Table::TableType type_;739 casacore::Table::TableType type_; 740 740 741 741 // the actual data 742 casa ::Table table_;743 casa ::Table originalTable_;742 casacore::Table table_; 743 casacore::Table originalTable_; 744 744 745 745 STTcal tcalTable_; … … 752 752 753 753 // 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_; 764 764 765 765 // id in frequencies table 766 casa ::ScalarColumn<casa::uInt> mfreqidCol_;766 casacore::ScalarColumn<casacore::uInt> mfreqidCol_; 767 767 // 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_; 777 777 778 778 static std::map<std::string, STPol::STPolFactory *> factories_; … … 789 789 * 25/10/2009 Wataru Kawasaki 790 790 */ 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&, 793 793 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>&); 797 797 798 798 double getNormalPolynomial(int n, double x); … … 950 950 bool& outTextFile, 951 951 bool& csvFormat, 952 casa ::String& coordInfo,952 casacore::String& coordInfo, 953 953 bool& hasSameNchan, 954 954 const std::string& progressInfo, 955 955 bool& showProgress, 956 956 int& minNRow, 957 casa ::Vector<casa::Double>& timeSecCol);957 casacore::Vector<casacore::Double>& timeSecCol); 958 958 void finaliseBaselining(const bool outBaselineTable, 959 959 STBaselineTable* pbt, … … 968 968 std::string getMaskRangeList(const std::vector<bool>& mask, 969 969 int whichrow, 970 const casa ::String& coordInfo,970 const casacore::String& coordInfo, 971 971 bool hasSameNchan, 972 972 bool verbose=false); … … 976 976 std::vector<bool> getCompositeChanMask(int whichrow, const std::vector<bool>& inMask); 977 977 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); 980 980 void parseProgressInfo(const std::string& progressInfo, bool& showProgress, int& minNRow); 981 981 void showProgressOnTerminal(const int nProcessed, const int nTotal, const bool showProgress=true, const int nTotalThreshold=1000); 982 982 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); 984 984 985 985 double doCalculateModelSelectionCriteria(const std::string& valname, … … 988 988 const std::string& blfunc, 989 989 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); 991 991 std::string packFittingResults(const int irow, const std::vector<float>& params, const float rms); 992 992 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.