Source
/*
* AveragingViFactory.h
*
* Created on: Feb 25, 2013
* Author: jjacobs
*/
namespace casa {
class MeasurementSet2;
namespace vi {
// AveragingOptions
//
// A container for the options that can be specified when creating
// an AveragingTvi2 based VI. The user can specify which of the
// data cubes (observed, model and corrected) are to be averaged.
// The source of the weights applied to each cube can also be specified.
// See enum Options below for the symbols to use; the symbols are usually
// combined using bitwise-and ("|") in the constructor.
class AveragingOptions {
public:
enum Options {Nothing = 0,
AverageObserved = 1 << 0, // Average the observed data
AverageModel = 1 << 1, // Average the model data
AverageCorrected = 1 << 2, // Average the corrected data
AverageFloat = 1 << 3, // Average float (single dish) data
ObservedPlainAvg = 1 << 4,
ObservedFlagAvg = 1 << 5,
ObservedWeightAvgFromSIGMA = 1 << 6,
ObservedFlagWeightAvgFromSIGMA = 1 << 7,
ModelPlainAvg = 1 << 8,
ModelFlagAvg = 1 << 9,
ModelWeightAvgFromWEIGHT = 1 << 10,
ModelWeightAvgFromSIGMA = 1 << 11,
ModelFlagWeightAvgFromWEIGHT = 1 << 12,
ModelFlagWeightAvgFromSIGMA = 1 << 13,
CorrectedPlainAvg = 1 << 14,
CorrectedFlagAvg = 1 << 15,
CorrectedWeightAvgFromWEIGHT = 1 << 16,
CorrectedFlagWeightAvgFromWEIGHT = 1 << 17,
BaselineDependentAveraging = 1 << 18, // Do averaging with lengths dependent on baselines
// Requires specifying a max uvw distance parameter
phaseShifting = 1 << 19,
flagdataFlagPropagation = 1 << 20, // CAS-12737 - preserve existing flags
MarksLast
};
AveragingOptions () : options_p (AverageObserved) {}
AveragingOptions (casacore::Int options) : options_p ((Options) options) {}
explicit AveragingOptions (Options o) : options_p (o) {}
AveragingOptions operator& (const AveragingOptions & other) const
{
return AveragingOptions (other.options_p & options_p);
}
AveragingOptions operator| (const AveragingOptions & other) const
{
return AveragingOptions (other.options_p | options_p);
}
AveragingOptions & operator|= (const AveragingOptions & other)
{
* this = AveragingOptions (options_p | other.options_p);
return * this;
}
AveragingOptions & operator|= (Options options)
{
* this = AveragingOptions (options_p | options);
return * this;
}
AveragingOptions operator~ () const
{
return AveragingOptions (~ options_p);
}
casacore::Bool contains (Options o) const { return (o & options_p) != 0; }