|
void | initialize () |
|
void | runCore () |
| Convenience function to be shared by parallel/non-parallel mode. More...
|
|
void | setDataSelection (casacore::Record config) |
|
virtual void | setAgentParameters (casacore::Record config) |
| TODO: This class must be re-implemented in the derived classes. More...
|
|
casacore::String | sanitizeCorrExpression (casacore::String corrExpression, std::vector< casacore::String > *corrProducts) |
| Method to sanitize correlation expression and keep going. More...
|
|
void | generateAllIndex () |
|
void | generateRowsIndex (casacore::uInt nRows) |
|
void | generateChannelIndex (casacore::uInt nChannels) |
|
void | generatePolarizationIndex (casacore::uInt nPolarizations) |
|
std::vector< casacore::uInt > * | generateAntennaPairRowsIndex (casacore::Int antenna1, casacore::Int antenna2) |
|
void | indigen (std::vector< casacore::uInt > &index, casacore::uInt size) |
| Generate index for all rows. More...
|
|
bool | find (const casacore::Vector< casacore::Int > &validRange, casacore::Int element) |
| For checking ids. More...
|
|
bool | find (const casacore::Matrix< casacore::Double > &validRange, casacore::Double element) |
| For checking ranges. More...
|
|
bool | find (const casacore::Matrix< casacore::Int > &validPairs, casacore::Int element1, casacore::Int element2) |
| For checking pairs. More...
|
|
bool | find (const casacore::Block< int > &columns, int col) |
| For checking columns. More...
|
|
bool | isNaN (casacore::Double number) |
| Check if a given number is nan (for visibilities,gains and Tsys primarily) More...
|
|
bool | isNaN (casacore::Float number) |
|
bool | isZero (casacore::Double number) |
|
bool | isZero (casacore::Float number) |
|
bool | isNaNOrZero (casacore::Float number) |
|
bool | isNaNOrZero (casacore::Double number) |
|
bool | checkIfProcessBuffer () |
| Check if buffer has to be processed. More...
|
|
virtual void | preProcessBuffer (const vi::VisBuffer2 &visBuffer) |
| Common functionality for each visBuffer (don't repeat at the row level) More...
|
|
void | iterateRows () |
| Iterate trough list of rows. More...
|
|
void | iterateInRows () |
| Iterate trough visibilities mapper. More...
|
|
void | iterateAntennaPairs () |
| Iterate trough list of antenna pairs. More...
|
|
void | iterateAntennaPairsFlags () |
| Iterate trough list of antenna pairs w/o loading visibilities. More...
|
|
void | processAntennaPair (casacore::Int antenna1, casacore::Int antenna2) |
| Methods to interactively iterate trough list of antenna pairs. More...
|
|
virtual void | iterateAntennaPairsInteractive (antennaPairMap *antennaPairMap_ptr) |
|
virtual void | passIntermediate (const vi::VisBuffer2 &visBuffer) |
| Iter-passes method. More...
|
|
virtual void | passFinal (const vi::VisBuffer2 &visBuffer) |
|
void | setVisibilitiesMap (std::vector< casacore::uInt > *rows, VisMapper *visMap) |
| Mapping functions (abs, real, imag, etc.) as requested by Urvashi. More...
|
|
void | setFlagsMap (std::vector< casacore::uInt > *rows, FlagMapper *flagMap) |
|
casacore::Bool | checkVisExpression (polarizationMap *polMap) |
|
virtual bool | computeRowFlags (const vi::VisBuffer2 &visBuffer, FlagMapper &flags, casacore::uInt row) |
| Compute flags for a given visibilities point. More...
|
|
virtual bool | computeInRowFlags (const vi::VisBuffer2 &visBuffer, VisMapper &visibilities, FlagMapper &flags, casacore::uInt row) |
| Compute flags for a given visibilities point. More...
|
|
virtual bool | computeAntennaPairFlags (const vi::VisBuffer2 &visBuffer, VisMapper &visibilities, FlagMapper &flags, casacore::Int antenna1, casacore::Int antenna2, std::vector< casacore::uInt > &rows) |
| Compute flags for a given (time,freq) antenna pair map. More...
|
|
virtual bool | computeAntennaPairFlags (const vi::VisBuffer2 &visBuffer, FlagMapper &flags, casacore::Int antenna1, casacore::Int antenna2, std::vector< casacore::uInt > &rows) |
| Compute flags for a given (time,freq) antenna pair map w/o using visibilities. More...
|
|
bool | isStarted () const |
|
A top level class defining the interface for flagging agents.
Intended use:
Public interface
Prerequisite
Etymology
FlagAgentBase stands for a generic class, specific to the flagging operations
Synopsis
This is a top-level class defining the interface for flagging agents. There are various methods (virtual) that must be re-implemented by the specific derived classes, depending on the implemented algorithm. Here we find three categories:
- Iteration approach methods:
- computeRowFlags(const VisBuffer &visBuffer, FlagMapper &flags, casacore::uInt row)
- For agents that only depend on meta-data for their flagging operations (for FlagAgentManual,FlagAgentElevation,FlagAgentShadow,FlagAgentQuack)
- This iteration method can also be used by agents that have to inspect the already existing flags (for FlagAgentSummary, FlagAgentExtension)
- computeInRowFlags(const VisBuffer &visBuffer, VisMapper &visibilities,FlagMapper &flags, casacore::uInt row);
- For agents that have to look into the visibility points, but regardless of their source baseline, like FlagAgentDisplay
- computeAntennaPairFlags(const VisBuffer &visBuffer,FlagMapper &flags,casacore::Int antenna1,casacore::Int antenna2,vector<casacore::uInt> &rows);
- For agents that have to look into the visibility points grouped by baseline (FlagAgentTimeFreqCrop,FlagAgentRFlag)
- computeAntennaPairFlags(const VisBuffer &visBuffer, VisMapper &visibilities,FlagMapper &flags,casacore::Int antenna1,casacore::Int antenna2,vector<casacore::uInt> &rows)
- For agents that have to look into the visibility points grouped by baseline, allowing user-driven navigation (FlagAgentDisplay)
- NOTE: This method has to be used in combination with iterateAntennaPairsInteractive(antennaPairMap *antennaPairMap_ptr)
- Configuration methods:
- FlagAgentBase::FlagAgentBase
- Even though each derived agent has its specific constructor, it is necessary to call the base class constructor to set:
- The FlagDataHandler implementation pointer
- The iteration approach: For this the FlagAgentBase class contains an enumeration FlagAgentBase::iteration with the following modes:
- FlagAgentBase::ROWS: Iterate row by row and flag depending on the corresponding meta-data (for FlagAgentManual,FlagAgentQuack)
- FlagAgentBase::ROWS_PREPROCESS_BUFFER: Iterate row by row doing a pre-processing common to all the rows of each chunk (for FlagAgentElevation, FlagAgentShadow, FlagAgentSummary)
- FlagAgentBase::IN_ROWS: Iterate row by row and flag depending on the data column (for FlagAgentClipping)
- FlagAgentBase::ANTENNA_PAIRS: Iterate per baselines and flag depending on the data column (for FlagAgentTimeFreqCrop, FlagAgentRFlag)
- FlagAgentBase::ANTENNA_PAIRS_FLAGS: Iterate per baselines accessing the individual flag points (for FlagAgentExtension)
- FlagAgentBase::ANTENNA_PAIRS_INTERACTIVE: Iterate per baselines interactively accessing the data column (for FlagAgentDisplay)
- setAgentParameters(casacore::Record config)
- To parse the agent-specific parameters, although there is also an implementation of this method in the base class which has to be called to handle the following parameters:
- datacolumn: To specify the column in which the agent has to operate (see FlagAgentBase::datacolumn enumeration)
- correlation: To specify the correlation to be inspected for flagging (this also includes visibility expressions)
- meta-data selection parameters (field, spw, scan, baseline, etc): To feed the agent-level data selection engine (row filtering)
- Information methods
- FlagReport getReport()
- To return a specific report to be shown by the display agent, or containing accumulated information (e.g.: summaries, rflag tresholds)
Additionally there are public non-virtual methods to:
- Handle processing in 'background' mode (for parallel flagging)
- start(): Start service (start thread run method)
- terminate(): Terminate service (forcing run method to finish)
- queueProcess(): To signal flagging of the current VisBuffer
- completeProcess(): Wait until completion of flagging process for the current VisBuffer
- Print out percentage of flags produced by chunk or in total
- chunkSummary(): Accumulates statistics for each chunk
- tableSummary(): Accumulates statistics across the entire table selection
Motivation
The motivation for the FlagAgentBase class is having all the iteration and filtering capabilities grouped in one single class, with a common interface for all the agents w/o introducing anything specific to the implementation of each algorithm, thus improving modularization and maintainability.
Example
The top level interface of a flagging agent is quite simple once it is configured, this is due to the fact that most of the complexity lies in the FlagDataHandler-FlagAgentBase interaction, which is hidden from the application layer (already explained in the FlagDataHandler documentation).
FlagDataHandler *dh = new FlagMSHandler(inputFile,iterationMode);
agentConfig.
define(
"mode",
"quack");
FlagAgentList agentList;
agentList.push_back(agent);
while (dh->nextChunk())
{
while (dh->nextBuffer())
{
agentList.apply();
dh->flushFlags();
}
agentList.chunkSummary();
}
agentList.tableSummary();
agentList.terminate();
Definition at line 168 of file FlagAgentBase.h.