casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator > Class Template Referenceabstract

casacore::StatsDataProvider template class backed by VisibilityIterator2 instances. More...

#include <Vi2DataProvider.h>

Inheritance diagram for casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >:
casacore::StatsDataProvider< DataIterator::AccumType, DataIterator, MaskIterator, WeightsIterator > casa::Vi2Antenna1DataProvider casa::Vi2Antenna2DataProvider casa::Vi2ArrayIdDataProvider casa::Vi2CorrectedVisDataProvider< DataIterator > casa::Vi2DataDescriptionIdsDataProvider casa::Vi2Feed1DataProvider casa::Vi2Feed2DataProvider casa::Vi2FieldIdDataProvider casa::Vi2FlagCubeDataProvider casa::Vi2FlagRowDataProvider casa::Vi2FloatVisDataProvider casa::Vi2IntervalDataProvider casa::Vi2ModelVisDataProvider< DataIterator > casa::Vi2ObservedVisDataProvider< DataIterator > casa::Vi2ScanDataProvider casa::Vi2TimeDataProvider casa::Vi2UVRangeDataProvider casa::Vi2WeightSpectrumDataProvider

Public Types

typedef DataIterator::AccumType AccumType
 Define typedefs for some template parameters. More...
 
typedef DataIterator DataIteratorType
 
typedef MaskIterator MaskIteratorType
 
typedef WeightsIterator WeightsIteratorType
 

Public Member Functions

 Vi2DataProvider (vi::VisibilityIterator2 *vi2, const std::set< casacore::MSMainEnums::PredefinedColumns > &mergedColumns_, vi::VisBufferComponent2 component, casacore::Bool omit_flagged_data, casacore::Bool use_data_weights)
 
 Vi2DataProvider (Vi2DataProvider &&other)
 
Vi2DataProvideroperator= (Vi2DataProvider &&other)
 
void operator++ ()
 Increment the data provider to the sub-chunk within the dataset. More...
 
casacore::Bool atEnd () const
 Is this the last sub-chunk within the dataset? More...
 
void finalize ()
 Take any actions necessary to finalize the provider. More...
 
casacore::uInt64 getCount ()
 get the count of elements in the current data set. More...
 
DataIterator getData ()
 Get the current sub-chunk. More...
 
casacore::uInt getStride ()
 Get the stride for the current data set. More...
 
casacore::Bool hasMask () const
 Does the current data set have an associated mask? More...
 
MaskIterator getMask ()
 Get the associated mask of the current sub-chunk. More...
 
casacore::uInt getMaskStride ()
 Get the stride for the current mask (only called if hasMask() returns true). More...
 
casacore::Bool hasWeights () const
 Does the current data set have associated weights? More...
 
WeightsIterator getWeights ()
 Get the associated weights of the current sub-chunk. More...
 
casacore::Bool hasRanges () const
 Does the current data set have associated range(s)? More...
 
DataRanges getRanges ()
 Get the associated range(s) of the current sub-chunk. More...
 
casacore::Bool isInclude () const
 If the associated data set has ranges, are these include (return true) or exclude (return false) ranges? More...
 
void reset ()
 Reset the provider to point to the first sub-chunk of the dataset. More...
 
void foreachDataset (casacore::StatisticsAlgorithm< AccumType, DataIteratorType, MaskIteratorType, WeightsIteratorType > &statistics, Vi2StatisticsIteratee< DataIterator, WeightsIterator, MaskIterator > &iteratee)
 
- Public Member Functions inherited from casacore::StatsDataProvider< DataIterator::AccumType, DataIterator, MaskIterator, WeightsIterator >
virtual ~StatsDataProvider ()
 
virtual uInt getNMaxThreads () const
 If OpenMP is enabled and statistics methods are being called in a multi-threaded context, get maximum number of threads that should be used. More...
 
virtual void updateMaxPos (const LocationType &)
 In general, unless you are writing statistics algorithm code, you shouldn't need to call these methods. More...
 
virtual void updateMinPos (const LocationType &)
 

