source: trunk/src/MSWriter.h @ 3106

Last change on this file since 3106 was 3106, checked in by Takeshi Nakazato, 8 years ago

New Development: No

JIRA Issue: No

Ready for Test: Yes/No?

Interface Changes: Yes/No?

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...


Check-in asap modifications from Jim regarding casacore namespace conversion.

File size: 2.7 KB
RevLine 
[1974]1//
2// C++ Interface: MSWriter
3//
4// Description:
5//
6// This class is specific writer 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 ASAPMSWRITER_H
14#define ASAPMSWRITER_H
15
16// STL
17#include <string>
18// AIPS++
19#include <casa/aips.h>
20#include <casa/Utilities/CountedPtr.h>
21#include <casa/Arrays/Vector.h>
[1977]22#include <casa/Arrays/Matrix.h>
[1974]23#include <casa/Logging/LogIO.h>
[1977]24#include <casa/Containers/Record.h>
[2291]25#include <casa/Containers/RecordField.h>
[1974]26
[1975]27#include <tables/Tables/Table.h>
[1974]28#include <tables/Tables/RefRows.h>
29
30#include <ms/MeasurementSets/MeasurementSet.h>
31#include <ms/MeasurementSets/MSColumns.h>
32
[1975]33#include <measures/Measures/MEpoch.h>
34
[1977]35#include <atnf/PKSIO/SrcType.h>
36
[1974]37#include "Scantable.h"
38#include "STHeader.h"
39
40namespace asap
41{
[2291]42class MSWriterUtils
43{
44protected:
45  template<class T> void putField( const String &name,
46                                   TableRecord &r,
47                                   T &val )
48  {
49    RecordFieldPtr<T> rf( r, name ) ;
50    *rf = val ;
51  }
52  template<class T> void defineField( const String &name,
53                                      TableRecord &r,
54                                      T &val )
55  {
56    RecordFieldPtr<T> rf( r, name ) ;
57    rf.define( val ) ;
58  }
59};
[1974]60
61class MSWriter
62{
63public:
[3106]64  explicit MSWriter(casacore::CountedPtr<Scantable> stable) ;
[1974]65  virtual ~MSWriter() ;
66 
[3106]67  virtual bool write(const std::string& filename, const casacore::Record& rec) ;
[1974]68 
69protected:
70 
71 
72private:
73
74  // initialize writer from input Scantable
75  void init() ;
76
77  // set up MS
78  void setupMS() ;
79 
80  // fill subtables
81  void fillObservation() ;
82  void fillAntenna() ;
[1975]83  void fillProcessor() ;
84  void fillSource() ;
[1977]85  void fillWeather() ;
[2309]86  void fillSysCal() ;
[1975]87
[1974]88  // utility
[3106]89  void getValidTimeRange( casacore::Double &me, casacore::Double &interval, casacore::Table &tab ) ;
90  void getValidTimeRange( casacore::Double &me, casacore::Double &interval, casacore::Vector<casacore::Double> &atime, casacore::Vector<casacore::Double> &ainterval ) ;
91  void antennaProperty( casacore::String &name, casacore::String &mount, casacore::String &type, casacore::Double &diameter ) ;
[1974]92
[3106]93  casacore::CountedPtr<Scantable> table_ ;
[1974]94  STHeader header_ ;
[3106]95  casacore::MeasurementSet *mstable_ ;
[1974]96
[3106]97  casacore::Bool isWeather_ ;
[2019]98
[3106]99  casacore::Bool useFloatData_ ;
100  casacore::Bool useData_ ;
101  casacore::Bool tcalSpec_ ;
102  casacore::Bool tsysSpec_ ;
[1977]103
[3106]104  casacore::String ptTabName_ ;
[2016]105
[3106]106  casacore::String polType_ ;
[1974]107
[3106]108  casacore::String filename_ ;
[1974]109
[3106]110  casacore::LogIO os_ ;
[1977]111
[3106]112  casacore::Record srcRec_ ;
[1974]113 
114  MSWriter();
115  MSWriter(const MSWriter&);
116  MSWriter& operator=(const MSWriter&);
117
118};
119
120
121};
122#endif
Note: See TracBrowser for help on using the repository browser.