casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casa::RFAFlagExaminer Class Reference

RFAFlagExaminer: Examine the flags and get statistics. perform extensions too. More...

#include <RFAFlagExaminer.h>

Inheritance diagram for casa::RFAFlagExaminer:
casa::RFASelector casa::RFAFlagCubeBase casa::RFABase casa::FlaggerEnums

Public Member Functions

 RFAFlagExaminer (RFChunkStats &ch, const casacore::RecordInterface &parm)
 constructor. More...
 
virtual ~RFAFlagExaminer ()
 
virtual void iterFlag (casacore::uInt it)
 Iteration method for a flag pass. More...
 
virtual IterMode iterRow (casacore::uInt irow)
 iterRow() is called once per each row in the VisBuffer. More...
 
virtual casacore::Bool newChunk (casacore::Int &maxmem)
 Called before iterating over a chunk. More...
 
virtual void endChunk ()
 Called once finished with a chunk. More...
 
virtual void startData (bool verbose)
 Called before starting a data pass on a chunk. More...
 
virtual void startFlag (bool verbose)
 Called before starting the fetch-flags pass. More...
 
virtual void endFlag ()
 Called after a flag pass is complete. More...
 
virtual void finalize ()
 
virtual void initialize ()
 Initialize chunk. More...
 
virtual void initializeIter (casacore::uInt it)
 
virtual void finalizeIter (casacore::uInt it)
 
virtual casacore::String getID ()
 
virtual casacore::Record getResult ()
 
- Public Member Functions inherited from casa::RFASelector
 RFASelector (RFChunkStats &ch, const casacore::RecordInterface &parm)
 constructor. More...
 
virtual ~RFASelector ()
 
virtual casacore::uInt estimateMemoryUse ()
 This method is called before iterating over a chunk, to inquire the expected memory use. More...
 
virtual IterMode iterTime (casacore::uInt it)
 Iteration methods for a data pass. More...
 
virtual void endRows (casacore::uInt itime)
 Called at end of time chunk. More...
 
virtual casacore::String getDesc ()
 called to obtain a short description of this RFA More...
 
casacore::Bool fortestingonly_parseMinMax (casacore::Float &vmin, casacore::Float &vmax, const casacore::RecordInterface &spec, casacore::uInt f0)
 
void fortestingonly_parseClipField (const casacore::RecordInterface &spec, casacore::Bool clip)
 
- Public Member Functions inherited from casa::RFAFlagCubeBase
 RFAFlagCubeBase (RFChunkStats &ch, const casacore::RecordInterface &parm)
 
virtual ~RFAFlagCubeBase ()
 
virtual void startDry (bool verbose)
 Called before starting a dry pass on a chunk. More...
 
virtual IterMode iterDry (casacore::uInt it)
 Iteration method for a dry pass. More...
 
virtual IterMode endData ()
 Called after a pass is completed successfully (i.e., not stopped by start or iter methods). More...
 
virtual IterMode endDry ()
 Called after a dry pass is complete. More...
 
virtual casacore::String getStats ()
 called (before endChunk()) to obtain a statistics report More...
 
- Public Member Functions inherited from casa::RFABase
 RFABase (RFChunkStats &ch, const casacore::RecordInterface &parm)
 An agent is always constructed from a chunk stats accessor, and a record of parameters. More...
 
virtual ~RFABase ()
 Destructor. More...
 
virtual void init ()
 This method is called after constructing the agent. More...
 
virtual void printFlaggingReport ()
 
const casacore::Stringname ()
 returns the name of this RFA (set in myname) More...
 
casacore::Bool isActive ()
 returns the active status More...
 
casacore::LogIOlogSink ()
 accessor to a casacore::LogIO for this agent More...
 
virtual void setNAgent (casacore::uInt n)
 
virtual void setOnlySelector (bool only_sel)
 

Private Member Functions

void processRow (casacore::uInt ifr, casacore::uInt it)
 virtual casacore::String getDesc (); static const casacore::RecordInterface & getDefaults (); More...
 

Private Attributes

casacore::uInt64 totalflags
 
casacore::uInt64 totalcount
 
casacore::uInt64 totalrowflags
 
casacore::uInt64 totalrowcount
 
casacore::uInt64 accumTotalFlags
 accumulated over all chunks More...
 
casacore::uInt64 accumTotalCount
 
casacore::uInt64 accumTotalRowCount
 
casacore::uInt64 accumTotalRowFlags
 
casacore::uInt64 inTotalFlags
 per chunk More...
 
