source: trunk/src/MSWriter.h@ 2072

Last change on this file since 2072 was 2026, checked in by Takeshi Nakazato, 14 years ago

New Development: No

JIRA Issue: Yes CAS-2718

Ready for Test: Yes

Interface Changes: 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...

  1. Fill MOUNT and DISH_DIAMETER columns in ANTENNA subtable.
  2. Commented out messages for debugging and tuning.
File size: 3.0 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>
[1974]25
[1975]26#include <tables/Tables/Table.h>
[1974]27#include <tables/Tables/RefRows.h>
28
29#include <ms/MeasurementSets/MeasurementSet.h>
30#include <ms/MeasurementSets/MSColumns.h>
31
[1975]32#include <measures/Measures/MEpoch.h>
33
[1977]34#include <atnf/PKSIO/SrcType.h>
35
[1974]36#include "Scantable.h"
37#include "STHeader.h"
38
39namespace asap
40{
41
42class MSWriter
43{
44public:
45 explicit MSWriter(casa::CountedPtr<Scantable> stable) ;
46 virtual ~MSWriter() ;
47
48 virtual bool write(const std::string& filename, const casa::Record& rec) ;
49
50protected:
51
52
53private:
54
55 // initialize writer from input Scantable
56 void init() ;
57
58 // set up MS
59 void setupMS() ;
60
61 // fill subtables
62 void fillObservation() ;
63 void fillAntenna() ;
[1975]64 void fillProcessor() ;
65 void fillSource() ;
[1977]66 void fillWeather() ;
67 void fillSysCal() ;
[1975]68
69 // add rows to subtables
[1974]70 void addFeed( casa::Int id ) ;
71 void addSpectralWindow( casa::Int spwid, casa::Int freqid ) ;
[1975]72 void addField( casa::Int fid, casa::String fieldname, casa::String srcname, casa::Double t, casa::Vector<casa::Double> scanrate ) ;
[2016]73 void addPointing( casa::String &name, casa::Double &me, casa::Double &interval, casa::Matrix<casa::Double> &dir ) ;
[1974]74 casa::Int addPolarization( casa::Vector<casa::Int> polnos ) ;
75 casa::Int addDataDescription( casa::Int polid, casa::Int spwid ) ;
[1977]76 casa::Int addState( casa::Int type, casa::Int &subscan ) ;
[1974]77
78 // utility
79 casa::Vector<casa::Int> toCorrType( casa::Vector<casa::Int> polnos ) ;
[2016]80 void getValidTimeRange( casa::Double &me, casa::Double &interval, casa::Table &tab ) ;
[2018]81 void getValidTimeRange( casa::Double &me, casa::Double &interval, casa::Vector<casa::Double> &atime, casa::Vector<casa::Double> &ainterval ) ;
[2016]82 //void queryType( casa::Int type, casa::String &stype, casa::Bool &b ) ;
83 void queryType( casa::Int type, casa::String &stype, casa::Bool &b, casa::Double &t, Double &l ) ;
[2026]84 casa::Double getDishDiameter( casa::String antname ) ;
[1974]85
[2016]86 // tool for HPC
87 double gettimeofday_sec() ;
88
[1974]89 casa::CountedPtr<Scantable> table_ ;
90 STHeader header_ ;
[2016]91 //casa::CountedPtr<casa::MeasurementSet> mstable_ ;
92 casa::MeasurementSet *mstable_ ;
[1974]93
[2019]94 casa::Bool isTcal_ ;
95 casa::Bool isWeather_ ;
96
[1977]97 casa::Bool useFloatData_ ;
98 casa::Bool useData_ ;
99 casa::Bool tcalSpec_ ;
100 casa::Bool tsysSpec_ ;
101
[2016]102 casa::String ptTabName_ ;
103
[1974]104 casa::String polType_ ;
105
106 casa::String filename_ ;
107
108 casa::LogIO os_ ;
[1977]109
110 casa::Record tcalIdRec_ ;
[2016]111 casa::Record tcalRowRec_ ;
[1974]112
113 MSWriter();
114 MSWriter(const MSWriter&);
115 MSWriter& operator=(const MSWriter&);
116
117};
118
119
120};
121#endif
Note: See TracBrowser for help on using the repository browser.