Protected Attributes

std::unique_ptr
< vi::VisibilityIterator2
vi2
 
vi::VisBufferComponent2 component
 
std::unique_ptr< const
DataIterator > 
data_iterator
 
const casacore::Bool use_data_weights
 
std::unique_ptr< const
WeightsIterator > 
weights_iterator
 
const casacore::Bool omit_flagged_data
 
std::unique_ptr< const
MaskIterator > 
mask_iterator
 
int datasetIndex
 
unsigned datasetChunkOrigin
 
int followingChunkDatasetIndex
 
unsigned currentChunk
 
std::unordered_set< string > mergedColumns
 

Private Member Functions

void reset_iterators ()
 
void nextDatasetChunk ()
 
bool nextDataset ()
 
void initChunk ()
 
virtual const casacore::Array
< typename
DataIterator::DataType > & 
dataArray ()=0
 
void updateFollowingChunkDatasetIndex ()
 
std::unique_ptr
< std::unordered_map< int,
std::string > > 
mkColumnValues ()
 

Private Attributes

std::map
< casacore::MSMainEnums::PredefinedColumns,
std::string > 
columnNames
 

Additional Inherited Members

- Protected Member Functions inherited from casacore::StatsDataProvider< DataIterator::AccumType, DataIterator, MaskIterator, WeightsIterator >
 StatsDataProvider ()
 

Detailed Description

template<class DataIterator, class MaskIterator, class WeightsIterator>
class casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >

casacore::StatsDataProvider template class backed by VisibilityIterator2 instances.

These data providers operate on a single casacore::MS column over all vi2 sub-chunks in a dataset composed of one or more chunks selected when the data provider is instantiated. In other words, the data sample for statistics generated with a Vi2DataProvider instance is the data from a single column in a single dataset of consecutive vi2 chunks. It is intended that the user set up the VisibilityIterator2 appropriately to select the desired data sample for computing statistics. Consecutive chunks produced by an iterator may be merged by the data provider to produce a single dataset. The iteration over an MS, and the computation of statistics on each dataset driven using a Vi2StatisticsIteratee instance, may be done as follows:

Vi2DataProvider *dp; // given casacore::StatisticsAlgorithm statistics; // given class DoStuff : public Vi2StatisticsIteratee { ... // constructor, probably needs some sort of accumulator void nextDataset(casacore::StatisticsAlgorithm stats, const std::unordered_map<int,std::string> *colVals) { stats.getStatistics()...; } } DoStuff doStuff; dp->foreachDataset(statistics, doStuff);

Note that the AccumType template parameter value of casacore::StatsDataProvider is derived from the DataIterator parameter value of this template, imposing a constraint on the classes that can be used for DataIterator.

Definition at line 84 of file Vi2DataProvider.h.

Member Typedef Documentation

template<class DataIterator , class MaskIterator , class WeightsIterator >
typedef DataIterator::AccumType casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::AccumType

Define typedefs for some template parameters.

