140 using Baseline = std::pair<casacore::uInt, casacore::uInt>;
193 mutable std::map<BaselineChanBin, std::vector<casacore::Double>>
198 std::map<casacore::Int, std::vector<ChanBin>>
_chanBins {};
206 std::unique_ptr<std::pair<casacore::Double, casacore::Double>>
_wtrange {};
218 mutable std::map<casacore::uInt, std::pair<casacore::uInt, casacore::uInt>>
227 mutable std::map<casacore::uInt, casacore::uInt>
286 const std::vector<std::set<casacore::uInt>>& rowMap,
casacore::Matrix< casacore::Float > _newWt
void _configureStatAlg(const casacore::Record &config)
casacore::CountedPtr< casacore::StatisticsAlgorithm< casacore::Double, casacore::Array< casacore::Float >::const_iterator, casacore::Array< casacore::Bool >::const_iterator > > _statAlg
void _setChanBinMap(casacore::Int binWidth)
void origin()
+==================================+ | | | Iteration Control and Monitoring | | | +==================...
void _weightSingleChanBinSlidingTimeWindow(casacore::Matrix< casacore::Float > &wtmat, casacore::Int nrows) const
void _weightSingleChanBinBlockTimeProcessing(casacore::Matrix< casacore::Float > &wtmat, casacore::Int nrows) const
std::vector< std::vector< casacore::Double > > _timeWindowWts
void _weightSpectrumFlagsSlidingTimeWindow(casacore::Cube< casacore::Float > &wtsp, casacore::Cube< casacore::Bool > &flagCube, casacore::Bool &checkFlags) const
void initSigmaSpectrum(const casacore::Cube< casacore::Float > &sigspec)
Initialize the sigmaSpectrum.
virtual void flagRow(casacore::Vector< casacore::Bool > &flagRow) const
Return row flag.
void _weightSpectrumFlagsTimeBlockProcessing(casacore::Cube< casacore::Float > &wtsp, casacore::Cube< casacore::Bool > &flagCube, casacore::Bool &checkFlags) const
std::map< casacore::uInt, casacore::Cube< casacore::Bool > > _chanSelFlags
The _chanSelFlags key is the spw.
virtual void sigma(casacore::Matrix< casacore::Float > &sigmaMat) const
Return sigma.
void _gatherAndComputeWeightsSlidingTimeWindow() const
casacore::Cube< casacore::Float > _newWtSp
casacore::Bool _mustComputeSigma
std::map< BaselineChanBin, std::vector< casacore::Double > > _weights
the vector represents separate correlations, there will be only one element in the vector if _combine...
static casacore::Double getTimeBinWidthInSec(const casacore::Quantity &binWidth)
these are public so that class StatWt can call them.
void _updateWtSpFlags(casacore::Cube< casacore::Float > &wtsp, casacore::Cube< casacore::Bool > &flags, casacore::Bool &checkFlags, const casacore::Slicer &slice, casacore::Float wt) const
static Baseline _baseline(casacore::uInt ant1, casacore::uInt ant2)
void _initialize();
Class to calculate statistics in a "classical" sense, ie using accumulators with no special filtering...
virtual casacore::String ViiType() const
Report the the ViImplementation type (should be specialized in child classes)
casacore::Bool _combineCorr
virtual void flag(casacore::Cube< casacore::Bool > &flagCube) const
Return flag for each polarization, channel and row.
void _computeWeightSpectrumAndFlags() const
const casacore::Cube< casacore::Complex > _dataCube(const VisBuffer2 *const vb) const
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
bool operator<(const ChanBin &other) const
void _gatherAndComputeWeightsTimeBlockProcessing() const
casacore::Bool _checkFirsSubChunk(casacore::Int &spw, casacore::Bool &firstTime, const VisBuffer2 *const vb) const
returns True if this chunk has already been processed.
virtual void weight(casacore::Matrix< casacore::Float > &wtmat) const
Return weight.
Referenced counted pointer for constant data.
std::set< casacore::uInt > _processedRowIDs
std::map< casacore::uInt, casacore::uInt > _rowIDInMSTorowIndexInChunk
for running time window, for each subchunk, map the rowID (in the MS) to the row index in the chunk ...
static void checkTimeBinWidth(casacore::Double binWidth)
casacore::Cube< casacore::Double > _slidingTimeWindowWeights
bool operator<(const BaselineChanBin &other) const
casacore::Bool _updateWeight
CORRECTED_DATA - MODEL_DATA.
void _setDefaultChanBinMap()
void summarizeFlagging() const
std::map< casacore::uInt, std::pair< casacore::uInt, casacore::uInt > > _samples
std::unique_ptr< casacore::Bool > _mustComputeWtSp
virtual void weightSpectrum(casacore::Cube< casacore::Float > &wtsp) const
Return weightspectrum (a weight for each channel)
A hierarchical collection of named fields of various types.
bool Bool
Define the standard types used by Casacore.
void originChunks(casacore::Bool forceRewind)
Methods to control chunk iterator.
casacore::Bool _parseConfiguration(const casacore::Record &configuration)
void _logUsedChannels() const
CAS-12358.
void _gatherAndComputeWeights() const
casacore::Cube< casacore::Bool > _newFlag
std::shared_ptr< casacore::ClassicalStatistics< casacore::Double, casacore::Array< casacore::Float >::const_iterator, casacore::Array< casacore::Bool >::const_iterator > > _wtStats
A Table intended to hold astronomical data (a set of Measurements).
casacore::Bool _timeBlockProcessing
if False, the a sliding time window is being used
Specify which elements to extract from an n-dimensional array.
void writeBackChanges(VisBuffer2 *vb)
Override unimplemented TransformingVi2 version.
StatWtTVI(ViImplementation2 *inputVii, const casacore::Record &configuration)
The following fields are supported in the input configuration record combine String, if contains "corr", data will be aggregated across correlations.
VisBuffer2s encapsulate one chunk of visibility data for processing.
void summarizeStats(casacore::Double &mean, casacore::Double &variance) const
LatticeExprNode mean(const LatticeExprNode &expr)
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
std::unique_ptr< std::pair< casacore::Double, casacore::Double > > _wtrange
std::map< casacore::Int, std::vector< ChanBin > > _chanBins
The key refers to the spw, the value vector refers to the channel numbers within that spw that are th...
static const casacore::String CHANBIN
virtual casacore::String ViiType() const =0
Report the the ViImplementation type.
String: the storage and methods of handling collections of characters.
casacore::Bool _weightsComputed
void initWeightSpectrum(const casacore::Cube< casacore::Float > &wtspec)
Initialize the weightSpectrum.
casacore::Cube< casacore::Bool > _getResultantFlags(casacore::Cube< casacore::Bool > &chanSelFlagTemplate, casacore::Cube< casacore::Bool > &chanSelFlags, casacore::Bool &initChanSelFlags, casacore::Int spw, const casacore::Cube< casacore::Bool > &flagCube) const
combines the flag cube with the channel selection flags (if any)
std::pair< casacore::Cube< casacore::Float >, casacore::Cube< casacore::Bool > > _getLowerLayerWtSpFlags(size_t &nOrigFlagged) const
casacore::Double _computeWeight(const casacore::Cube< casacore::Complex > &data, const casacore::Cube< casacore::Bool > &flags, casacore::uInt spw) const
multi-threaded case
virtual void sigmaSpectrum(casacore::Cube< casacore::Float > &sigmaSp) const
Return sgimaspectrum (a sigma for each channel)
casacore::Double _slidingTimeWindowWidth
void _computeWeightsSlidingTimeWindow(const casacore::Cube< casacore::Complex > &data, const casacore::Cube< casacore::Bool > &flags, const std::vector< std::set< casacore::uInt >> &rowMap, casacore::uInt spw) const
LatticeExprNode variance(const LatticeExprNode &expr)
Base class of statistics algorithm class hierarchy.
static casacore::Double getTimeBinWidthUsingInterval(const casacore::MeasurementSet *const ms, casacore::Int n)
void _computeWeightsTimeBlockProcessing(const std::map< BaselineChanBin, casacore::Cube< casacore::Complex >> &data, const std::map< BaselineChanBin, casacore::Cube< casacore::Bool >> &flags) const
casacore::Vector< casacore::Bool > _newFlagRow
std::pair< casacore::uInt, casacore::uInt > Baseline