source: trunk/src/MSWriter.h @ 1974

Last change on this file since 1974 was 1974, checked in by Takeshi Nakazato, 13 years ago

New Development: Yes

JIRA Issue: Yes CAS-2718

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: New class msfiller and mswriter added

Test Programs: List test programs

Put in Release Notes: No

Module(s): Module Names change impacts.

Description: Describe your changes here...

New filler/writer specific for Scantable-MS conversion defined.
This is not called from scantable constructor right now.
However, you can call it by explicitly importing msfiller/mswriter.


File size: 1.6 KB
Line 
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>
22#include <casa/Logging/LogIO.h>
23
24#include <tables/Tables/RefRows.h>
25
26#include <ms/MeasurementSets/MeasurementSet.h>
27#include <ms/MeasurementSets/MSColumns.h>
28
29#include "Scantable.h"
30#include "STHeader.h"
31
32namespace asap
33{
34
35class MSWriter
36{
37public:
38  explicit MSWriter(casa::CountedPtr<Scantable> stable) ;
39  virtual ~MSWriter() ;
40 
41  virtual bool write(const std::string& filename, const casa::Record& rec) ;
42 
43protected:
44 
45 
46private:
47
48  // initialize writer from input Scantable
49  void init() ;
50
51  // set up MS
52  void setupMS() ;
53 
54  // fill subtables
55  void fillObservation() ;
56  void fillAntenna() ;
57  void addFeed( casa::Int id ) ;
58  void addSpectralWindow( casa::Int spwid, casa::Int freqid ) ;
59  casa::Int addPolarization( casa::Vector<casa::Int> polnos ) ;
60  casa::Int addDataDescription( casa::Int polid, casa::Int spwid ) ;
61
62  // utility
63  casa::Vector<casa::Int> toCorrType( casa::Vector<casa::Int> polnos ) ;
64
65  casa::CountedPtr<Scantable> table_ ;
66  STHeader header_ ;
67  casa::CountedPtr<casa::MeasurementSet> mstable_ ;
68
69  casa::Bool isFloatData_ ;
70  casa::Bool isData_ ;
71  casa::String polType_ ;
72
73  casa::String filename_ ;
74
75  casa::LogIO os_ ;
76 
77  MSWriter();
78  MSWriter(const MSWriter&);
79  MSWriter& operator=(const MSWriter&);
80
81};
82
83
84};
85#endif
Note: See TracBrowser for help on using the repository browser.