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
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(uInt 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  Int 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 
casacore::MSReader::units
const Record & units(const String &) const
this isn't what we need, right now just return an empty record
Definition: MSReader.h:93
casacore::MSReader::gotoRow
void gotoRow(uInt which)
Go to the indicated row in the MAIN table of the MS and point at all of the appropriate rows in each ...
casacore::MSReader::itsMainId
Int itsMainId
table IDs for the standard tables
Definition: MSReader.h:123
casacore::MSReader::itsProcId
Int itsProcId
Definition: MSReader.h:123
casacore::MSReader::itsFeed1Id
Int itsFeed1Id
Definition: MSReader.h:123
casacore::MSReader::itsSecUnit
Unit itsSecUnit
This possibly saves some time, Units of seconds.
Definition: MSReader.h:99
casacore::MSReader::rowNumber
Int rowNumber(const String &name) const
Return the current row number in the named table.
casacore::MSReader
Read from an MS, coordinating all of the subtables in the process.
Definition: MSReader.h:62
casacore::MSReader::itsSpwId
Int itsSpwId
Definition: MSReader.h:123
casacore::MSReader::itsWeather2Id
Int itsWeather2Id
Definition: MSReader.h:123
casacore::MSFeedIndex
Definition: MSFeedIndex.h:74
casacore::MSReader::itsTabRows
Block< ROTableRow > itsTabRows
the table rows
Definition: MSReader.h:127
casacore::MSReader::itsPointing2Index
MSPointingIndex itsPointing2Index
Definition: MSReader.h:115
casacore::MSValidIds
Definition: MSValidIds.h:69
casacore::MSFreqOffIndex
Definition: MSFreqOffIndex.h:73
casacore::MSReader::itsDDId
Int itsDDId
Definition: MSReader.h:123
casacore::MSReader::itsTabId
std::map< String, Int > itsTabId
this maps table name to an index used throughout this class
Definition: MSReader.h:104
casacore::MSReader::itsIds
MSValidIds itsIds
Definition: MSReader.h:101
casacore::MSReader::itsSyscal1Index
MSSysCalIndex itsSyscal1Index
Definition: MSReader.h:117
casacore::MSReader::itsPointing1Id
Int itsPointing1Id
Definition: MSReader.h:123
casacore::MSReader::itsWeather1Id
Int itsWeather1Id
Definition: MSReader.h:123
casacore::MSPointingIndex
Definition: MSPointingIndex.h:73
casacore::MSReader::ms
const MeasurementSet & ms() const
Return a reference to the MS.
Definition: MSReader.h:87
casacore::MSReader::itsIndexes
Block< MSTableIndex > itsIndexes
the indexes for the NS subtables
Definition: MSReader.h:107
casacore::MSReader::itsFreqOffIndex
MSFreqOffIndex itsFreqOffIndex
Definition: MSReader.h:113
casacore::MSReader::itsFlagCmdId
Int itsFlagCmdId
Definition: MSReader.h:123
casacore::MSReader::itsSourceId
Int itsSourceId
Definition: MSReader.h:123
casacore::MSReader::itsFeed1Index
MSFeedIndex itsFeed1Index
Definition: MSReader.h:111
casacore::Table
Main interface class to a read/write table.
Definition: Table.h:153
casacore::MSReader::itsAnt2Id
Int itsAnt2Id
Definition: MSReader.h:123
casacore::uInt
unsigned int uInt
Definition: aipstype.h:51
casacore::MSReader::MSReader
MSReader()
undefined and unavailable
casacore::MSReader::itsRowNumbers
Block< Int > itsRowNumbers
What row number for each table is the most recent gotoRow call.
Definition: MSReader.h:131
casacore::MSReader::~MSReader
~MSReader()
Definition: MSReader.h:68
casacore::MSReader::itsMSCols
MSColumns itsMSCols
Definition: MSReader.h:96
casacore::MSReader::itsSyscal1Id
Int itsSyscal1Id
Definition: MSReader.h:123
casacore::MSReader::itsSyscal2Index
MSSysCalIndex itsSyscal2Index
Definition: MSReader.h:118
casacore::MSReader::itsFeed2Index
MSFeedIndex itsFeed2Index
Definition: MSReader.h:112
casacore::MSReader::emptyRecord
Record emptyRecord
this empty record is returned by tableRow when the name argument does not exist
Definition: MSReader.h:134
casacore::Int
int Int
Definition: aipstype.h:50
casacore
this file contains all the compiler specific defines
Definition: mainpage.dox:28
casacore::MSReader::itsWeather1Index
MSWeatherIndex itsWeather1Index
Definition: MSReader.h:119
casacore::MSReader::table
const Table & table(const String &name) const
Return a reference to the named subtable.
casacore::MSReader::operator=
MSReader & operator=(const MSReader &)
casacore::MSReader::itsSourceIndex
MSSourceIndex itsSourceIndex
Definition: MSReader.h:116
casacore::MSReader::itsAnt1Id
Int itsAnt1Id
Definition: MSReader.h:123
casacore::MSReader::itsSyscal2Id
Int itsSyscal2Id
Definition: MSReader.h:123
casacore::MSReader::tableRow
const RecordInterface & tableRow(const String &name) const
Return the current row in the named table.
casacore::RecordInterface
Abstract base class for Record classes.
Definition: RecordInterface.h:144
casacore::MSReader::itsFeed2Id
Int itsFeed2Id
Definition: MSReader.h:123
casacore::MeasurementSet
A Table intended to hold astronomical data (a set of Measurements).
Definition: MeasurementSet.h:241
casacore::MSReader::itsDopplerIndex
MSDopplerIndex itsDopplerIndex
specific indexes
Definition: MSReader.h:110
casacore::MSReader::itsPointing1Index
MSPointingIndex itsPointing1Index
Definition: MSReader.h:114
casacore::MSReader::itsMS
MeasurementSet itsMS
Definition: MSReader.h:95
casacore::MSReader::itsDopplerId
Int itsDopplerId
Definition: MSReader.h:123
casacore::MSReader::itsFreqOffsetId
Int itsFreqOffsetId
Definition: MSReader.h:123
casacore::MSDopplerIndex
Definition: MSDopplerIndex.h:73
casacore::MSSysCalIndex
Definition: MSSysCalIndex.h:73
casacore::MSReader::itsPolId
Int itsPolId
Definition: MSReader.h:123
casacore::MSReader::itsTableNames
Vector< String > itsTableNames
Definition: MSReader.h:139
casacore::String
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Block
simple 1-D array
Definition: ArrayIO.h:47
casacore::MSReader::tables
const Vector< String > & tables() const
Definition: MSReader.h:75
casacore::Record
A hierarchical collection of named fields of various types.
Definition: Record.h:180
casacore::MSReader::itsStateId
Int itsStateId
Definition: MSReader.h:123
casacore::Unit
defines physical units
Definition: Unit.h:189
casacore::MSColumns
A class to provide easy access to MeasurementSet columns.
Definition: MSColumns.h:116
casacore::Vector
A 1-D Specialization of the Array class.
Definition: ArrayIO.h:45
casacore::MSReader::itsObsId
Int itsObsId
Definition: MSReader.h:123
casacore::MSReader::itsWeather2Index
MSWeatherIndex itsWeather2Index
Definition: MSReader.h:120
casacore::MSReader::emptyTable
Table emptyTable
this empty table is returned by table when the name argument does not exist
Definition: MSReader.h:137
casacore::MSSourceIndex
Definition: MSSourceIndex.h:74
casacore::MSReader::itsPointing2Id
Int itsPointing2Id
Definition: MSReader.h:123
casacore::MSWeatherIndex
Definition: MSWeatherIndex.h:73
casacore::MSReader::itsFieldId
Int itsFieldId
Definition: MSReader.h:123