casacore
MS1ToMS2Converter.h
Go to the documentation of this file.
1 //# MS1ToMS2Converter.h: Definition for ms1 to ms2 converter
2 //# Copyright (C) 1994,1995,1996,1997,1998,1999,2000
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef MS_MS1TOMS2CONVERTER_H
29 #define MS_MS1TOMS2CONVERTER_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
33 #include <casacore/tables/Tables/Table.h>
34 #include <casacore/casa/Logging/LogIO.h>
35 
36 namespace casacore { //# NAMESPACE CASACORE - BEGIN
37 
38 //# Forward declarations
39 class String;
40 
41 
42 // <summary>
43 // Class to convert a MeasurementSet v1 to v2.
44 // </summary>
45 
46 // <use visibility=export>
47 
48 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
49 // </reviewed>
50 
51 // <synopsis>
52 // This class converts a version 1 MeasurementSet to version 2.
53 // The keyword MS_VERSION tells the version. If not present it is 1.
54 // If it is found that the MS is already a version 2 one, nothing is done.
55 // <p>
56 // It is possible to do the conversion in place. If not, first a copy
57 // is made which is thereafter changed in place.
58 // <br>
59 // The conversion process does the following steps:
60 // <ul>
61 // <li> Create the newly required columns and keywords
62 // and fill them with new or existing data.
63 // <li> Convert the old way of defining measure info to the new
64 // TableMeasures way.
65 // <li> Rename obsolete columns by prefixing their names with _OBSOLETE_.
66 // </ul>
67 //
68 // The constructor only keeps the names of the input and output MS.
69 // The actual conversion is done by the <src>convert</src> function.
70 // </synopsis>
71 
72 
74 {
75 public:
76  // Create the converter for the given output (ms2) and input (ms1) name.
77  // The input name has to be an MS version 1. If not, nothing will be done.
78  // <br>If <src>inPlace==True</src>, the ms2 name is ignored. In that
79  // case the ms is changed in place.
81  const String& ms1,
82  Bool inPlace);
83 
85 
86  // Do the actual conversion.
88 
89 private:
90  // Forbid copy constrcutor and assignment.
91  // <group>
94  // </group>
95 
96  // If possible remove a column from the table.
97  // Otherwise rename it by prefixing it with _OBSOLETE_.
98  void removeColumn(Table& t, const String& col);
99 
100 
104 
105  // Logger
107 };
108 
109 
110 
111 } //# NAMESPACE CASACORE - END
112 
113 #endif
MS1ToMS2Converter & operator=(const MS1ToMS2Converter &)
MS1ToMS2Converter(const MS1ToMS2Converter &)
Forbid copy constrcutor and assignment.
Bool convert()
Do the actual conversion.
MS1ToMS2Converter(const String &ms2, const String &ms1, Bool inPlace)
Create the converter for the given output (ms2) and input (ms1) name.
void removeColumn(Table &t, const String &col)
If possible remove a column from the table.
String: the storage and methods of handling collections of characters.
Definition: String.h:225
this file contains all the compiler specific defines
Definition: mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42