source: branches/alma/src/STSelector.h@ 2887

Last change on this file since 2887 was 1693, checked in by Takeshi Nakazato, 15 years ago

New Development: No

JIRA Issue: Yes CAS-1908

Ready to Release: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes

Module(s): Module Names change impacts.

Description: Describe your changes here...

Changed a tagging as the source type is tagged by using SRCTYPE, not
an extra string in SRCNAME. To do this, I have defined a selection method
by SRCTYPE in STSelector class. I have newly added python_SrcType.cpp
that defines a Python interface of SrcType enums which is defined
in atnf/PKSIO/SrcType.h.

Since I have added new file in the src directory, I have modified src/Makefile
to compile new file.

File size: 2.5 KB
RevLine 
[812]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
[902]19#include <casa/Containers/Block.h>
20#include <casa/BasicSL/String.h>
[812]21#include <tables/Tables/Table.h>
22
23namespace asap {
24
25/**
26A class to set a subselection of a Scantable
27
28@author Malte Marquarding
29*/
30class STSelector {
31
32public:
33 STSelector();
34 STSelector(const STSelector& other);
35
36 STSelector& operator=(const STSelector& other);
37
[842]38 virtual ~STSelector();
[812]39
40 void setScans(const std::vector<int>& scans);
41 void setBeams(const std::vector<int>& beams);
42 void setIFs(const std::vector<int>& ifs);
43 void setPolarizations(const std::vector<int>& pols);
[902]44 void setPolFromStrings(const std::vector<std::string>& pols);
[842]45 void setCycles(const std::vector<int>& cycs);
[850]46 void setName(const std::string&);
[1693]47 void setTypes(const std::vector<int>& types);
[850]48 virtual void setTaQL(const std::string& taql);
[812]49
[902]50 void setSortOrder(const std::vector<std::string>& order);
[1639]51 void setRows(const std::vector<int>& rows);
[902]52
[939]53 std::vector<int> getScans() const;
54 std::vector<int> getBeams() const;
55 std::vector<int> getIFs() const;
56 std::vector<int> getPols() const;
57 std::vector<int> getCycles() const;
[1693]58 std::vector<int> getTypes() const;
[939]59 std::vector<std::string> getPolTypes() const;
60 std::string getTaQL() const { return taql_; }
61 std::vector<std::string> getSortOrder() const;
[812]62
63 casa::Table apply(const casa::Table& tab);
64 casa::Table operator()(const casa::Table& tab) { return apply(tab); };
65
[850]66 void reset() { intselections_.clear();stringselections_.clear(); taql_ = "";};
[812]67
68 bool empty() const;
69
70 std::string print();
71
[850]72protected:
[939]73 std::vector< int > getint( const std::string& key) const;
74 //std::vector< std::string > getstring( const std::string& key) const;
[850]75
76 void setint(const std::string& key, const std::vector< int >& val);
77 void setstring(const std::string& key, const std::vector< std::string >& val);
78
[812]79private:
[902]80
81 casa::Table sort(const casa::Table& tab);
82
[850]83 typedef std::map<std::string, std::vector<int> > intidmap;
84 typedef std::map<std::string, std::vector<std::string> > stringidmap;
[812]85 // has to be mutable, as to stl limitations
[850]86 mutable intidmap intselections_;
87 mutable stringidmap stringselections_;
[902]88 std::vector<std::string> poltypes_;
89 casa::Block<casa::String> order_;
[812]90 std::string taql_;
[1639]91 std::vector<int> rowselection_;
[812]92};
93
94}
95
96#endif
Note: See TracBrowser for help on using the repository browser.