| 1 | // | 
|---|
| 2 | // C++ Interface: FillerBase | 
|---|
| 3 | // | 
|---|
| 4 | // Description: | 
|---|
| 5 | // | 
|---|
| 6 | // This class is the Base class for all data fillers. | 
|---|
| 7 | // The derived filler needs to implement | 
|---|
| 8 | // open() | 
|---|
| 9 | // close() | 
|---|
| 10 | // fill() | 
|---|
| 11 | // | 
|---|
| 12 | // The fill() method usually iterates over the source data and calls | 
|---|
| 13 | // the setXYZ() methods for. After all the data for a row has been set via | 
|---|
| 14 | // these methods, the fill() method needs to call commitRow() to write the | 
|---|
| 15 | // data to the scantable. | 
|---|
| 16 | // All arguments which are defaulted in the setXYZ() methods are optional. All | 
|---|
| 17 | // others should be set explicitly. | 
|---|
| 18 | // | 
|---|
| 19 | // Author: Malte Marquarding <asap@atnf.csiro.au>, (C) 2010 | 
|---|
| 20 | // | 
|---|
| 21 | // Copyright: See COPYING file that comes with this distribution | 
|---|
| 22 | // | 
|---|
| 23 | // | 
|---|
| 24 | #ifndef ASAPFILLERBASE_H | 
|---|
| 25 | #define ASAPFILLERBASE_H | 
|---|
| 26 |  | 
|---|
| 27 | // STL | 
|---|
| 28 | #include <string> | 
|---|
| 29 | #include <vector> | 
|---|
| 30 | // AIPS++ | 
|---|
| 31 | #include <casa/aips.h> | 
|---|
| 32 |  | 
|---|
| 33 | namespace asap | 
|---|
| 34 | { | 
|---|
| 35 |  | 
|---|
| 36 | class FillerBase | 
|---|
| 37 | { | 
|---|
| 38 | public: | 
|---|
| 39 | FillerBase(); | 
|---|
| 40 | FillerBase(casa::CountedPtr<Scantable> stable); | 
|---|
| 41 | virtual ~FillerBase(); | 
|---|
| 42 |  | 
|---|
| 43 | virtual bool open(const std::string& filename)=0; | 
|---|
| 44 | virtual void fill() = 0; | 
|---|
| 45 | virtual void close() = 0; | 
|---|
| 46 |  | 
|---|
| 47 | protected: | 
|---|
| 48 |  | 
|---|
| 49 | casa::CountedPtr<Scantable> getTable(); | 
|---|
| 50 | void commitRow(); | 
|---|
| 51 | virtual void setHeader(const STHeader& header); | 
|---|
| 52 | virtual void setSpectrum(const casa::Vector<Float>& spectrum, | 
|---|
| 53 | const casa::Vector<uChar>& flags) ; | 
|---|
| 54 | virtual void setIndex(uInt scanno, uInt cycleno, uInt ifno, uInt polno, | 
|---|
| 55 | uInt beamno=0); | 
|---|
| 56 | virtual void setFrequency(casa::Double refpix, casa::Double refval, | 
|---|
| 57 | casa::Double incr); | 
|---|
| 58 | virtual void setMolecule(casa::Double restfreq); | 
|---|
| 59 | virtual void setDirection(const casa::Vector<Double>& dir, | 
|---|
| 60 | casa::Float az=0.0f, casa::Float el=0.0f); | 
|---|
| 61 |  | 
|---|
| 62 | virtual void setFocus(casa::Float pa=0.0f, casa::Float faxis=0.0f, | 
|---|
| 63 | casa::Float ftan=0.0f, casa::Float frot=0.0f) | 
|---|
| 64 | virtual void setTime(casa::Double mjd, casa::Double integration); | 
|---|
| 65 | virtual void setWeather(casa::Float temperature=0.0f, | 
|---|
| 66 | casa::Float pressure=0.0f, | 
|---|
| 67 | casa::Float humidity=0.0f, | 
|---|
| 68 | casa::Float windspeed=0.0f, | 
|---|
| 69 | casa::Float windaz=0.0f); | 
|---|
| 70 | virtual void setTcal(const casa::String& caltime="", | 
|---|
| 71 | const casa::Vector<Float>& tcal=casa::Vector<Float>()) | 
|---|
| 72 | virtual void setScanRate(const casa::Vector<Double>& srate=casa::Vector<Double>()); | 
|---|
| 73 | virtual void setReferenceBeam(Int beamno=-1); | 
|---|
| 74 | virtual void setSource(const std::string& name, Int type, | 
|---|
| 75 | const std::string& fieldname="", | 
|---|
| 76 | const casa::Vector<Double>& dircasa::Vector<Double>(), | 
|---|
| 77 | const casa::Vector<Double>& propermot=casa::Vector<Double>(), | 
|---|
| 78 | Double velocity=0.0); | 
|---|
| 79 |  | 
|---|
| 80 | private: | 
|---|
| 81 |  | 
|---|
| 82 | casa::CountedPtr< Scantable > table_; | 
|---|
| 83 | casa::String referenceRx_; | 
|---|
| 84 |  | 
|---|
| 85 | casa::TableRow row_; | 
|---|
| 86 | } | 
|---|
| 87 |  | 
|---|
| 88 |  | 
|---|
| 89 | }; | 
|---|