[1974] | 1 | //
|
---|
| 2 | // C++ Interface: MSFiller
|
---|
| 3 | //
|
---|
| 4 | // Description:
|
---|
| 5 | //
|
---|
| 6 | // This class is specific filler for MS format
|
---|
| 7 | //
|
---|
| 8 | // Takeshi Nakazato <takeshi.nakazato@nao.ac.jp>, (C) 2010
|
---|
| 9 | //
|
---|
| 10 | // Copyright: See COPYING file that comes with this distribution
|
---|
| 11 | //
|
---|
| 12 | //
|
---|
| 13 | #ifndef ASAPMSFILLER_H
|
---|
| 14 | #define ASAPMSFILLER_H
|
---|
| 15 |
|
---|
| 16 | // STL
|
---|
| 17 | #include <string>
|
---|
[1987] | 18 |
|
---|
| 19 | // Boost
|
---|
| 20 | #include <boost/pool/object_pool.hpp>
|
---|
| 21 |
|
---|
[1974] | 22 | // AIPS++
|
---|
| 23 | #include <casa/aips.h>
|
---|
| 24 | #include <casa/Utilities/CountedPtr.h>
|
---|
| 25 | #include <casa/Arrays/Vector.h>
|
---|
[1987] | 26 | #include <casa/Arrays/Matrix.h>
|
---|
[1974] | 27 | #include <casa/Logging/LogIO.h>
|
---|
| 28 |
|
---|
| 29 | #include <casa/Containers/Record.h>
|
---|
| 30 |
|
---|
[1987] | 31 | //#include <tables/Tables/TableColumn.h>
|
---|
| 32 |
|
---|
[1974] | 33 | #include <ms/MeasurementSets/MeasurementSet.h>
|
---|
[1987] | 34 | #include <ms/MeasurementSets/MSPointing.h>
|
---|
[1974] | 35 |
|
---|
| 36 | #include "Scantable.h"
|
---|
| 37 |
|
---|
| 38 | namespace asap
|
---|
| 39 | {
|
---|
| 40 |
|
---|
| 41 | class MSFiller
|
---|
| 42 | {
|
---|
| 43 | public:
|
---|
| 44 | explicit MSFiller(casa::CountedPtr<Scantable> stable) ;
|
---|
| 45 | virtual ~MSFiller() ;
|
---|
| 46 |
|
---|
| 47 | virtual bool open(const std::string& filename, const casa::Record& rec) ;
|
---|
| 48 | virtual void fill() ;
|
---|
| 49 | virtual void close() ;
|
---|
| 50 |
|
---|
| 51 | protected:
|
---|
| 52 |
|
---|
| 53 |
|
---|
| 54 | private:
|
---|
| 55 |
|
---|
| 56 | MSFiller();
|
---|
| 57 | MSFiller(const MSFiller&);
|
---|
| 58 | MSFiller& operator=(const MSFiller&);
|
---|
| 59 |
|
---|
| 60 | // fill subtables
|
---|
| 61 | //void fillFrequencies() ;
|
---|
| 62 | //void fillMolecules() ;
|
---|
| 63 | void fillWeather() ;
|
---|
| 64 | void fillFocus() ;
|
---|
| 65 | //void fillHistory() ;
|
---|
| 66 | //void fillFit() ;
|
---|
[1987] | 67 | void fillTcal( boost::object_pool<casa::ROTableColumn> *pool ) ;
|
---|
[1974] | 68 |
|
---|
| 69 | // get SRCTYPE from STATE_ID
|
---|
[1987] | 70 | casa::Int getSrcType( casa::Int stateId, boost::object_pool<casa::ROTableColumn> *pool ) ;
|
---|
| 71 | //casa::Int getSrcType( casa::Int stateId ) ;
|
---|
[1974] | 72 |
|
---|
| 73 | // get POLNO from CORR_TYPE
|
---|
| 74 | casa::Vector<casa::uInt> getPolNo( casa::Int corrType ) ;
|
---|
| 75 |
|
---|
| 76 | // get poltype from CORR_TYPE
|
---|
| 77 | casa::String getPolType( casa::Int corrType ) ;
|
---|
| 78 |
|
---|
| 79 | // get WEATHER_ID
|
---|
| 80 | casa::uInt getWeatherId( casa::uInt idx, casa::Double wtime ) ;
|
---|
| 81 |
|
---|
| 82 | // get time stamp in SYSCAL table
|
---|
| 83 | // assume that tab is selected by ANTENNA_ID, FEED_ID, SPECTRAL_WINDOW_ID
|
---|
| 84 | // and sorted by TIME
|
---|
| 85 | casa::Vector<casa::Double> getSysCalTime( casa::MSSysCal &tab, casa::MEpoch::ROScalarColumn &tcol ) ;
|
---|
| 86 |
|
---|
| 87 | // get tsys by time stamp
|
---|
| 88 | // assume that tab is selected by ANTENNA_ID, FEED_ID, SPECTRAL_WINDOW_ID
|
---|
| 89 | // and sorted by TIME
|
---|
[1987] | 90 | casa::uInt getTsys( casa::uInt idx, casa::Matrix<casa::Float> &tsys, casa::MSSysCal &tab, casa::Double t ) ;
|
---|
[1974] | 91 |
|
---|
| 92 | // get TCAL_ID
|
---|
| 93 | casa::Vector<casa::uInt> getTcalId( casa::Int feedId, casa::Int spwId, casa::Double t ) ;
|
---|
| 94 |
|
---|
| 95 | // get direction for DIRECTION, AZIMUTH, and ELEVATION columns
|
---|
[1987] | 96 | casa::uInt getDirection( casa::uInt idx, casa::Vector<casa::Double> &dir, casa::Vector<casa::Double> &srate, casa::String &ref, casa::MSPointing &tab, casa::Double t ) ;
|
---|
[1974] | 97 |
|
---|
| 98 | casa::CountedPtr<Scantable> table_ ;
|
---|
| 99 | casa::MeasurementSet mstable_ ;
|
---|
[1987] | 100 | casa::String tablename_ ;
|
---|
[1974] | 101 | casa::Int antenna_ ;
|
---|
| 102 | casa::Bool getPt_ ;
|
---|
| 103 |
|
---|
| 104 | casa::Bool isFloatData_ ;
|
---|
| 105 | casa::Bool isData_ ;
|
---|
| 106 |
|
---|
| 107 | casa::Bool isDoppler_ ;
|
---|
| 108 | casa::Bool isFlagCmd_ ;
|
---|
| 109 | casa::Bool isFreqOffset_ ;
|
---|
| 110 | casa::Bool isHistory_ ;
|
---|
| 111 | casa::Bool isProcessor_ ;
|
---|
| 112 | casa::Bool isSysCal_ ;
|
---|
| 113 | casa::Bool isWeather_ ;
|
---|
| 114 |
|
---|
| 115 | casa::LogIO os_ ;
|
---|
| 116 |
|
---|
| 117 | casa::Vector<casa::Double> mwTime_ ;
|
---|
| 118 | casa::Vector<casa::Double> mwInterval_ ;
|
---|
| 119 |
|
---|
[1987] | 120 | // Record for TCAL_ID
|
---|
| 121 | // "FIELD0": "SPW0": Vector<uInt>
|
---|
| 122 | // "SPW1": Vector<uInt>
|
---|
| 123 | // ...
|
---|
[1974] | 124 | casa::Record tcalrec_ ;
|
---|
[1987] | 125 |
|
---|
| 126 | //casa::ROTableColumn *scCol_ ;
|
---|
[1974] | 127 | };
|
---|
| 128 |
|
---|
| 129 |
|
---|
| 130 | };
|
---|
| 131 | #endif
|
---|