casacore::uInt64 inTotalCount
 
casacore::uInt64 inTotalRowFlags
 
casacore::uInt64 inTotalRowCount
 
casacore::uInt64 outTotalFlags
 
casacore::uInt64 outTotalCount
 
casacore::uInt64 outTotalRowFlags
 
casacore::uInt64 outTotalRowCount
 
std::map< std::string,
std::map< std::string,
casacore::uInt64 > > 
accumflags
 Statistics per antenna, baseline, spw, etc. More...
 
std::map< std::string,
std::map< std::string,
casacore::uInt64 > > 
accumtotal
 
std::vector< casacore::uInt64accumflags_channel
 
std::vector< casacore::uInt64accumtotal_channel
 
std::vector< casacore::uInt64accumflags_correlation
 
std::vector< casacore::uInt64accumtotal_correlation
 

Additional Inherited Members

- Public Types inherited from casa::RFABase
enum  IterMode {
  STOP,
  DRY,
  DATA,
  CONT
}
 iteration modes More...
 
- Public Types inherited from casa::FlaggerEnums
enum  StatEnums {
  POLZN,
  POL,
  CORR,
  CHAN,
  IFR,
  TIME,
  ROW,
  ANT,
  FEED,
  FEEDCORR,
  NONE,
  Num_StatEnums
}
 
enum  PreFlagPolicy {
  FL_HONOR,
  FL_IGNORE,
  FL_RESET
}
 
- Static Public Member Functions inherited from casa::RFASelector
static const
casacore::RecordInterface
getDefaults ()
 
- Static Public Member Functions inherited from casa::RFAFlagCubeBase
static const
casacore::RecordInterface
getDefaults ()
 
- Static Public Member Functions inherited from casa::RFABase
static void setIndexingBase (casacore::uInt base)
 static method for setting the indexing base for agent arguments More...
 
- Protected Types inherited from casa::RFASelector
typedef struct
casa::RFASelector::ClipInfo 
ClipInfo
 
- Protected Member Functions inherited from casa::RFASelector
template<class T >
casacore::Bool reformRange (casacore::Matrix< T > &rng, const casacore::Array< T > &arr)
 
template<class T >
casacore::Bool parseRange (casacore::Matrix< T > &rng, const casacore::RecordInterface &parm, const casacore::String &id)
 
template<class T >
casacore::Bool find (casacore::uInt &index, const T &obj, const casacore::Vector< T > &arr)
 
casacore::Bool parseTimes (casacore::Array< casacore::Double > &times, const casacore::RecordInterface &parm, const casacore::String &id, casacore::Bool secs=false)
 
void addString (casacore::String &str, const casacore::String &s1, const char *sep=" ")
 
casacore::Bool parseMinMax (casacore::Float &vmin, casacore::Float &vmax, const casacore::RecordInterface &spec, casacore::uInt f0)
 
void addClipInfo (const casacore::Vector< casacore::String > &expr, casacore::Float vmin, casacore::Float vmax, casacore::Bool clip, casacore::Bool channel_average)
 
void parseClipField (const casacore::RecordInterface &spec, casacore::Bool clip)
 
void addClipInfoDesc (const casacore::Block< ClipInfo > &clip)
 
- Protected Member Functions inherited from casa::RFABase
casacore::uInt num (StatEnums which)
 
RFlagWord corrMask ()
 
- Static Protected Member Functions inherited from casa::RFABase
static casacore::uInt indexingBase ()
 global flag indicates that Glish (1-based) indexing is in use for agent arguments More...
 
- Protected Attributes inherited from casa::RFASelector
casacore::Double diameter
 shadow mode More...
 
casacore::Vector
< casacore::Double
diameters
 
casacore::ROMSAntennaColumnsac
 
double lowerlimit
 elevation More...
 
double upperlimit
 
casacore::String desc_str
 description of agent More...
 
casacore::Matrix
< casacore::Double
sel_freq
 selection arguments More...
 
casacore::Matrix
< casacore::Double
sel_time
 
casacore::Matrix
< casacore::Double
sel_timerng
 
casacore::Matrix
< casacore::Double
sel_uvrange
 
casacore::Matrix< casacore::Intsel_chan
 
casacore::Vector< casacore::Intsel_corr
 
casacore::Vector< casacore::Intsel_spwid
 
casacore::Vector< casacore::Intsel_fieldid
 
casacore::Vector< casacore::Intsel_stateid
 
casacore::Vector
< casacore::String
sel_fieldnames
 
casacore::LogicalVector sel_ifr
 
