casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>
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
66  MSReader(const MeasurementSet &ms);
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
142  MSReader();
143  MSReader(const MSReader &);
144  MSReader& operator=(const MSReader &);
145 };
146 
147 
148 } //# NAMESPACE CASACORE - END
149 
150 #endif
151 
A 1-D Specialization of the Array class.
Definition: ArrayFwd.h:9
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition: aipsxtype.h:38
MSSourceIndex itsSourceIndex
Definition: MSReader.h:116
int Int
Definition: aipstype.h:50
Unit itsSecUnit
This possibly saves some time, Units of seconds.
Definition: MSReader.h:99
Block< ROTableRow > itsTabRows
the table rows
Definition: MSReader.h:127
Main interface class to a read/write table.
Definition: Table.h:157
const Record & units(const String &) const
this isn&#39;t what we need, right now just return an empty record
Definition: MSReader.h:93
MSValidIds itsIds
Definition: MSReader.h:101
const RecordInterface & tableRow(const String &name) const
Return the current row in the named table.
const MeasurementSet & ms() const
Return a reference to the MS.
Definition: MSReader.h:87
Int itsMainId
table IDs for the standard tables
Definition: MSReader.h:123
Block< Int64 > itsRowNumbers
What row number for each table is the most recent gotoRow call.
Definition: MSReader.h:131
Block< MSTableIndex > itsIndexes
the indexes for the NS subtables
Definition: MSReader.h:107
MSSysCalIndex itsSyscal1Index
Definition: MSReader.h:117
const Vector< String > & tables() const
Definition: MSReader.h:75
defines physical units
Definition: Unit.h:189
MSFreqOffIndex itsFreqOffIndex
Definition: MSReader.h:113
MSFeedIndex itsFeed1Index
Definition: MSReader.h:111
MSPointingIndex itsPointing2Index
Definition: MSReader.h:115
MSSysCalIndex itsSyscal2Index
Definition: MSReader.h:118
MSWeatherIndex itsWeather1Index
Definition: MSReader.h:119
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
MSReader()
undefined and unavailable
std::map< String, Int > itsTabId
this maps table name to an index used throughout this class
Definition: MSReader.h:104
Table emptyTable
this empty table is returned by table when the name argument does not exist
Definition: MSReader.h:137
MSFeedIndex itsFeed2Index
Definition: MSReader.h:112
A hierarchical collection of named fields of various types.
Definition: Record.h:180
MSPointingIndex itsPointing1Index
Definition: MSReader.h:114
MeasurementSet itsMS
Definition: MSReader.h:95
Read from an MS, coordinating all of the subtables in the process.
Definition: MSReader.h:62
A Table intended to hold astronomical data (a set of Measurements).
MSDopplerIndex itsDopplerIndex
specific indexes
Definition: MSReader.h:110
simple 1-D array
Definition: Allocator.h:210
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 ...
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46
Int64 rowNumber(const String &name) const
Return the current row number in the named table.
A class to provide easy access to MeasurementSet columns.
Definition: MSColumns.h:116
const Table & table(const String &name) const
Return a reference to the named subtable.
String: the storage and methods of handling collections of characters.
Definition: String.h:225
MSWeatherIndex itsWeather2Index
Definition: MSReader.h:120
Vector< String > itsTableNames
Definition: MSReader.h:139
Abstract base class for Record classes.
MSReader & operator=(const MSReader &)