source: trunk/src/STFiller.h@ 2890

Last change on this file since 2890 was 2658, checked in by Malte Marquarding, 12 years ago

Ticket #199: Excised Logger::pushLog; now everything is using LogIO

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
RevLine 
[805]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
[2]14
15#include <vector>
16#include <string>
17
[81]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>
[2]23
[805]24#include "Scantable.h"
[901]25#include "STHeader.h"
[2]26
[2658]27
[2]28class PKSreader;
[1819]29class NROReader;
[2]30
[83]31namespace asap {
[2]32
[805]33/**
34This class fills a Scantable from external data formats using the PKSReader class.
35
[846]36@brief A filler object for data import into Scantable
[805]37@author Malte Marquarding
38@date 2006/01/16
39@version 2.0a
40*/
[2658]41class STFiller {
[2]42public:
43
[846]44 /**
45 * Default constructor
46 */
[805]47 STFiller();
[2]48
[846]49
50 /**
51 * Constructor taking an existing Scantable to fill
52 * @param stbl
53 */
[1353]54 explicit STFiller(casa::CountedPtr< Scantable > stbl);
[2]55
56
[805]57 /**
58 * A constructor for a filler with associated input file
59 * @param filename the input file (rpf,sdfite or ms)
60 * @param whichIF read a specific IF only (default -1 means all IFs)
61 * @param whichBeam read a specific beam only (default -1 means all beams)
62 */
[1353]63 explicit STFiller( const std::string& filename, int whichIF=-1,
[1819]64 int whichBeam=-1 );
[2]65
[846]66 /**
67 * Destructor
68 */
[996]69 virtual ~STFiller();
[717]70
[805]71 /**
72 * associate the Filler with a file on disk
73 * @param filename the input file (rpf,sdfite or ms)
74 * @param whichIF read a specific IF only (default -1 means all IFs)
75 * @param whichBeam read a specific beam only (default -1 means all beams)
76 * @exception AipsError Creation of PKSreader failed
77 */
[1819]78 void open( const std::string& filename, const std::string& antenna, int whichIF=-1, int whichBeam=-1, casa::Bool getPt=casa::False );
[805]79
80 /**
[846]81 * detach from file and clean up pointers
[805]82 */
83 void close( );
84
85 /**
86 * Read in "rows" from the source file attached with open()
87 * @return a status flag passed on by PKSreader
[846]88 *
89 * @li @c 0: ok
90 * @li >0: failed
[805]91 */
92 int read( );
93
94 casa::CountedPtr<Scantable> getTable() const { return table_;}
95
[1819]96 /**
97 * For NRO data
98 *
99 * 2008/11/11 Takeshi Nakazato
100 *
101 * openNRO : NRO version of open(), which performs to open file and
102 * read header data.
103 *
104 * readNRO : NRO version of read(), which performs to read scan
105 * records.
106 *
107 * fileCheck: Identify a type (NRO data or not) of filename_.
108 **/
109 void openNRO( int whichIF=-1, int whichBeam=-1 ) ;
110 int readNRO() ;
111 casa::Bool fileCheck() ;
112
[1504]113 void setReferenceExpr(const std::string& rx) { refRx_ = rx; }
114
[2]115private:
[805]116
117 PKSreader* reader_;
[901]118 STHeader* header_;
[125]119 casa::String filename_;
[805]120 casa::CountedPtr< Scantable > table_;
[1391]121 casa::Int nIF_, nBeam_, nPol_, nChan_, nInDataRow;
[805]122 casa::uInt ifOffset_, beamOffset_;
[1060]123 casa::Vector<casa::Bool> haveXPol_;
[1504]124 casa::String refRx_;
[1819]125 NROReader *nreader_ ;
126 casa::Bool isNRO_ ;
[2]127};
128
[805]129} // namespace
130
[2]131#endif
Note: See TracBrowser for help on using the repository browser.