// // C++ Interface: MSWriter // // Description: // // This class is specific writer for MS format // // Takeshi Nakazato , (C) 2010 // // Copyright: See COPYING file that comes with this distribution // // #ifndef ASAPMSWRITER_H #define ASAPMSWRITER_H // STL #include // AIPS++ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "Scantable.h" #include "STHeader.h" namespace asap { class MSWriterUtils { protected: template void putField( const String &name, TableRecord &r, T &val ) { RecordFieldPtr rf( r, name ) ; *rf = val ; } template void defineField( const String &name, TableRecord &r, T &val ) { RecordFieldPtr rf( r, name ) ; rf.define( val ) ; } }; class MSWriter { public: explicit MSWriter(casa::CountedPtr stable) ; virtual ~MSWriter() ; virtual bool write(const std::string& filename, const casa::Record& rec) ; protected: private: // initialize writer from input Scantable void init() ; // set up MS void setupMS() ; // fill subtables void fillObservation() ; void fillAntenna() ; void fillProcessor() ; void fillSource() ; void fillWeather() ; void fillSysCal() ; // utility void getValidTimeRange( casa::Double &me, casa::Double &interval, casa::Table &tab ) ; void getValidTimeRange( casa::Double &me, casa::Double &interval, casa::Vector &atime, casa::Vector &ainterval ) ; void antennaProperty( casa::String &name, casa::String &mount, casa::String &type, casa::Double &diameter ) ; casa::CountedPtr table_ ; STHeader header_ ; casa::MeasurementSet *mstable_ ; casa::Bool isWeather_ ; casa::Bool useFloatData_ ; casa::Bool useData_ ; casa::Bool tcalSpec_ ; casa::Bool tsysSpec_ ; casa::String ptTabName_ ; casa::String polType_ ; casa::String filename_ ; casa::LogIO os_ ; casa::Record srcRec_ ; MSWriter(); MSWriter(const MSWriter&); MSWriter& operator=(const MSWriter&); }; }; #endif