casacore
Loading...
Searching...
No Matches
MSSourceIndex.h
Go to the documentation of this file.
1// # MSSourceIndex: index into a MeasurementSet SOURCE 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: 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_MSSOURCEINDEX_H
27#define MS_MSSOURCEINDEX_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/ms/MSSel/MSTableIndex.h>
31#include <casacore/ms/MeasurementSets/MSSourceColumns.h>
32
33#include <casacore/casa/Containers/RecordField.h>
34
35namespace casacore { // # NAMESPACE CASACORE - BEGIN
36
37// # forward declarations
38class MSSource;
39
40// <summary>
41// </summary>
42
43// <use visibility=export>
44
45// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
46// </reviewed>
47
48// <prerequisite>
49// <li> MeasurementSet
50// <li> MSTableIndex
51// </prerequisite>
52//
53// <etymology>
54// </etymology>
55//
56// <synopsis>
57// </synopsis>
58//
59// <example>
60// </example>
61//
62// <motivation>
63// </motivation>
64//
65// <thrown>
66// <li>
67// <li>
68// </thrown>
69//
70
72 public:
73 // no index attached, use the attach function or assignment operator to change that
75
76 // construct one using the indicated SOURCE table
77 MSSourceIndex(const MSSource& source);
78
79 // construct one from another
81
82 virtual ~MSSourceIndex();
83
85
86 void attach(const MSSource& source);
87
88 // access to the source ID key, throws an exception if isNull() is False
89 Int& sourceId() { return *sourceId_p; }
90
91 // access to the spectral window ID key, throws an
92 // exception if isNull() is False
94
95 // Match a source name or list of source names to a set of SOURCE_ID's
98
99 // add for source code selection
101
102 // Return rows matching a SourceID
104
105 protected:
106 // the specialized compare function to pass to the
107 // <linkto class=ColumnsIndex>ColumnsIndex</linkto> object. This supports -1
108 // values for the SPECTRAL_WINDOW_ID
109 static Int compare(const Block<void*>& fieldPtrs, const Block<void*>& dataPtrs,
110 const Block<Int>& dataTypes, rownr_t index);
111
112 private:
113 // Pointer to local MSSourceColumns object
115
117
118 void attachIds();
119};
120
121} // namespace casacore
122
123#endif
static Int compare(const Block< void * > &fieldPtrs, const Block< void * > &dataPtrs, const Block< Int > &dataTypes, rownr_t index)
the specialized compare function to pass to the ColumnsIndex object.
RowNumbers getRowNumbersOfSourceID(const Int sid)
Return rows matching a SourceID.
MSSourceIndex(const MSSource &source)
construct one using the indicated SOURCE table
Vector< Int > matchSourceCode(const String &code)
add for source code selection
void attach(const MSSource &source)
MSSourceColumns * msSourceCols_p
Pointer to local MSSourceColumns object.
MSSourceIndex & operator=(const MSSourceIndex &other)
RecordFieldPtr< Int > sourceId_p
RecordFieldPtr< Int > spwId_p
Vector< Int > matchSourceName(const String &name)
Match a source name or list of source names to a set of SOURCE_ID's.
Vector< Int > matchSourceName(const Vector< String > &names)
MSSourceIndex()
no index attached, use the attach function or assignment operator to change that
Int & sourceId()
access to the source ID key, throws an exception if isNull() is False
MSSourceIndex(const MSSourceIndex &other)
construct one from another
Int & spectralWindowId()
access to the spectral window ID key, throws an exception if isNull() is False
MSTableIndex()
no index attached, use the attach function or assignment operator to change that
String: the storage and methods of handling collections of characters.
Definition String.h:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
String name() const
Return the name of the field.
int Int
Definition aipstype.h:48
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44