casacore
Loading...
Searching...
No Matches
MSFieldIndex.h
Go to the documentation of this file.
1//# MSFieldIndex: index or lookup in a MeasurementSet FIELD subtable
2//# Copyright (C) 2000,2001
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_MSFIELDINDEX_H
27#define MS_MSFIELDINDEX_H
28
29//# includes
30#include <casacore/casa/aips.h>
31#include <casacore/ms/MeasurementSets/MSField.h>
32#include <casacore/ms/MSSel/MSSelectionError.h>
33#include <casacore/ms/MeasurementSets/MSFieldColumns.h>
34#include <casacore/casa/Arrays/Vector.h>
35#include <casacore/casa/BasicSL/String.h>
36
37namespace casacore { //# NAMESPACE CASACORE - BEGIN
38
39//# forward declarations
40
41// <summary>
42// Class to handle lookup or indexing into a MS FIELD subtable
43// </summary>
44
45// <use visibility=export>
46//
47// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
48// </reviewed>
49
50// <prerequisite>
51// <li> MeasurementSet
52// <li> MSField
53// </prerequisite>
54//
55// <etymology>
56// From "MeasurementSet", "FIELD subtable" and "index".
57// </etymology>
58//
59// <synopsis>
60// This class provides lookup and indexing into an MS FIELD
61// subtable. These services include returning rows numbers
62// (which for the FIELD subtable are FIELD_ID's) associated
63// with specific data in the subtable.
64// </synopsis>
65//
66// <example>
67// </example>
68//
69// <motivation>
70// Collect together all subtable indexing and lookup for the
71// FIELD subtable, for encapsulation and efficiency.
72// </motivation>
73//
74// <thrown>
75// <li>
76// <li>
77// </thrown>
78//
79
81{
82public:
83 // Construct from an MS FIELD subtable
84 MSFieldIndex(const MSField &field);
85
86 // Null destructor
87 virtual ~MSFieldIndex() {}
88
89 // Look up a single name in FIELD.NAME or FIELD.CODE
91 // Look up FIELD_ID's for a given field name, or set of field names
94
95 //ADD for file name wildcard selection
97
98 // Look up FIELD_ID's for a given pattern/regex for source name/code
100 const Bool regex=False);
102 const Bool regex=False);
104 const Bool regex=False);
105 // Look up FIELD_ID's for a given source id
106 Vector<Int> matchSourceId(const Int& sourceId);
110
111 // Add for field code selection
113
115
118 Vector<Int> matchFieldIDGTAndLT(const Int n0, const int n1);
119private:
120 // Disallow null constructor
122
123 // FIELD subtable column accessor
125
126 // Vector cache of field id's
129};
130
131
132} //# NAMESPACE CASACORE - END
133
134#endif
135
Vector< Int > matchFieldRegexOrPattern(const String &pattern, const Bool regex=False)
Look up FIELD_ID's for a given pattern/regex for source name/code.
Vector< Int > matchFieldName(const Vector< String > &names)
Vector< Int > matchFieldIDGT(const Int n)
Vector< Int > matchFieldName(const String &name)
Look up FIELD_ID's for a given field name, or set of field names.
Vector< Int > matchSourceId(const Int &sourceId)
Look up FIELD_ID's for a given source id.
MSFieldColumns msFieldCols_p
FIELD subtable column accessor.
Vector< Int > matchFieldCodeRegexOrPattern(const String &pattern, const Bool regex=False)
Vector< Int > matchFieldIDLT(const Int n)
Vector< Int > maskFieldIDs(const Vector< Int > &ids)
MSFieldIndex()
Disallow null constructor.
Vector< Int > fieldIds_p
Vector cache of field id's.
MSFieldIndex(const MSField &field)
Construct from an MS FIELD subtable.
Vector< Int > matchFieldCode(const String &code)
Add for field code selection.
Vector< Int > matchSourceId(const Vector< Int > &sourceIds)
Vector< Int > matchFieldNameRegexOrPattern(const String &pattern, const Bool regex=False)
Vector< Int > matchFieldNameOrCode(const String &name)
Look up a single name in FIELD.NAME or FIELD.CODE.
Vector< Int > matchSubFieldName(const String &name)
ADD for file name wildcard selection.
void matchIdAgainstNames(Vector< Int > &ids)
Vector< Int > validateIndices(const Vector< Int > &sourceIds)
Vector< Int > matchFieldIDGTAndLT(const Int n0, const int n1)
virtual ~MSFieldIndex()
Null destructor.
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
TableExprNode pattern(const TableExprNode &node)
Definition ExprNode.h:1491
const Bool False
Definition aipstype.h:42
TableExprNode regex(const TableExprNode &node)
Functions for regular expression matching and pattern matching.
Definition ExprNode.h:1487
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40