1 | // |
---|
2 | // C++ Interface: STFiller |
---|
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 STFILLER_H |
---|
13 | #define STFILLER_H |
---|
14 | |
---|
15 | #include <vector> |
---|
16 | #include <string> |
---|
17 | |
---|
18 | #include <casa/aips.h> |
---|
19 | #include <casa/iostream.h> |
---|
20 | #include <casa/Utilities/CountedPtr.h> |
---|
21 | #include <casa/BasicSL/String.h> |
---|
22 | #include <casa/Arrays/Vector.h> |
---|
23 | |
---|
24 | #include "Scantable.h" |
---|
25 | #include "STHeader.h" |
---|
26 | #include "Logger.h" |
---|
27 | |
---|
28 | class PKSreader; |
---|
29 | |
---|
30 | namespace asap { |
---|
31 | |
---|
32 | /** |
---|
33 | This class fills a Scantable from external data formats using the PKSReader class. |
---|
34 | |
---|
35 | @brief A filler object for data import into Scantable |
---|
36 | @author Malte Marquarding |
---|
37 | @date 2006/01/16 |
---|
38 | @version 2.0a |
---|
39 | */ |
---|
40 | class STFiller : public Logger { |
---|
41 | public: |
---|
42 | |
---|
43 | /** |
---|
44 | * Default constructor |
---|
45 | */ |
---|
46 | STFiller(); |
---|
47 | |
---|
48 | |
---|
49 | /** |
---|
50 | * Constructor taking an existing Scantable to fill |
---|
51 | * @param stbl |
---|
52 | */ |
---|
53 | explicit STFiller(casa::CountedPtr< Scantable > stbl); |
---|
54 | |
---|
55 | |
---|
56 | /** |
---|
57 | * A constructor for a filler with associated input file |
---|
58 | * @param filename the input file (rpf,sdfite or ms) |
---|
59 | * @param whichIF read a specific IF only (default -1 means all IFs) |
---|
60 | * @param whichBeam read a specific beam only (default -1 means all beams) |
---|
61 | */ |
---|
62 | explicit STFiller( const std::string& filename, int whichIF=-1, |
---|
63 | int whichBeam=-1 ); |
---|
64 | |
---|
65 | /** |
---|
66 | * Destructor |
---|
67 | */ |
---|
68 | virtual ~STFiller(); |
---|
69 | |
---|
70 | /** |
---|
71 | * associate the Filler with a file on disk |
---|
72 | * @param filename the input file (rpf,sdfite or ms) |
---|
73 | * @param whichIF read a specific IF only (default -1 means all IFs) |
---|
74 | * @param whichBeam read a specific beam only (default -1 means all beams) |
---|
75 | * @exception AipsError Creation of PKSreader failed |
---|
76 | */ |
---|
77 | void open( const std::string& filename, int whichIF=-1, int whichBeam=-1 ); |
---|
78 | |
---|
79 | /** |
---|
80 | * detach from file and clean up pointers |
---|
81 | */ |
---|
82 | void close( ); |
---|
83 | |
---|
84 | /** |
---|
85 | * Read in "rows" from the source file attached with open() |
---|
86 | * @return a status flag passed on by PKSreader |
---|
87 | * |
---|
88 | * @li @c 0: ok |
---|
89 | * @li >0: failed |
---|
90 | */ |
---|
91 | int read( ); |
---|
92 | |
---|
93 | casa::CountedPtr<Scantable> getTable() const { return table_;} |
---|
94 | |
---|
95 | private: |
---|
96 | |
---|
97 | PKSreader* reader_; |
---|
98 | STHeader* header_; |
---|
99 | casa::String filename_; |
---|
100 | casa::CountedPtr< Scantable > table_; |
---|
101 | casa::Int nIF_, nBeam_, nPol_, nChan_; |
---|
102 | casa::uInt ifOffset_, beamOffset_; |
---|
103 | casa::Vector<casa::Bool> haveXPol_; |
---|
104 | }; |
---|
105 | |
---|
106 | } // namespace |
---|
107 | |
---|
108 | #endif |
---|