source: trunk/src/STSelector.h@ 836

Last change on this file since 836 was 812, checked in by mar637, 19 years ago

Selection object for Scantable. Initial revision.

File size: 1.4 KB
Line 
1//
2// C++ Interface: STSelector
3//
4// Description:
5//
6//
7// Author: Malte Marquarding <asap@atnf.csiro.au>, (C) 2006
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12#ifndef ASAPSTSELECTOR_H
13#define ASAPSTSELECTOR_H
14
15#include <string>
16#include <vector>
17#include <map>
18
19#include <tables/Tables/Table.h>
20
21namespace asap {
22
23/**
24A class to set a subselection of a Scantable
25
26@author Malte Marquarding
27*/
28class STSelector {
29
30public:
31 STSelector();
32 STSelector(const STSelector& other);
33
34 STSelector& operator=(const STSelector& other);
35
36 ~STSelector();
37
38 void setScans(const std::vector<int>& scans);
39 void setBeams(const std::vector<int>& beams);
40 void setIFs(const std::vector<int>& ifs);
41 void setPolarizations(const std::vector<int>& pols);
42 void setTaQL(const std::string& taql);
43
44 std::vector<int> getScans();
45 std::vector<int> getBeams();
46 std::vector<int> getIFs();
47 std::vector<int> getPols();
48
49 casa::Table apply(const casa::Table& tab);
50 casa::Table operator()(const casa::Table& tab) { return apply(tab); };
51
52 void reset() { selections_.clear(); taql_ = "";};
53
54 bool empty() const;
55
56 std::string print();
57
58private:
59 //
60 std::vector< int > get( const std::string& key);
61 void set(const std::string& key, const std::vector< int >& val);
62
63 typedef std::map<std::string, std::vector<int> > idmap;
64 // has to be mutable, as to stl limitations
65 mutable idmap selections_;
66 std::string taql_;
67};
68
69}
70
71#endif
Note: See TracBrowser for help on using the repository browser.