source: branches/asap-3.x/src/STFiller.h@ 2811

Last change on this file since 2811 was 1504, checked in by Malte Marquarding, 16 years ago

Fix for ticket #151: added facilities to help with on/off scan identification/setting

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
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
28class PKSreader;
29
30namespace asap {
31
32/**
33This 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*/
40class STFiller : public Logger {
41public:
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 void setReferenceExpr(const std::string& rx) { refRx_ = rx; }
96
97private:
98
99 PKSreader* reader_;
100 STHeader* header_;
101 casa::String filename_;
102 casa::CountedPtr< Scantable > table_;
103 casa::Int nIF_, nBeam_, nPol_, nChan_, nInDataRow;
104 casa::uInt ifOffset_, beamOffset_;
105 casa::Vector<casa::Bool> haveXPol_;
106 casa::String refRx_;
107};
108
109} // namespace
110
111#endif
Note: See TracBrowser for help on using the repository browser.