[1778] | 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 | // AIPS++
|
---|
| 30 | #include <casa/aips.h>
|
---|
[1780] | 31 | #include <casa/Utilities/CountedPtr.h>
|
---|
| 32 | #include <casa/Arrays/Vector.h>
|
---|
| 33 | #include <tables/Tables/TableRow.h>
|
---|
| 34 | #include "Scantable.h"
|
---|
[1778] | 35 |
|
---|
| 36 | namespace asap
|
---|
| 37 | {
|
---|
| 38 |
|
---|
| 39 | class FillerBase
|
---|
| 40 | {
|
---|
| 41 | public:
|
---|
[1786] | 42 | explicit FillerBase(casa::CountedPtr<Scantable> stable);
|
---|
[1795] | 43 | virtual ~FillerBase() {;}
|
---|
[1778] | 44 |
|
---|
[1904] | 45 | virtual bool open(const std::string& filename, const casa::Record& rec) = 0;
|
---|
| 46 | // virtual bool open(const std::string& filename) = 0;
|
---|
[1778] | 47 | virtual void fill() = 0;
|
---|
| 48 | virtual void close() = 0;
|
---|
| 49 |
|
---|
[1786] | 50 | void setReferenceRegex(const std::string& rx) { referenceRx_ = rx; }
|
---|
[1793] | 51 | std::string getReferenceRegex() { return referenceRx_; }
|
---|
[1786] | 52 |
|
---|
[1778] | 53 | protected:
|
---|
| 54 |
|
---|
| 55 | void commitRow();
|
---|
[1803] | 56 | void setHeader(const STHeader& header);
|
---|
| 57 | void setSpectrum(const casa::Vector<casa::Float>& spectrum,
|
---|
[1788] | 58 | const casa::Vector<casa::uChar>& flags,
|
---|
[1803] | 59 | const casa::Vector<casa::Float>& tsys);
|
---|
| 60 | void setFlagrow(casa::uInt flag);
|
---|
| 61 | void setOpacity(casa::Float opacity=0.0f);
|
---|
| 62 | void setIndex(casa::uInt scanno, casa::uInt cycleno,
|
---|
[1780] | 63 | casa::uInt ifno, casa::uInt polno,
|
---|
| 64 | casa::uInt beamno=0);
|
---|
[1803] | 65 | void setFrequency(casa::Double refpix, casa::Double refval,
|
---|
[1778] | 66 | casa::Double incr);
|
---|
[1803] | 67 | void setMolecule(const casa::Vector<casa::Double>& restfreq);
|
---|
| 68 | void setDirection(const casa::Vector<casa::Double>& dir,
|
---|
[1778] | 69 | casa::Float az=0.0f, casa::Float el=0.0f);
|
---|
| 70 |
|
---|
[1803] | 71 | void setFocus(casa::Float pa=0.0f, casa::Float faxis=0.0f,
|
---|
[1780] | 72 | casa::Float ftan=0.0f, casa::Float frot=0.0f);
|
---|
[1803] | 73 | void setTime(casa::Double mjd, casa::Double integration);
|
---|
| 74 | void setWeather(casa::Float temperature=0.0f,
|
---|
[1778] | 75 | casa::Float pressure=0.0f,
|
---|
| 76 | casa::Float humidity=0.0f,
|
---|
| 77 | casa::Float windspeed=0.0f,
|
---|
| 78 | casa::Float windaz=0.0f);
|
---|
[2247] | 79 | void setWeather2(casa::Float temperature=0.0f,
|
---|
| 80 | casa::Float pressure=0.0f,
|
---|
| 81 | casa::Float humidity=0.0f,
|
---|
| 82 | casa::Float windspeed=0.0f,
|
---|
| 83 | casa::Float windaz=0.0f);
|
---|
[1803] | 84 | void setTcal(const casa::String& caltime="",
|
---|
[1780] | 85 | const casa::Vector<casa::Float>& tcal=casa::Vector<casa::Float>());
|
---|
[2247] | 86 | void setTcal2(const casa::String& caltime="",
|
---|
| 87 | const casa::Vector<casa::Float>& tcal=casa::Vector<casa::Float>());
|
---|
[1803] | 88 | void setScanRate(const casa::Vector<casa::Double>& srate=casa::Vector<casa::Double>());
|
---|
| 89 | void setReferenceBeam(casa::Int beamno=-1);
|
---|
| 90 | void setSource(const std::string& name, casa::Int type,
|
---|
[1778] | 91 | const std::string& fieldname="",
|
---|
[1780] | 92 | const casa::Vector<casa::Double>& dir=casa::Vector<casa::Double>(),
|
---|
| 93 | const casa::Vector<casa::Double>& propermot=casa::Vector<casa::Double>(),
|
---|
| 94 | casa::Double velocity=0.0);
|
---|
[1778] | 95 |
|
---|
[1793] | 96 | casa::CountedPtr< Scantable > table_;
|
---|
[1795] | 97 |
|
---|
[1778] | 98 | private:
|
---|
| 99 |
|
---|
[1811] | 100 | FillerBase();
|
---|
| 101 | FillerBase(const FillerBase&);
|
---|
| 102 | FillerBase& operator=(const FillerBase&);
|
---|
[1778] | 103 | casa::String referenceRx_;
|
---|
| 104 | casa::TableRow row_;
|
---|
[1780] | 105 | };
|
---|
[1778] | 106 |
|
---|
| 107 |
|
---|
| 108 | };
|
---|
[1780] | 109 | #endif
|
---|