Loading...
Searching...
No Matches
MSKeys.h
Go to the documentation of this file.
//# Copyright (C) 1998,1999,2000,2001
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: casa-feedback@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
#ifndef MS_MSKEYS_H
#define MS_MSKEYS_H
#include <casacore/casa/aips.h>
#include <set>
#include <ostream>
namespace casacore {
class String;
// A sub scan is a unique combination of observation ID, array ID, scan number,
// and field ID. Negative values are allowed to indicate all values of the particular
// ID are desired.
struct SubScanKey {
Int obsID;
Int arrayID;
Int scan;
Int fieldID;
};
// define operator<() so it can be used as a key in std::map
Bool operator<(const SubScanKey& lhs, const SubScanKey& rhs);
String toString(const SubScanKey& subScanKey);
std::ostream& operator<<(std::ostream& os, const SubScanKey& scanKey);
// A scan is a unique combination of observation ID, array ID, and scan number
// Negative values are allowed to indicate all values of the particular
// ID are desired.
struct ScanKey {
Int obsID;
Int arrayID;
Int scan;
};
// create a ScanKey from a SubScanKey, just omits the SubScanKey's fieldID
inline ScanKey scanKey(const SubScanKey& subScanKey) {
ScanKey key;
key.obsID = subScanKey.obsID;
key.arrayID = subScanKey.arrayID;
key.scan = subScanKey.scan;
return key;
}
String toString(const ScanKey& scanKey);
// define operator<() so it can be used as a key in std::map
Bool operator<(const ScanKey& lhs, const ScanKey& rhs);
Bool operator==(const ScanKey& lhs, const ScanKey& rhs);
// extract all the unique scan numbers from the specified scans
std::set<Int> scanNumbers(const std::set<ScanKey>& scanKeys);
std::ostream& operator<<(std::ostream& os, const ScanKey& scanKey);
// An ArrayKey is a unique combination of observation ID and array ID
// Negative values are allowed to indicate all values of the particular
// ID are desired.
struct ArrayKey {
Int obsID;
Int arrayID;
};
// define operator<() so it can be used as a key in std::map
Bool operator<(const ArrayKey& lhs, const ArrayKey& rhs);
inline Bool operator==(const ArrayKey& lhs, const ArrayKey& rhs) {
return lhs.arrayID == rhs.arrayID && lhs.obsID == rhs.obsID;
}
inline Bool operator!=(const ArrayKey& lhs, const ArrayKey& rhs) {
return ! (lhs == rhs);
}
// construct scan keys given a set of scan numbers and an ArrayKey
std::set<ScanKey> scanKeys(const std::set<Int>& scans, const ArrayKey& arrayKey);
// represents primary key in the SOURCE table
struct SourceKey {
// SOURCE_ID column
uInt id;
uInt spw;
};
// define operator<() so it can be used as a key in std::map
Bool operator<(const SourceKey& lhs, const SourceKey& rhs);
// get a set of unique ArrayKeys from a set of ScanKeys
std::set<ArrayKey> uniqueArrayKeys(const std::set<ScanKey>& scanKeys);
// given a set of scan keys, return the subset that matches the given array key
std::set<ScanKey> filter(const std::set<ScanKey> scans, const ArrayKey& arrayKey);
}
#endif
casacore::String
String: the storage and methods of handling collections of characters.
Definition String.h:223
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28
casacore::operator<<
ostream & operator<<(ostream &os, const IComplex &)
Show on ostream.
casacore::uInt
unsigned int uInt
Definition aipstype.h:49
casacore::scanKey
ScanKey scanKey(const SubScanKey &subScanKey)
create a ScanKey from a SubScanKey, just omits the SubScanKey's fieldID
Definition MSKeys.h:64
casacore::filter
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
casacore::operator==
bool operator==(const casacore_allocator< T, ALIGNMENT > &, const casacore_allocator< T, ALIGNMENT > &)
Definition Allocator.h:122
casacore::operator!=
bool operator!=(const casacore_allocator< T, ALIGNMENT > &, const casacore_allocator< T, ALIGNMENT > &)
Definition Allocator.h:128
casacore::operator<
Bool operator<(const MVTime &lh, const MVTime &rh)
Definition MVTime.h:466
casacore::toString
String toString(const SubScanKey &subScanKey)
casacore::Int
int Int
Definition aipstype.h:48
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
casacore::scanKeys
std::set< ScanKey > scanKeys(const std::set< Int > &scans, const ArrayKey &arrayKey)
construct scan keys given a set of scan numbers and an ArrayKey
casacore::scanNumbers
std::set< Int > scanNumbers(const std::set< ScanKey > &scanKeys)
extract all the unique scan numbers from the specified scans
casacore::uniqueArrayKeys
std::set< ArrayKey > uniqueArrayKeys(const std::set< ScanKey > &scanKeys)
get a set of unique ArrayKeys from a set of ScanKeys
casacore::ArrayKey
An ArrayKey is a unique combination of observation ID and array ID Negative values are allowed to ind...
Definition MSKeys.h:87
casacore::ArrayKey::arrayID
Int arrayID
Definition MSKeys.h:89
casacore::ArrayKey::obsID
Int obsID
Definition MSKeys.h:88
casacore::ScanKey
A scan is a unique combination of observation ID, array ID, and scan number Negative values are allow...
Definition MSKeys.h:57
casacore::ScanKey::obsID
Int obsID
Definition MSKeys.h:58
casacore::ScanKey::arrayID
Int arrayID
Definition MSKeys.h:59
casacore::ScanKey::scan
Int scan
Definition MSKeys.h:60
casacore::SourceKey
represents primary key in the SOURCE table
Definition MSKeys.h:107
casacore::SourceKey::id
uInt id
SOURCE_ID column.
Definition MSKeys.h:109
casacore::SourceKey::spw
uInt spw
Definition MSKeys.h:110
casacore::SubScanKey
A sub scan is a unique combination of observation ID, array ID, scan number, and field ID.
Definition MSKeys.h:40
casacore::SubScanKey::obsID
Int obsID
Definition MSKeys.h:41
casacore::SubScanKey::arrayID
Int arrayID
Definition MSKeys.h:42
casacore::SubScanKey::fieldID
Int fieldID
Definition MSKeys.h:44
casacore::SubScanKey::scan
Int scan
Definition MSKeys.h:43