casacore
MSReader.h
Go to the documentation of this file.
1 //# MSReader.h: read from a MS, coordinating all of the subtables
2 //# Copyright (C) 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 //#
27 //# $Id$
28 
29 #ifndef MS_MSREADER_H
30 #define MS_MSREADER_H
31 
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/Arrays/Vector.h>
34 #include <casacore/casa/Containers/Block.h>
35 #include <casacore/casa/Containers/Record.h>
36 #include <casacore/ms/MeasurementSets/MeasurementSet.h>
37 #include <casacore/ms/MeasurementSets/MSColumns.h>
38 #include <casacore/ms/MSSel/MSDopplerIndex.h>
39 #include <casacore/ms/MSSel/MSFeedIndex.h>
40 #include <casacore/ms/MSSel/MSFreqOffIndex.h>
41 #include <casacore/ms/MSSel/MSPointingIndex.h>
42 #include <casacore/ms/MSSel/MSSourceIndex.h>
43 #include <casacore/ms/MSSel/MSSysCalIndex.h>
44 #include <casacore/ms/MSSel/MSTableIndex.h>
45 #include <casacore/ms/MSSel/MSWeatherIndex.h>
46 #include <casacore/ms/MSOper/MSValidIds.h>
47 #include <casacore/tables/Tables/TableRow.h>
48 #include <casacore/casa/Quanta/Unit.h>
49 #include <casacore/casa/BasicSL/String.h>
50 #include <map>
51 
52 namespace casacore { //# NAMESPACE CASACORE - BEGIN
53 
54 // <summary>
55 // Read from an MS, coordinating all of the subtables in the process
56 // </summary>
57 
58 // <use visibility=local>
59 
60 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
61 // </reviewed>
62 class MSReader
63 {
64 public:
65  // Attach to the indicated MeasurementSet
67 
68  ~MSReader() {;}
69 
70  // Go to the indicated row in the MAIN table of the MS and point
71  // at all of the appropriate rows in each of the subtables as
72  // a result of going to this row.
73  void gotoRow(rownr_t which);
74 
75  const Vector<String> &tables() const {return itsTableNames;}
76 
77  // Return the current row in the named table. Use rowNumber to
78  // check to see that the most recent gotoRow actually found a matching
79  // row.
80  const RecordInterface &tableRow(const String &name) const;
81 
82  // Return the current row number in the named table. This returns
83  // -1 if that table has no row as a result of the most recent gotoRow.
84  Int64 rowNumber(const String &name) const;
85 
86  // Return a reference to the MS
87  const MeasurementSet &ms() const {return itsMS;}
88 
89  // Return a reference to the named subtable
90  const Table &table(const String &name) const;
91 
92  // this isn't what we need, right now just return an empty record
93  const Record &units(const String &) const { return emptyRecord;}
94 private:
97 
98  // This possibly saves some time, Units of seconds
100 
102 
103  // this maps table name to an index used throughout this class
104  std::map<String, Int> itsTabId;
105 
106  // the indexes for the NS subtables
108 
109  // specific indexes
121 
122  // table IDs for the standard tables
126  // the table rows
128 
129  // What row number for each table is the most recent gotoRow call. Set to
130  // -1 if there was no matching row as a result of that call.
132 
133  // this empty record is returned by tableRow when the name argument does not exist
135 
136  // this empty table is returned by table when the name argument does not exist
138 
140 
141  // undefined and unavailable
143  MSReader(const MSReader &);
145 };
146 
147 
148 } //# NAMESPACE CASACORE - END
149 
150 #endif
151 
simple 1-D array
Definition: Block.h:200
MSPointingIndex itsPointing2Index
Definition: MSReader.h:115
MSSysCalIndex itsSyscal1Index
Definition: MSReader.h:117
MSReader()
undefined and unavailable
Table emptyTable
this empty table is returned by table when the name argument does not exist
Definition: MSReader.h:137
const Record & units(const String &) const
this isn't what we need, right now just return an empty record
Definition: MSReader.h:93
MSSysCalIndex itsSyscal2Index
Definition: MSReader.h:118
MSWeatherIndex itsWeather2Index
Definition: MSReader.h:120
Vector< String > itsTableNames
Definition: MSReader.h:139
Unit itsSecUnit
This possibly saves some time, Units of seconds.
Definition: MSReader.h:99
MSWeatherIndex itsWeather1Index
Definition: MSReader.h:119
MSReader(const MeasurementSet &ms)
Attach to the indicated MeasurementSet.
MSFeedIndex itsFeed1Index
Definition: MSReader.h:111
MSPointingIndex itsPointing1Index
Definition: MSReader.h:114
Block< ROTableRow > itsTabRows
the table rows
Definition: MSReader.h:127
MSReader(const MSReader &)
const MeasurementSet & ms() const
Return a reference to the MS.
Definition: MSReader.h:87
Int64 rowNumber(const String &name) const
Return the current row number in the named table.
Block< Int64 > itsRowNumbers
What row number for each table is the most recent gotoRow call.
Definition: MSReader.h:131
const Vector< String > & tables() const
Definition: MSReader.h:75
MSFeedIndex itsFeed2Index
Definition: MSReader.h:112
void gotoRow(rownr_t which)
Go to the indicated row in the MAIN table of the MS and point at all of the appropriate rows in each ...
MSSourceIndex itsSourceIndex
Definition: MSReader.h:116
MSDopplerIndex itsDopplerIndex
specific indexes
Definition: MSReader.h:110
MSValidIds itsIds
Definition: MSReader.h:101
MSReader & operator=(const MSReader &)
Int itsMainId
table IDs for the standard tables
Definition: MSReader.h:123
MSColumns itsMSCols
Definition: MSReader.h:96
Record emptyRecord
this empty record is returned by tableRow when the name argument does not exist
Definition: MSReader.h:134
const RecordInterface & tableRow(const String &name) const
Return the current row in the named table.
MeasurementSet itsMS
Definition: MSReader.h:95
Block< MSTableIndex > itsIndexes
the indexes for the NS subtables
Definition: MSReader.h:107
MSFreqOffIndex itsFreqOffIndex
Definition: MSReader.h:113
const Table & table(const String &name) const
Return a reference to the named subtable.
std::map< String, Int > itsTabId
this maps table name to an index used throughout this class
Definition: MSReader.h:104
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
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition: aipsxtype.h:38
int Int
Definition: aipstype.h:50
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46