29 #ifndef MS_MEASUREMENTSET_H
30 #define MS_MEASUREMENTSET_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/ms/MeasurementSets/MSTable.h>
34 #include <casacore/ms/MeasurementSets/MSMainEnums.h>
35 #include <casacore/ms/MeasurementSets/MSAntenna.h>
36 #include <casacore/ms/MeasurementSets/MSDataDescription.h>
37 #include <casacore/ms/MeasurementSets/MSDoppler.h>
38 #include <casacore/ms/MeasurementSets/MSFeed.h>
39 #include <casacore/ms/MeasurementSets/MSField.h>
40 #include <casacore/ms/MeasurementSets/MSFlagCmd.h>
41 #include <casacore/ms/MeasurementSets/MSFreqOffset.h>
42 #include <casacore/ms/MeasurementSets/MSHistory.h>
43 #include <casacore/ms/MeasurementSets/MSObservation.h>
44 #include <casacore/ms/MeasurementSets/MSPointing.h>
45 #include <casacore/ms/MeasurementSets/MSPolarization.h>
46 #include <casacore/ms/MeasurementSets/MSProcessor.h>
47 #include <casacore/ms/MeasurementSets/MSSource.h>
48 #include <casacore/ms/MeasurementSets/MSSpectralWindow.h>
49 #include <casacore/ms/MeasurementSets/MSState.h>
50 #include <casacore/ms/MeasurementSets/MSSysCal.h>
51 #include <casacore/ms/MeasurementSets/MSWeather.h>
83 typedef std::set<MSMainEnums::PredefinedKeywords>
Eligible;
102 template <
class T>
class Block;
442 return "MemoryResidentSubtables";
461 template <
typename Subtable>
466 template <
typename Subtable>
Enums for the MeasurementSet main table.
PredefinedKeywords
Keywords with a predefined meaning.
A Table intended to hold astronomical data
void openSubtable(Subtable &subtable, const String &subtableName, Bool useLock)
Opens a single subtable if not present in MS object but defined in on-disk MS.
MeasurementSet & operator=(const MeasurementSet &)
Assignment operator, reference semantics.
void createDefaultSubtables(MPI_Comm comm, Table::TableOption option=Table::Scratch)
MeasurementSet(const Table &table, const MeasurementSet *otherMs=NULL)
MSAntenna & antenna()
Access functions for the subtables, using the MS-like interface for each.
String fieldTableName() const
void copySubtables(const MeasurementSet &other)
Copies (assigns) all of the non-null subtables from the other MS into this one.
MrsEligibility getMrsEligibility() const
const MSSysCal & sysCal() const
String stateTableName() const
Bool memoryResidentSubtables_p
String freqOffsetTableName() const
String processorTableName() const
MeasurementSet(const String &tableName, const String &tableDescName, TableOption=Table::Old)
Allows keeping subtables unlocked/read-locked independent of lock mode of main table.
void copySubtable(const Table &otherSubtable, Table &subTable)
Assigns one subtable to another if the original subtable (otherSubtable) is not null and is also memo...
Bool isEligibleForMemoryResidency(const String &subtableName) const
Returns true if the named subtable is eligible for memory residency.
const MSFreqOffset & freqOffset() const
const MSSpectralWindow & spectralWindow() const
MSDataDescription dataDesc_p
MeasurementSet(const String &tableName, const TableLock &lockOptions, TableOption=Table::Old)
const MSFeed & feed() const
MeasurementSet()
This constructs an empty MeasurementSet, only useful to assign to (it is not a valid MS yet).
Record msseltoindex(const String &spw="", const String &field="", const String &baseline="", const String &time="", const String &scan="", const String &uvrange="", const String &observation="", const String &poln="", const String &taql="")
Return a record of the indices that the msselection selection selected.
const MSAntenna & antenna() const
MeasurementSet(MPI_Comm comm, SetupNewTable &newTab, const TableLock &lockOptions, rownr_t nrrow=0, Bool initialize=False)
MSAntenna antenna_p
keep references to the subtables
const MSState & state() const
void createDefaultSubtables(Table::TableOption option=Table::Scratch)
Create default subtables: fills the required subtable keywords with tables of the correct type,...
String flagCmdTableName() const
String spectralWindowTableName() const
String dopplerTableName() const
const MSDataDescription & dataDescription() const
String historyTableName() const
String feedTableName() const
MeasurementSet(SetupNewTable &newTab, rownr_t nrrow=0, Bool initialize=False)
String sysCalTableName() const
const MSField & field() const
const MSHistory & history() const
void setMemoryResidentSubtables(const MrsEligibility &mrsEligibility)
Converts the MS to make the specified set of subtables memory resident.
MeasurementSet(const String &tableName, const String &tableDescName, const TableLock &lockOptions, TableOption=Table::Old)
const MSPolarization & polarization() const
virtual ~MeasurementSet()
As with tables, the destructor writes the table if necessary.
void flush(Bool sync=False)
Flush all the tables and subtables associated with this MeasurementSet.
MSObservation & observation()
String sourceTableName() const
MSObservation observation_p
void openMrSubtables()
Opens all of the eligible subtables in memory resident form.
void createDefaultSubtables_impl(Table::TableOption option, T comm)
Creates subtables using an explicit MPI communicator (if MPI support is enabled)
void openMrSubtable(Subtable &subtable, const String &subtableName)
Opens a single subtable as memory resident (if permitted).
void initRefs(Bool clear=False)
Initialize the references to the subtables.
const MSWeather & weather() const
MSPolarization polarization_p
MSSpectralWindow spectralWindow_p
const MSDoppler & doppler() const
const MSObservation & observation() const
String observationTableName() const
String dataDescriptionTableName() const
MeasurementSet(const String &tableName, TableOption=Table::Old)
These constructors mirror the Table ones with additional checking on validity (verifying that the MS ...
MSProcessor & processor()
Bool validateMeasureRefs()
Validate Measure references - check that all Measure columns have their reference value set,...
MeasurementSet(SetupNewTable &newTab, const TableLock &lockOptions, rownr_t nrrow=0, Bool initialize=False)
static String getMrsAipsRcBase()
The top level name for MRS related CASARC settings.
const MSPointing & pointing() const
MSFreqOffset & freqOffset()
Bool makeComplexData()
Create DATA column from existing FLOAT_DATA column.
MSDataDescription & dataDescription()
MSFreqOffset freqOffset_p
static MSTableMaps initMaps()
Initialize the statics appropriately.
String weatherTableName() const
String antennaTableName() const
Return the name of each of the subtables.
void addCat()
temporary function to add the CATEGORY keyword to the FLAG_CATEGORY column if it isn't there yet.
String polarizationTableName() const
MeasurementSet(MPI_Comm comm, SetupNewTable &newTab, rownr_t nrrow=0, Bool initialize=False)
const MSFlagCmd & flagCmd() const
MeasurementSet(const MeasurementSet &other)
bool doNotLockSubtables_p
void checkVersion()
check that the MS is the latest version (2.0)
MrsEligibility mrsEligibility_p
const MSProcessor & processor() const
MSSpectralWindow & spectralWindow()
MeasurementSet referenceCopy(const String &newTableName, const Block< String > &writableColumns) const
Make a special copy of this MS which references all columns from this MS except those mentioned; thos...
const MSSource & source() const
void clearSubtables()
Clears all of the subtable components of this object (i.e., set to value of subtable's default constr...
MSPolarization & polarization()
String pointingTableName() const
MeasurementSet(const String &tableName, const TableLock &lockOptions, bool doNotLockSubtables, TableOption=Table::Old)
std::set< MSMainEnums::PredefinedKeywords > Eligible
Bool isEligible(SubtableId subtableId) const
Returns true if the specified subtable is in the set of subtables eligible for memory residency.
static MrsEligibility noneEligible()
static Bool isSubtable(SubtableId subtableId)
friend MrsEligibility operator+(const MrsEligibility &a, SubtableId subtableId)
static MrsEligibility defaultEligible()
static const MrsEligibility allSubtables_p
static MrsEligibility allEligible()
Factory methods to create MrsEligibility sets.
friend MrsEligibility operator-(const MrsEligibility &a, SubtableId subtableId)
Creates a new MrsEligibilitySet by adding or removing the specified subtable or the specified set of ...
static MrsEligibility eligibleSubtables(SubtableId subtableId,...)
static MrsEligibility allButTheseSubtables(SubtableId ineligibleSubtableId,...)
MSMainEnums::PredefinedKeywords SubtableId
Create a new table - define shapes, data managers, etc.
String: the storage and methods of handling collections of characters.
const TableLock & lockOptions() const
Get the locking options.
const String & tableName() const
Get the table name.
TableOption
Define the possible options how a table can be opened.
@ Scratch
new table, which gets marked for delete
this file contains all the compiler specific defines
TableExprNode time(const TableExprNode &node)
LatticeExprNode operator+(const LatticeExprNode &expr)
Global functions operating on a LatticeExprNode.
LatticeExprNode operator-(const LatticeExprNode &expr)
MeasurementSet MS
MeasurementSet is too cumbersome for a number of common uses, so we give a typedef here.
bool Bool
Define the standard types used by Casacore.
uInt64 rownr_t
Define the type of a row number in a table.