casacore::LogicalVector flagchan
 
casacore::LogicalVector sel_feed
 
casacore::Bool sel_autocorr
 
casacore::Bool unflag
 
casacore::Block< ClipInfosel_clip
 
casacore::Block< ClipInfosel_clip_row
 
casacore::LogicalVector sel_clip_active
 
casacore::Bool sum_sel_clip_active
 
casacore::Double quack_si
 
casacore::Double quack_dt
 
casacore::String quack_mode
 
casacore::Bool quack_increment
 
casacore::Vector< casacore::Intsel_scannumber
 
casacore::Vector< casacore::Intsel_arrayid
 
casacore::Vector< casacore::Intsel_observation
 
casacore::String sel_column
 
casacore::Bool select_fullrow
 
casacore::Bool flag_everything
 
casacore::Bool shadow
 
casacore::Bool elevation
 
- Protected Attributes inherited from casa::RFAFlagCubeBase
RFlagWord corrmask
 mask of active correlations. More...
 
RFFlagCube flag
 flag cube lattice More...
 
- Protected Attributes inherited from casa::RFABase
casacore::uInt nAgent
 
RFChunkStatschunk
 
casacore::Record params
 
casacore::String myname
 
bool only_selector
 
RFlagWord corrmask
 Bit mask of correlations which are used & flagged by this RFA. More...
 
casacore::Bool active
 flag: agent is active for this chunk (set in newChunk) More...
 
casacore::LogIO os
 

Detailed Description

RFAFlagExaminer: Examine the flags and get statistics. perform extensions too.

Intended use:

Internal

Prerequisite

Etymology

RedFlaggerAgent Selector

Synopsis

RFAFlagExaminer accepts a whole bunch of options to select a subset of the casacore::MS (by time, antenna, baseline, channel/frequency, etc.), and to flag/unflag the whole selection, or specific parts of it (autocorrelations, specific time slots, VLA quacks, etc.)

To Do

Definition at line 67 of file RFAFlagExaminer.h.

Constructor & Destructor Documentation

casa::RFAFlagExaminer::RFAFlagExaminer ( RFChunkStats ch,
const casacore::RecordInterface parm 
)

constructor.

virtual casa::RFAFlagExaminer::~RFAFlagExaminer ( )
virtual

Member Function Documentation

virtual void casa::RFAFlagExaminer::endChunk ( )
virtual

Called once finished with a chunk.

Reimplemented from casa::RFAFlagCubeBase.

virtual void casa::RFAFlagExaminer::endFlag ( )
virtual

Called after a flag pass is complete.

Reimplemented from casa::RFABase.

virtual void casa::RFAFlagExaminer::finalize ( )
virtual

Reimplemented from casa::RFABase.

virtual void casa::RFAFlagExaminer::finalizeIter ( casacore::uInt  it)
virtual

Reimplemented from casa::RFABase.

virtual casacore::String casa::RFAFlagExaminer::getID ( )
inlinevirtual

Reimplemented from casa::RFAFlagCubeBase.

Definition at line 87 of file RFAFlagExaminer.h.

virtual casacore::Record casa::RFAFlagExaminer::getResult ( )
virtual

Reimplemented from casa::RFABase.

virtual void casa::RFAFlagExaminer::initialize ( )
virtual

Initialize chunk.

Reimplemented from casa::RFABase.

virtual void casa::RFAFlagExaminer::initializeIter ( casacore::uInt  it)
virtual

Reimplemented from casa::RFABase.

virtual void casa::RFAFlagExaminer::iterFlag ( casacore::uInt  )
virtual

Iteration method for a flag pass.

Called once per each VisBuffer.

Reimplemented from casa::RFASelector.

virtual IterMode casa::RFAFlagExaminer::iterRow ( casacore::uInt  )
virtual

iterRow() is called once per each row in the VisBuffer.

Iterating over rows is perhaps preferrable in terms of performance, at least for data iterations.

Reimplemented from casa::RFASelector.

virtual casacore::Bool casa::RFAFlagExaminer::newChunk ( casacore::Int )
virtual

Called before iterating over a chunk.

Returns true if agent will process this chunk, or false if this the agent is unable to process it. (this can happen if, e.g., the requisite correlations are not present). The casacore::Int & maxmem argument is the number of MB memory which is still available in the memory pool. The agent class should plan its memory use accordingly, and subtract its expected memory use from maxmem. In effect, the agent "reserves" some amount of memory. This is used by RedFlagger to contain the total memory footprint. Note that only a rough reckoning is sufficient, so only bother estimating the biggest data structures. See implementations in RFADiffBase and RFATimeMedian for good examples. nAgent is the total number of agents.

