casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSSpWindowIndex.h
Go to the documentation of this file.
1 //# MSSpWindowIndex: index/lookup in a MeasurementSet SPECTRAL_WINDOW subtable
2 //# Copyright (C) 2000,2001,2002
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_MSSPWINDOWINDEX_H
30 #define MS_MSSPWINDOWINDEX_H
31 
32 //# includes
33 #include <casacore/casa/aips.h>
39 
40 namespace casacore { //# NAMESPACE CASACORE - BEGIN
41 
42 //# forward declarations
43 
44 // <summary>
45 // Class to handle lookup or indexing into a MS SPECTRAL_WINDOW subtable
46 // </summary>
47 
48 // <use visibility=export>
49 //
50 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
51 // </reviewed>
52 
53 // <prerequisite>
54 // <li> MeasurementSet
55 // <li> MSSpWindowription
56 // </prerequisite>
57 //
58 // <etymology>
59 // From "MeasurementSet", "SPECTRAL_WINDOW subtable" and "index".
60 // </etymology>
61 //
62 // <synopsis>
63 // This class provides lookup and indexing into an MS SPECTRAL_WINDOW
64 // subtable. These services include returning rows numbers
65 // (which for the SPECTRAL_WINDOW subtable are SPECTRAL_WINDOW_ID's)
66 // associated with specific data in the subtable.
67 // </synopsis>
68 //
69 // <example>
70 // </example>
71 //
72 // <motivation>
73 // Collect together all subtable indexing and lookup for the
74 // SPECTRAL_WINDOW subtable, for encapsulation and efficiency.
75 // </motivation>
76 //
77 // <thrown>
78 // <li>
79 // <li>
80 // </thrown>
81 //
82 
84 {
85 public:
86  // Construct from an MS SPECTRAL_WINDOW subtable
87  MSSpWindowIndex(const MSSpectralWindow& spectralWindow);
88 
89  // Null destructor
90  virtual ~MSSpWindowIndex() {}
91 
92  // Look up SPECTRAL_WINDOW_ID's for a given frequency group or groups
93  Vector<Int> matchFreqGrp(const Int& freqGrp);
94  Vector<Int> matchFreqGrp(const Vector<Int>& freqGrps);
95 
96  // Look up SPECTRAL_WINDOW_ID's for a given frequency group name
97  Vector<Int> matchFreqGrpName(const String& freqGrpName);
98 
99  // Look up SPECTRAL_WINDOW_ID's for a given frequency axis sampling
100  Vector<Int> matchFreq(const Vector<MFrequency>& chanFreq,
101  const Vector<MVFrequency>& chanWidth,
102  const Double& freqTol);
103 
104 private:
105  // Disallow null constructor
106  MSSpWindowIndex();
107 
108  // SPECTRAL_WINDOW subtable column accessor
110 
111  // Vector cache of SpWindow id's
114 };
115 
116 
117 } //# NAMESPACE CASACORE - END
118 
119 #endif
120 
Class to handle lookup or indexing into a MS SPECTRAL_WINDOW subtable.
Vector< Int > spWindowIds_p
Vector cache of SpWindow id&#39;s.
int Int
Definition: aipstype.h:50
MSSpWindowColumns msSpWindowCols_p
SPECTRAL_WINDOW subtable column accessor.
virtual ~MSSpWindowIndex()
Null destructor.
Vector< Int > matchFreqGrpName(const String &freqGrpName)
Look up SPECTRAL_WINDOW_ID&#39;s for a given frequency group name.
double Double
Definition: aipstype.h:55
A class to provide easy access to MSSpectralWindow columns.
Vector< Int > matchFreqGrp(const Int &freqGrp)
Look up SPECTRAL_WINDOW_ID&#39;s for a given frequency group or groups.
MSSpWindowIndex()
Disallow null constructor.
String: the storage and methods of handling collections of characters.
Definition: String.h:225
Vector< Int > matchFreq(const Vector< MFrequency > &chanFreq, const Vector< MVFrequency > &chanWidth, const Double &freqTol)
Look up SPECTRAL_WINDOW_ID&#39;s for a given frequency axis sampling.
A Table intended to hold a MeasurementSet SPECTRAL_WINDOW table.