casacore
Loading...
Searching...
No Matches
MSKeys.h
Go to the documentation of this file.
1// # Copyright (C) 1998,1999,2000,2001
2// # Associated Universities, Inc. Washington DC, USA.
3// #
4// # This library is free software; you can redistribute it and/or modify it
5// # under the terms of the GNU Library General Public License as published by
6// # the Free Software Foundation; either version 2 of the License, or (at your
7// # option) any later version.
8// #
9// # This library is distributed in the hope that it will be useful, but WITHOUT
10// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12// # License for more details.
13// #
14// # You should have received a copy of the GNU Library General Public License
15// # along with this library; if not, write to the Free Software Foundation,
16// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17// #
18// # Correspondence concerning AIPS++ should be addressed as follows:
19// # Internet email: casa-feedback@nrao.edu.
20// # Postal address: AIPS++ Project Office
21// # National Radio Astronomy Observatory
22// # 520 Edgemont Road
23// # Charlottesville, VA 22903-2475 USA
24
25#ifndef MS_MSKEYS_H
26#define MS_MSKEYS_H
27
28#include <casacore/casa/aips.h>
29
30#include <set>
31#include <ostream>
32
33namespace casacore {
34
35class String;
36
37// A sub scan is a unique combination of observation ID, array ID, scan number,
38// and field ID. Negative values are allowed to indicate all values of the particular
39// ID are desired.
46
47// define operator<() so it can be used as a key in std::map
48Bool operator<(const SubScanKey& lhs, const SubScanKey& rhs);
49
50std::string toString(const SubScanKey& subScanKey);
51
52std::ostream& operator<<(std::ostream& os, const SubScanKey& scanKey);
53
54// A scan is a unique combination of observation ID, array ID, and scan number
55// Negative values are allowed to indicate all values of the particular
56// ID are desired.
62
63// create a ScanKey from a SubScanKey, just omits the SubScanKey's fieldID
64inline ScanKey scanKey(const SubScanKey& subScanKey) {
65 ScanKey key;
66 key.obsID = subScanKey.obsID;
67 key.arrayID = subScanKey.arrayID;
68 key.scan = subScanKey.scan;
69 return key;
70}
71
72std::string toString(const ScanKey& scanKey);
73
74// define operator<() so it can be used as a key in std::map
75Bool operator<(const ScanKey& lhs, const ScanKey& rhs);
76
77Bool operator==(const ScanKey& lhs, const ScanKey& rhs);
78
79// extract all the unique scan numbers from the specified scans
80std::set<Int> scanNumbers(const std::set<ScanKey>& scanKeys);
81
82std::ostream& operator<<(std::ostream& os, const ScanKey& scanKey);
83
84// An ArrayKey is a unique combination of observation ID and array ID
85// Negative values are allowed to indicate all values of the particular
86// ID are desired.
91
92// define operator<() so it can be used as a key in std::map
93Bool operator<(const ArrayKey& lhs, const ArrayKey& rhs);
94
95inline Bool operator==(const ArrayKey& lhs, const ArrayKey& rhs) {
96 return lhs.arrayID == rhs.arrayID && lhs.obsID == rhs.obsID;
97}
98
99inline Bool operator!=(const ArrayKey& lhs, const ArrayKey& rhs) { return !(lhs == rhs); }
100
101// construct scan keys given a set of scan numbers and an ArrayKey
102std::set<ScanKey> scanKeys(const std::set<Int>& scans, const ArrayKey& arrayKey);
103
104// represents primary key in the SOURCE table
105struct SourceKey {
106 // SOURCE_ID column
109};
110
111// define operator<() so it can be used as a key in std::map
112Bool operator<(const SourceKey& lhs, const SourceKey& rhs);
113
114// get a set of unique ArrayKeys from a set of ScanKeys
115std::set<ArrayKey> uniqueArrayKeys(const std::set<ScanKey>& scanKeys);
116
117// given a set of scan keys, return the subset that matches the given array key
118std::set<ScanKey> filter(const std::set<ScanKey> scans, const ArrayKey& arrayKey);
119
120} // namespace casacore
121
122#endif
String: the storage and methods of handling collections of characters.
Definition String.h:355
bool operator==(const String &x, const String &y)
Global comparison operators.
Definition String.h:849
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
ostream & operator<<(ostream &os, const IComplex &)
Show on ostream.
bool operator<(const String &x, const String &y)
Definition String.h:853
unsigned int uInt
Definition aipstype.h:49
ScanKey scanKey(const SubScanKey &subScanKey)
create a ScanKey from a SubScanKey, just omits the SubScanKey's fieldID
Definition MSKeys.h:64
std::set< ScanKey > filter(const std::set< ScanKey > scans, const ArrayKey &arrayKey)
given a set of scan keys, return the subset that matches the given array key
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
std::set< ScanKey > scanKeys(const std::set< Int > &scans, const ArrayKey &arrayKey)
construct scan keys given a set of scan numbers and an ArrayKey
bool operator!=(const String &x, const String &y)
Definition String.h:850
std::set< Int > scanNumbers(const std::set< ScanKey > &scanKeys)
extract all the unique scan numbers from the specified scans
std::set< ArrayKey > uniqueArrayKeys(const std::set< ScanKey > &scanKeys)
get a set of unique ArrayKeys from a set of ScanKeys
std::string toString(const SubScanKey &subScanKey)
An ArrayKey is a unique combination of observation ID and array ID Negative values are allowed to ind...
Definition MSKeys.h:87
A scan is a unique combination of observation ID, array ID, and scan number Negative values are allow...
Definition MSKeys.h:57
represents primary key in the SOURCE table
Definition MSKeys.h:105
uInt id
SOURCE_ID column.
Definition MSKeys.h:107
A sub scan is a unique combination of observation ID, array ID, scan number, and field ID.
Definition MSKeys.h:40