Reimplemented from casa::RFASelector.

void casa::RFAFlagExaminer::processRow ( casacore::uInt  ifr,
casacore::uInt  it 
)
privatevirtual

virtual casacore::String getDesc (); static const casacore::RecordInterface & getDefaults ();

Reimplemented from casa::RFASelector.

virtual void casa::RFAFlagExaminer::startData ( bool  )
inlinevirtual

Called before starting a data pass on a chunk.

Reimplemented from casa::RFASelector.

Definition at line 80 of file RFAFlagExaminer.h.

References casa::RFAFlagCubeBase::startData().

virtual void casa::RFAFlagExaminer::startFlag ( bool  )
virtual

Called before starting the fetch-flags pass.

Reimplemented from casa::RFAFlagCubeBase.

Member Data Documentation

std::map<std::string, std::map<std::string, casacore::uInt64> > casa::RFAFlagExaminer::accumflags
private

Statistics per antenna, baseline, spw, etc.

These maps of maps is used e.g. like:

accumflags["baseline"]["2&&7"] == 42 accumflags["spw" ]["0" ] == 17

which means that there were 42 flags on baseline 2 - 7, etc.

Definition at line 115 of file RFAFlagExaminer.h.

std::vector<casacore::uInt64> casa::RFAFlagExaminer::accumflags_channel
private

Definition at line 118 of file RFAFlagExaminer.h.

std::vector<casacore::uInt64> casa::RFAFlagExaminer::accumflags_correlation
private

Definition at line 120 of file RFAFlagExaminer.h.

std::map<std::string, std::map<std::string, casacore::uInt64> > casa::RFAFlagExaminer::accumtotal
private

Definition at line 116 of file RFAFlagExaminer.h.

std::vector<casacore::uInt64> casa::RFAFlagExaminer::accumtotal_channel
private

Definition at line 119 of file RFAFlagExaminer.h.

std::vector<casacore::uInt64> casa::RFAFlagExaminer::accumtotal_correlation
private

Definition at line 121 of file RFAFlagExaminer.h.

casacore::uInt64 casa::RFAFlagExaminer::accumTotalCount
private

Definition at line 101 of file RFAFlagExaminer.h.

casacore::uInt64 casa::RFAFlagExaminer::accumTotalFlags
private

accumulated over all chunks

Definition at line 101 of file RFAFlagExaminer.h.

casacore::uInt64 casa::RFAFlagExaminer::accumTotalRowCount
private

Definition at line 101 of file RFAFlagExaminer.h.

casacore::uInt64 casa::RFAFlagExaminer::accumTotalRowFlags
private

Definition at line 101 of file RFAFlagExaminer.h.

casacore::uInt64 casa::RFAFlagExaminer::inTotalCount
private

Definition at line 105 of file RFAFlagExaminer.h.

casacore::uInt64 casa::RFAFlagExaminer::inTotalFlags
private

per chunk

Definition at line 105 of file RFAFlagExaminer.h.

casacore::uInt64 casa::RFAFlagExaminer::inTotalRowCount
private

Definition at line 105 of file RFAFlagExaminer.h.

casacore::uInt64 casa::RFAFlagExaminer::inTotalRowFlags
private

Definition at line 105 of file RFAFlagExaminer.h.

casacore::uInt64 casa::RFAFlagExaminer::outTotalCount
private

Definition at line 106 of file RFAFlagExaminer.h.

casacore::uInt64 casa::RFAFlagExaminer::outTotalFlags
private

Definition at line 106 of file RFAFlagExaminer.h.

casacore::uInt64 casa::RFAFlagExaminer::outTotalRowCount
private

Definition at line 106 of file RFAFlagExaminer.h.

casacore::uInt64 casa::RFAFlagExaminer::outTotalRowFlags
private

Definition at line 106 of file RFAFlagExaminer.h.

casacore::uInt64 casa::RFAFlagExaminer::totalcount
private

Definition at line 96 of file RFAFlagExaminer.h.

casacore::uInt64 casa::RFAFlagExaminer::totalflags
private

Definition at line 96 of file RFAFlagExaminer.h.

casacore::uInt64 casa::RFAFlagExaminer::totalrowcount
private

Definition at line 97 of file RFAFlagExaminer.h.

casacore::uInt64 casa::RFAFlagExaminer::totalrowflags
private

Definition at line 97 of file RFAFlagExaminer.h.


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