DP3
Public Member Functions | Static Public Member Functions | List of all members
dp3::base::FlagCounter Class Reference

Class to keep counts of nr of flagged points. More...

#include <FlagCounter.h>

Public Member Functions

 FlagCounter ()=default
 The default constructor creates an empty object. It does not save. More...
 
 FlagCounter (const common::ParameterSet &, const std::string &prefix)
 
void add (const FlagCounter &that)
 Add the contents of that to this. More...
 
void incrBaseline (unsigned int bl)
 Increment the count per baseline. More...
 
void incrChannel (unsigned int chan)
 Increment the count per channel. More...
 
void incrCorrelation (unsigned int corr)
 Increment the count per correlation. More...
 
void init (const DPInfo &info)
 
void showBaseline (std::ostream &os, int64_t ntimes) const
 Print the counts and optionally save percentages in a table. More...
 
void showChannel (std::ostream &os, int64_t ntimes) const
 
void showCorrelation (std::ostream &os, int64_t ntimes) const
 
void showStation (std::ostream &os, int64_t ntimes) const
 
const std::vector< int64_t > & baselineCounts () const
 
const std::vector< int64_t > & channelCounts () const
 
const std::vector< int64_t > & correlationCounts () const
 

Static Public Member Functions

static void showPerc1 (std::ostream &, double value, double total)
 Show percentage with 1 decimal. More...
 
static void showPerc3 (std::ostream &, double value, double total)
 Show percentage with 3 decimals. More...
 

Detailed Description

Class to keep counts of nr of flagged points.

This class contains counts of the number of flags. The flags can be counted per baseline, channel, and correlation. Once counting completes, the counts can be printed using the 'show' functions. When printing, the baselines counts are shown per antenna. Optionally the flagging percentages can be saved in a table. The name of the table is the MS name suffixed by the step name and '.flagxx'.

Constructor & Destructor Documentation

◆ FlagCounter() [1/2]

dp3::base::FlagCounter::FlagCounter ( )
default

The default constructor creates an empty object. It does not save.

◆ FlagCounter() [2/2]

dp3::base::FlagCounter::FlagCounter ( const common::ParameterSet ,
const std::string &  prefix 
)

This constructor creates an empty object. It reads info from the parset to see if percentages have to be saved.

Member Function Documentation

◆ add()

void dp3::base::FlagCounter::add ( const FlagCounter that)

Add the contents of that to this.

◆ baselineCounts()

const std::vector<int64_t>& dp3::base::FlagCounter::baselineCounts ( ) const
inline

Get the counts.

◆ channelCounts()

const std::vector<int64_t>& dp3::base::FlagCounter::channelCounts ( ) const
inline

◆ correlationCounts()

const std::vector<int64_t>& dp3::base::FlagCounter::correlationCounts ( ) const
inline

◆ incrBaseline()

void dp3::base::FlagCounter::incrBaseline ( unsigned int  bl)
inline

Increment the count per baseline.

◆ incrChannel()

void dp3::base::FlagCounter::incrChannel ( unsigned int  chan)
inline

Increment the count per channel.

◆ incrCorrelation()

void dp3::base::FlagCounter::incrCorrelation ( unsigned int  corr)
inline

Increment the count per correlation.

◆ init()

void dp3::base::FlagCounter::init ( const DPInfo info)

Size all counters and initialize them to zero using the sizes from the DPInfo object.

◆ showBaseline()

void dp3::base::FlagCounter::showBaseline ( std::ostream &  os,
int64_t  ntimes 
) const

Print the counts and optionally save percentages in a table.

◆ showChannel()

void dp3::base::FlagCounter::showChannel ( std::ostream &  os,
int64_t  ntimes 
) const

◆ showCorrelation()

void dp3::base::FlagCounter::showCorrelation ( std::ostream &  os,
int64_t  ntimes 
) const

◆ showPerc1()

static void dp3::base::FlagCounter::showPerc1 ( std::ostream &  ,
double  value,
double  total 
)
static

Show percentage with 1 decimal.

◆ showPerc3()

static void dp3::base::FlagCounter::showPerc3 ( std::ostream &  ,
double  value,
double  total 
)
static

Show percentage with 3 decimals.

◆ showStation()

void dp3::base::FlagCounter::showStation ( std::ostream &  os,
int64_t  ntimes 
) const

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