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
50String 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
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) {
100 return ! (lhs == rhs);
101}
102
103// construct scan keys given a set of scan numbers and an ArrayKey
104std::set<ScanKey> scanKeys(const std::set<Int>& scans, const ArrayKey& arrayKey);
105
106// represents primary key in the SOURCE table
107struct SourceKey {
108 // SOURCE_ID column
111};
112
113// define operator<() so it can be used as a key in std::map
114Bool operator<(const SourceKey& lhs, const SourceKey& rhs);
115
116// get a set of unique ArrayKeys from a set of ScanKeys
117std::set<ArrayKey> uniqueArrayKeys(const std::set<ScanKey>& scanKeys);
118
119// given a set of scan keys, return the subset that matches the given array key
120std::set<ScanKey> filter(const std::set<ScanKey> scans, const ArrayKey& arrayKey);
121
122}
123
124#endif
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
ostream & operator<<(ostream &os, const IComplex &)
Show on ostream.
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
bool operator==(const casacore_allocator< T, ALIGNMENT > &, const casacore_allocator< T, ALIGNMENT > &)
Definition Allocator.h:127
bool operator!=(const casacore_allocator< T, ALIGNMENT > &, const casacore_allocator< T, ALIGNMENT > &)
Definition Allocator.h:133
Bool operator<(const MVTime &lh, const MVTime &rh)
Definition MVTime.h:466
String toString(const SubScanKey &subScanKey)
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
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
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:107
uInt id
SOURCE_ID column.
Definition MSKeys.h:109
A sub scan is a unique combination of observation ID, array ID, scan number, and field ID.
Definition MSKeys.h:40