source: trunk/src/STSelector.h @ 846

Last change on this file since 846 was 842, checked in by mar637, 18 years ago

added CYCLENO get/set

File size: 1.5 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  virtual ~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 setCycles(const std::vector<int>& cycs);
43  void setTaQL(const std::string& taql);
44
45  std::vector<int> getScans();
46  std::vector<int> getBeams();
47  std::vector<int> getIFs();
48  std::vector<int> getPols();
49  std::vector<int> getCycles();
50
51  casa::Table apply(const casa::Table& tab);
52  casa::Table operator()(const casa::Table& tab) { return apply(tab); };
53
54  void reset() { selections_.clear(); taql_ = "";};
55
56  bool empty() const;
57
58  std::string print();
59
60private:
61  //
62  std::vector< int > get( const std::string& key);
63  void set(const std::string& key, const std::vector< int >& val);
64
65  typedef std::map<std::string, std::vector<int> > idmap;
66  // has to be mutable, as to stl limitations
67  mutable idmap selections_;
68  std::string taql_;
69};
70
71}
72
73#endif
Note: See TracBrowser for help on using the repository browser.