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