This is primarily to support instantiating "...Statistics" instances of the proper type given only an instance of this type. [AccumType is an exception, in that it's also needed by the (macro) definition of DataRanges.]

Definition at line 95 of file Vi2DataProvider.h.

template<class DataIterator , class MaskIterator , class WeightsIterator >
typedef DataIterator casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::DataIteratorType

Definition at line 96 of file Vi2DataProvider.h.

template<class DataIterator , class MaskIterator , class WeightsIterator >
typedef MaskIterator casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::MaskIteratorType

Definition at line 97 of file Vi2DataProvider.h.

template<class DataIterator , class MaskIterator , class WeightsIterator >
typedef WeightsIterator casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::WeightsIteratorType

Definition at line 98 of file Vi2DataProvider.h.

Constructor & Destructor Documentation

template<class DataIterator , class MaskIterator , class WeightsIterator >
casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::Vi2DataProvider ( vi::VisibilityIterator2 vi2,
const std::set< casacore::MSMainEnums::PredefinedColumns > &  mergedColumns_,
vi::VisBufferComponent2  component,
casacore::Bool  omit_flagged_data,
casacore::Bool  use_data_weights 
)
inline

Attach the casacore::MS columns to vi2 by calling originChunks(). Not the most direct method, but attaching the columns is required in many cases to pass existsColumn() test.

Definition at line 100 of file Vi2DataProvider.h.

References casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::columnNames, casa::vi::VisibilityIterator2::existsColumn(), casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::mergedColumns, and casa::vi::VisibilityIterator2::originChunks().

template<class DataIterator , class MaskIterator , class WeightsIterator >
casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::Vi2DataProvider ( Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator > &&  other)
inline

Definition at line 123 of file Vi2DataProvider.h.

Member Function Documentation

template<class DataIterator , class MaskIterator , class WeightsIterator >
casacore::Bool casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::atEnd ( ) const
inlinevirtual
template<class DataIterator , class MaskIterator , class WeightsIterator >
virtual const casacore::Array<typename DataIterator::DataType>& casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::dataArray ( )
privatepure virtual
template<class DataIterator , class MaskIterator , class WeightsIterator >
void casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::finalize ( )
inlinevirtual

Take any actions necessary to finalize the provider.

This will be called when atEnd() returns true.

Implements casacore::StatsDataProvider< DataIterator::AccumType, DataIterator, MaskIterator, WeightsIterator >.

Definition at line 174 of file Vi2DataProvider.h.

template<class DataIterator , class MaskIterator , class WeightsIterator >
void casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::foreachDataset ( casacore::StatisticsAlgorithm< AccumType, DataIteratorType, MaskIteratorType, WeightsIteratorType > &  statistics,
Vi2StatisticsIteratee< DataIterator, WeightsIterator, MaskIterator > &  iteratee 
)
inline
template<class DataIterator , class MaskIterator , class WeightsIterator >
casacore::uInt64 casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::getCount ( )
inlinevirtual

get the count of elements in the current data set.

When implementing this method, be certain to take stride into account; ie for a data set with nominally 100 elements that is to have a stride of two, this method should return 50.

Implements casacore::StatsDataProvider< DataIterator::AccumType, DataIterator, MaskIterator, WeightsIterator >.

Definition at line 176 of file Vi2DataProvider.h.

References casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::getData().

template<class DataIterator , class MaskIterator , class WeightsIterator >
DataIterator casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::getData ( )
inlinevirtual
template<class DataIterator , class MaskIterator , class WeightsIterator >
MaskIterator casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::getMask ( )
inlinevirtual
template<class DataIterator , class MaskIterator , class WeightsIterator >
casacore::uInt casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::getMaskStride ( )
inlinevirtual

Get the stride for the current mask (only called if hasMask() returns true).

Will always return 1 in this implementation.

Implements casacore::StatsDataProvider< DataIterator::AccumType, DataIterator, MaskIterator, WeightsIterator >.

Definition at line 207 of file Vi2DataProvider.h.

template<class DataIterator , class MaskIterator , class WeightsIterator >
DataRanges casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::getRanges ( )
inlinevirtual

Get the associated range(s) of the current sub-chunk.

Only called if hasRanges() returns true, which will never be the case in this implementation.

Implements casacore::StatsDataProvider< DataIterator::AccumType, DataIterator, MaskIterator, WeightsIterator >.

Definition at line 232 of file Vi2DataProvider.h.

References DataRanges.

template<class DataIterator , class MaskIterator , class WeightsIterator >
casacore::uInt casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::getStride ( )
inlinevirtual

Get the stride for the current data set.

Implements casacore::StatsDataProvider< DataIterator::AccumType, DataIterator, MaskIterator, WeightsIterator >.

Definition at line 188 of file Vi2DataProvider.h.

template<class DataIterator , class MaskIterator , class WeightsIterator >
WeightsIterator casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::getWeights ( )
inlinevirtual
template<class DataIterator , class MaskIterator , class WeightsIterator >
casacore::Bool casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::hasMask ( ) const
inlinevirtual
template<class DataIterator , class MaskIterator , class WeightsIterator >
casacore::Bool casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::hasRanges ( ) const
inlinevirtual

Does the current data set have associated range(s)?

Implements casacore::StatsDataProvider< DataIterator::AccumType, DataIterator, MaskIterator, WeightsIterator >.

Definition at line 224 of file Vi2DataProvider.h.

template<class DataIterator , class MaskIterator , class WeightsIterator >
casacore::Bool casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::hasWeights ( ) const
inlinevirtual
template<class DataIterator , class MaskIterator , class WeightsIterator >
void casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::initChunk ( )
inlineprivate
template<class DataIterator , class MaskIterator , class WeightsIterator >
casacore::Bool casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::isInclude ( ) const
inlinevirtual

If the associated data set has ranges, are these include (return true) or exclude (return false) ranges?

Implements casacore::StatsDataProvider< DataIterator::AccumType, DataIterator, MaskIterator, WeightsIterator >.

Definition at line 239 of file Vi2DataProvider.h.

template<class DataIterator , class MaskIterator , class WeightsIterator >
std::unique_ptr<std::unordered_map<int,std::string> > casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::mkColumnValues ( )
inlineprivate
template<class DataIterator , class MaskIterator , class WeightsIterator >
bool casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::nextDataset ( )
inlineprivate
template<class DataIterator , class MaskIterator , class WeightsIterator >
void casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::nextDatasetChunk ( )
inlineprivate
template<class DataIterator , class MaskIterator , class WeightsIterator >
void casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::operator++ ( )
inlinevirtual
template<class DataIterator , class MaskIterator , class WeightsIterator >
Vi2DataProvider& casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::operator= ( Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator > &&  other)
inline
template<class DataIterator , class MaskIterator , class WeightsIterator >
void casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::reset ( void  )
inlinevirtual
template<class DataIterator , class MaskIterator , class WeightsIterator >
void casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::reset_iterators ( )
inlineprivate
template<class DataIterator , class MaskIterator , class WeightsIterator >
void casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::updateFollowingChunkDatasetIndex ( )
inlineprivate

Member Data Documentation

template<class DataIterator , class MaskIterator , class WeightsIterator >
std::map<casacore::MSMainEnums::PredefinedColumns,std::string> casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::columnNames
private
template<class DataIterator , class MaskIterator , class WeightsIterator >
vi::VisBufferComponent2 casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::component
protected
template<class DataIterator , class MaskIterator , class WeightsIterator >
unsigned casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::currentChunk
protected
template<class DataIterator , class MaskIterator , class WeightsIterator >
std::unique_ptr<const DataIterator> casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::data_iterator
protected
template<class DataIterator , class MaskIterator , class WeightsIterator >
unsigned casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::datasetChunkOrigin
protected
template<class DataIterator , class MaskIterator , class WeightsIterator >
int casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::datasetIndex
protected
template<class DataIterator , class MaskIterator , class WeightsIterator >
int casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::followingChunkDatasetIndex
protected
template<class DataIterator , class MaskIterator , class WeightsIterator >
std::unique_ptr<const MaskIterator> casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::mask_iterator
protected
template<class DataIterator , class MaskIterator , class WeightsIterator >
std::unordered_set<string> casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::mergedColumns
protected
template<class DataIterator , class MaskIterator , class WeightsIterator >
const casacore::Bool casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::omit_flagged_data
protected
template<class DataIterator , class MaskIterator , class WeightsIterator >
const casacore::Bool casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::use_data_weights
protected
template<class DataIterator , class MaskIterator , class WeightsIterator >
std::unique_ptr<vi::VisibilityIterator2> casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::vi2
protected
template<class DataIterator , class MaskIterator , class WeightsIterator >
std::unique_ptr<const WeightsIterator> casa::Vi2DataProvider< DataIterator, MaskIterator, WeightsIterator >::weights_iterator
protected

The documentation for this class was generated from the following file: