// // C++ Interface: STSelector // // Description: // // // Author: Malte Marquarding , (C) 2006 // // Copyright: See COPYING file that comes with this distribution // // #ifndef ASAPSTSELECTOR_H #define ASAPSTSELECTOR_H #include #include #include #include #include #include namespace asap { /** A class to set a subselection of a Scantable @author Malte Marquarding */ class STSelector { public: STSelector(); STSelector(const STSelector& other); STSelector& operator=(const STSelector& other); virtual ~STSelector(); void setScans(const std::vector& scans); void setBeams(const std::vector& beams); void setIFs(const std::vector& ifs); void setPolarizations(const std::vector& pols); void setPolFromStrings(const std::vector& pols); void setCycles(const std::vector& cycs); void setName(const std::string&); void setTypes(const std::vector& types); virtual void setTaQL(const std::string& taql); void setSortOrder(const std::vector& order); void setRows(const std::vector& rows); std::vector getScans() const; std::vector getBeams() const; std::vector getIFs() const; std::vector getPols() const; std::vector getCycles() const; std::vector getTypes() const; std::vector getPolTypes() const; std::string getTaQL() const { return taql_; } std::vector getSortOrder() const; casa::Table apply(const casa::Table& tab); casa::Table operator()(const casa::Table& tab) { return apply(tab); }; void reset() { intselections_.clear();stringselections_.clear(); taql_ = "";}; bool empty() const; std::string print(); protected: std::vector< int > getint( const std::string& key) const; //std::vector< std::string > getstring( const std::string& key) const; void setint(const std::string& key, const std::vector< int >& val); void setstring(const std::string& key, const std::vector< std::string >& val); private: casa::Table sort(const casa::Table& tab); typedef std::map > intidmap; typedef std::map > stringidmap; // has to be mutable, as to stl limitations mutable intidmap intselections_; mutable stringidmap stringselections_; std::vector poltypes_; casa::Block order_; std::string taql_; std::vector rowselection_; }; } #endif