MSKeys.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef MS_MSKEYS_H
00028 #define MS_MSKEYS_H
00029
00030 #include <casacore/casa/aips.h>
00031
00032 #include <set>
00033 #include <ostream>
00034
00035 namespace casacore {
00036
00037 class String;
00038
00039
00040
00041
00042 struct SubScanKey {
00043 Int obsID;
00044 Int arrayID;
00045 Int scan;
00046 Int fieldID;
00047 };
00048
00049
00050 Bool operator<(const SubScanKey& lhs, const SubScanKey& rhs);
00051
00052 String toString(const SubScanKey& subScanKey);
00053
00054 std::ostream& operator<<(std::ostream& os, const SubScanKey& scanKey);
00055
00056
00057
00058
00059 struct ScanKey {
00060 Int obsID;
00061 Int arrayID;
00062 Int scan;
00063 };
00064
00065
00066 inline ScanKey scanKey(const SubScanKey& subScanKey) {
00067 ScanKey key;
00068 key.obsID = subScanKey.obsID;
00069 key.arrayID = subScanKey.arrayID;
00070 key.scan = subScanKey.scan;
00071 return key;
00072 }
00073
00074 String toString(const ScanKey& scanKey);
00075
00076
00077 Bool operator<(const ScanKey& lhs, const ScanKey& rhs);
00078
00079 Bool operator==(const ScanKey& lhs, const ScanKey& rhs);
00080
00081
00082 std::set<Int> scanNumbers(const std::set<ScanKey>& scanKeys);
00083
00084 std::ostream& operator<<(std::ostream& os, const ScanKey& scanKey);
00085
00086
00087
00088
00089 struct ArrayKey {
00090 Int obsID;
00091 Int arrayID;
00092 };
00093
00094
00095 Bool operator<(const ArrayKey& lhs, const ArrayKey& rhs);
00096
00097 inline Bool operator==(const ArrayKey& lhs, const ArrayKey& rhs) {
00098 return lhs.arrayID == rhs.arrayID && lhs.obsID == rhs.obsID;
00099 }
00100
00101 inline Bool operator!=(const ArrayKey& lhs, const ArrayKey& rhs) {
00102 return ! (lhs == rhs);
00103 }
00104
00105
00106 std::set<ScanKey> scanKeys(const std::set<Int>& scans, const ArrayKey& arrayKey);
00107
00108
00109 struct SourceKey {
00110
00111 uInt id;
00112 uInt spw;
00113 };
00114
00115
00116 Bool operator<(const SourceKey& lhs, const SourceKey& rhs);
00117
00118
00119 std::set<ArrayKey> uniqueArrayKeys(const std::set<ScanKey>& scanKeys);
00120
00121
00122 std::set<ScanKey> filter(const std::set<ScanKey> scans, const ArrayKey& arrayKey);
00123
00124 }
00125
00126 #endif