casa
5.7.0-16
|
RFFlagCube: a cube of flags. More...
#include <RFFlagCube.h>
Public Member Functions | |
RFFlagCube (RFChunkStats &ch, casacore::Bool ignore=false, casacore::Bool reset=false, casacore::LogIO &os=default_sink) | |
constructor More... | |
~RFFlagCube () | |
casacore::LogIO & | logSink () |
returns reference to logsink More... | |
void | init (RFlagWord polmsk, casacore::uInt nAgent, bool is_selector, const casacore::String &name="") |
creates flag cube for current chunk. More... | |
void | cleanup () |
cleans up at end of chunk More... | |
casacore::String | getSummary () |
returns summary of stats in text form More... | |
void | printStats () |
prints flagging stats to stderr More... | |
void | reset () |
resets at start of pass More... | |
void | advance (casacore::uInt it, casacore::Bool getFlags=false) |
advances global flag iterator to time slot it (if required), sets the flag cursor from the iterator (see below). More... | |
void | getMSFlags (casacore::uInt it) |
fills global flag lattice with apriori flags from a VisBuffer (if required) More... | |
void | setMSFlags (casacore::uInt itime) |
transfers all flags from lattice into VisBuffer More... | |
FlagCubeIterator | newCustomIter () |
creates a custom iterator More... | |
const FlagMatrix & | flagMatrix () |
Returns full flag matrix (i.e. More... | |
casacore::Bool | setFlag (casacore::uInt ich, casacore::uInt ifr, FlagCubeIterator &iter) |
sets or clears a flag at the given flag cursor More... | |
casacore::Bool | clearFlag (casacore::uInt ich, casacore::uInt ifr, FlagCubeIterator &iter) |
RFlagWord | getFlag (casacore::uInt ich, casacore::uInt ifr, FlagCubeIterator &iter) |
Gets full flag word at the given flag cursor. More... | |
casacore::Bool | setFlag (casacore::uInt ich, casacore::uInt ifr) |
Versions of above that use global flag cursor. More... | |
casacore::Bool | clearFlag (casacore::uInt ich, casacore::uInt ifr) |
RFlagWord | getFlag (casacore::uInt ich, casacore::uInt ifr) |
casacore::Bool | preFlagged (casacore::uInt ich, casacore::uInt ifr) |
the preFlagged() function uses the corr-mask to tell if any of this agent's correlations are pre-flagged. More... | |
casacore::Bool | anyFlagged (casacore::uInt ich, casacore::uInt ifr) |
The anyFlagged() uses the corr-flagmask to tell if any of my correlations are flagged either by any agent or pre-flagged Uses internal cursor. More... | |
casacore::Bool | setRowFlag (casacore::uInt ifr, casacore::uInt itime) |
Sets or clears a row flag. More... | |
casacore::Bool | clearRowFlag (casacore::uInt ifr, casacore::uInt itime) |
RFlagWord | getRowFlag (casacore::uInt ifr, casacore::uInt itime) |
Gets full row flag word. More... | |
casacore::Bool | rowPreFlagged (casacore::uInt ifr, casacore::uInt itime) |
tells if a row is pre-flagged in the casacore::MS (or does not exist) More... | |
casacore::Bool | rowAgentFlagged (casacore::uInt ifr, casacore::uInt itime) |
tells if a row is flagged by any agent More... | |
casacore::Bool | rowFlagged (casacore::uInt ifr, casacore::uInt itime) |
preFlagged OR agentFlagged More... | |
FlagCubeIterator & | iterator () |
returns reference to internal iterator More... | |
RFlagWord | flagMask () |
returns flag mask for this agent More... | |
RFlagWord | corrMask () |
returns correlations mask for this agent More... | |
RFlagWord | checkCorrMask () |
returns the checked-correlations mask for this agent (=0 for RESET/IGNORE policies, or =corrMask() for HONOR policy). More... | |
Static Public Member Functions | |
static casacore::uInt | estimateMemoryUse (const RFChunkStats &ch) |
returns estimated size of flag cube for a given chunk. More... | |
static RFlagWord | fullCorrMask () |
returns mask of all correlations More... | |
static casacore::Int | numInstances () |
returns the number of instances of the flag cube More... | |
static void | setMaxMem (casacore::Int maxmem) |
sets the maximum memory usage for the flag cube More... | |
static int | getMaxMem () |
returns the current maximum memory usage More... | |
Static Public Attributes | |
static casacore::LogIO | default_sink |
default log sink More... | |
Private Member Functions | |
casacore::uInt | num (StatEnums which) |
shortcut to RFChunkStats::num More... | |
Private Attributes | |
RFChunkStats & | chunk |
bool | kiss |
bool | kiss_flagrow |
RFlagWord | flagmask |
Flag mask used by this instance. More... | |
RFlagWord | corrmask |
RFlagWord | check_corrmask |
RFlagWord | check_rowmask |
RESET or IGNORE policy, or to corrmask for HONOR. More... | |
RFlagWord | my_corrflagmask |
unsigned long | flagmask_kiss |
casacore::LogIO | os |
log sink More... | |
PreFlagPolicy | pfpolicy |
pre-flag policy (can be set on a per-instance basis) More... | |
casacore::uInt | tot_fl_raised |
flagging stats for this instance More... | |
casacore::uInt | fl_raised |
casacore::uInt | fl_cleared |
casacore::uInt | tot_row_fl_raised |
casacore::uInt | row_fl_raised |
casacore::uInt | row_fl_cleared |
FlagMatrix * | flag_curs |
local flag cursor used by this instance (setFlag and clearFlag). More... | |
casacore::uInt | flag_itime |
Static Private Attributes | |
static casacore::Cube < casacore::Bool > | in_flags |
static int | in_flags_time |
static bool | in_flags_flushed |
static RFCubeLattice< RFlagWord > | flag |
static FlagMatrix | flagrow |
static casacore::Matrix < std::vector< bool > > | flagrow_kiss |
static casacore::Int | pos_get_flag |
static casacore::Int | pos_set_flag |
static casacore::Bool | reset_preflags |
static casacore::uInt | npol |
static casacore::uInt | nchan |
static casacore::Int | agent_count |
<n> is the value of this variable More... | |
static RFlagWord | base_flagmask |
static RFlagWord | full_corrmask |
static casacore::Vector < RFlagWord > | corr_flagmask |
corr_flagmask is a mapping from corrmasks into masks of agents that flag the given corrmask More... | |
static casacore::Int | num_inst |
number of instances in use More... | |
Additional Inherited Members | |
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 } |
RFFlagCube: a cube of flags.
Internal
RFFlagCube implements an [NCHAN,NIFR,NTIME] cube of flags, stored in a casacore::TempLattice that is iterated alog the TIME axis. One static (i.e. global) cube is used to hold the actual flags. Individual instances (instantiated by flagging agents) have individual unique bitmasks and, possibly, individual iterators.
It was/is a design mistake to use a global/static buffer to hold the shared flags. Instead, every agent should point to the unique dynamically allocated buffer.
Definition at line 91 of file RFFlagCube.h.
casa::RFFlagCube::RFFlagCube | ( | RFChunkStats & | ch, |
casacore::Bool | ignore = false , |
||
casacore::Bool | reset = false , |
||
casacore::LogIO & | os = default_sink |
||
) |
constructor
casa::RFFlagCube::~RFFlagCube | ( | ) |
void casa::RFFlagCube::advance | ( | casacore::uInt | it, |
casacore::Bool | getFlags = false |
||
) |
advances global flag iterator to time slot it (if required), sets the flag cursor from the iterator (see below).
If getflags is true, also calls getDataFlags().
|
inline |
The anyFlagged() uses the corr-flagmask to tell if any of my correlations are flagged either by any agent or pre-flagged Uses internal cursor.
Definition at line 322 of file RFFlagCube.h.
References check_corrmask, getFlag(), kiss, and my_corrflagmask.
|
inline |
returns the checked-correlations mask for this agent (=0 for RESET/IGNORE policies, or =corrMask() for HONOR policy).
Definition at line 277 of file RFFlagCube.h.
References check_corrmask.
void casa::RFFlagCube::cleanup | ( | ) |
cleans up at end of chunk
casacore::Bool casa::RFFlagCube::clearFlag | ( | casacore::uInt | ich, |
casacore::uInt | ifr, | ||
FlagCubeIterator & | iter | ||
) |
Referenced by clearFlag().
|
inline |
Definition at line 307 of file RFFlagCube.h.
References clearFlag(), flag, and casa::RFCubeLattice< T >::iterator().
casacore::Bool casa::RFFlagCube::clearRowFlag | ( | casacore::uInt | ifr, |
casacore::uInt | itime | ||
) |
|
inline |
returns correlations mask for this agent
Definition at line 272 of file RFFlagCube.h.
References corrmask.
|
static |
returns estimated size of flag cube for a given chunk.
|
inline |
returns flag mask for this agent
Definition at line 264 of file RFFlagCube.h.
|
inline |
Returns full flag matrix (i.e.
cursor of global iterator)
Definition at line 316 of file RFFlagCube.h.
References flag_curs.
|
inlinestatic |
returns mask of all correlations
Definition at line 280 of file RFFlagCube.h.
References full_corrmask.
|
inline |
Gets full flag word at the given flag cursor.
Definition at line 283 of file RFFlagCube.h.
References casacore::C::c, casa::FlaggerEnums::CORR, corrmask, in_flags, kiss, and num().
Referenced by anyFlagged(), getFlag(), and preFlagged().
|
inline |
Definition at line 310 of file RFFlagCube.h.
References flag, getFlag(), and casa::RFCubeLattice< T >::iterator().
|
static |
returns the current maximum memory usage
void casa::RFFlagCube::getMSFlags | ( | casacore::uInt | it | ) |
fills global flag lattice with apriori flags from a VisBuffer (if required)
|
inline |
Gets full row flag word.
Definition at line 331 of file RFFlagCube.h.
Referenced by rowAgentFlagged(), rowFlagged(), and rowPreFlagged().
casacore::String casa::RFFlagCube::getSummary | ( | ) |
returns summary of stats in text form
void casa::RFFlagCube::init | ( | RFlagWord | polmsk, |
casacore::uInt | nAgent, | ||
bool | is_selector, | ||
const casacore::String & | name = "" |
||
) |
creates flag cube for current chunk.
name is name of agent. nAgent is total number of agents
|
inline |
returns reference to internal iterator
Definition at line 351 of file RFFlagCube.h.
References flag, and casa::RFCubeLattice< T >::iterator().
|
inline |
|
inline |
creates a custom iterator
Definition at line 313 of file RFFlagCube.h.
References flag, and casa::RFCubeLattice< T >::newIter().
|
inlineprivate |
shortcut to RFChunkStats::num
Definition at line 212 of file RFFlagCube.h.
References chunk, and casa::RFChunkStats::num().
Referenced by getFlag().
|
inlinestatic |
returns the number of instances of the flag cube
Definition at line 354 of file RFFlagCube.h.
References num_inst.
|
inline |
the preFlagged() function uses the corr-mask to tell if any of this agent's correlations are pre-flagged.
Uses internal cursor.
Definition at line 319 of file RFFlagCube.h.
References check_corrmask, and getFlag().
void casa::RFFlagCube::printStats | ( | ) |
prints flagging stats to stderr
void casa::RFFlagCube::reset | ( | ) |
resets at start of pass
|
inline |
tells if a row is flagged by any agent
Definition at line 344 of file RFFlagCube.h.
References getRowFlag(), casa::RowAbsent, and casa::RowFlagged.
|
inline |
preFlagged OR agentFlagged
Definition at line 348 of file RFFlagCube.h.
References check_rowmask, getRowFlag(), and casa::RowFlagged.
|
inline |
tells if a row is pre-flagged in the casacore::MS (or does not exist)
Definition at line 340 of file RFFlagCube.h.
References check_rowmask, and getRowFlag().
casacore::Bool casa::RFFlagCube::setFlag | ( | casacore::uInt | ich, |
casacore::uInt | ifr, | ||
FlagCubeIterator & | iter | ||
) |
sets or clears a flag at the given flag cursor
Referenced by setFlag().
|
inline |
Versions of above that use global flag cursor.
Definition at line 304 of file RFFlagCube.h.
References flag, casa::RFCubeLattice< T >::iterator(), and setFlag().
|
static |
sets the maximum memory usage for the flag cube
void casa::RFFlagCube::setMSFlags | ( | casacore::uInt | itime | ) |
transfers all flags from lattice into VisBuffer
casacore::Bool casa::RFFlagCube::setRowFlag | ( | casacore::uInt | ifr, |
casacore::uInt | itime | ||
) |
Sets or clears a row flag.
|
staticprivate |
<n> is the value of this variable
Definition at line 236 of file RFFlagCube.h.
|
staticprivate |
Definition at line 237 of file RFFlagCube.h.
|
private |
Definition at line 228 of file RFFlagCube.h.
Referenced by anyFlagged(), checkCorrMask(), and preFlagged().
|
private |
RESET or IGNORE policy, or to corrmask for HONOR.
Definition at line 228 of file RFFlagCube.h.
Referenced by rowFlagged(), and rowPreFlagged().
|
private |
Definition at line 202 of file RFFlagCube.h.
Referenced by num().
|
staticprivate |
corr_flagmask is a mapping from corrmasks into masks of agents that flag the given corrmask
Definition at line 242 of file RFFlagCube.h.
|
private |
Definition at line 228 of file RFFlagCube.h.
Referenced by corrMask(), and getFlag().
|
static |
default log sink
Definition at line 95 of file RFFlagCube.h.
|
private |
Definition at line 251 of file RFFlagCube.h.
|
private |
Definition at line 251 of file RFFlagCube.h.
|
staticprivate |
Definition at line 214 of file RFFlagCube.h.
Referenced by clearFlag(), getFlag(), iterator(), newCustomIter(), and setFlag().
|
private |
local flag cursor used by this instance (setFlag and clearFlag).
Normally, set to flag.cursor() in advance(), but can be overridden by setFlagCursor();
Definition at line 257 of file RFFlagCube.h.
Referenced by flagMatrix().
|
private |
Definition at line 258 of file RFFlagCube.h.
|
private |
Flag mask used by this instance.
Each instance has a unique 1-bit mask. This is assigned automatically in the constructor, by updating the instance count and the nextmask member. Note that the low N bits of a mask are assigned to pre-flags (one per each correlation in the casacore::MS); so the agents start at bit N+1.
Definition at line 228 of file RFFlagCube.h.
Referenced by flagMask().
|
private |
Definition at line 234 of file RFFlagCube.h.
|
staticprivate |
Definition at line 215 of file RFFlagCube.h.
Referenced by getRowFlag().
|
staticprivate |
Definition at line 216 of file RFFlagCube.h.
|
staticprivate |
Definition at line 237 of file RFFlagCube.h.
Referenced by fullCorrMask().
|
staticprivate |
Definition at line 207 of file RFFlagCube.h.
Referenced by getFlag().
|
staticprivate |
Definition at line 209 of file RFFlagCube.h.
|
staticprivate |
Definition at line 208 of file RFFlagCube.h.
|
private |
Definition at line 204 of file RFFlagCube.h.
Referenced by anyFlagged(), flagMask(), getFlag(), and getRowFlag().
|
private |
Definition at line 205 of file RFFlagCube.h.
|
private |
Definition at line 228 of file RFFlagCube.h.
Referenced by anyFlagged().
|
staticprivate |
Definition at line 221 of file RFFlagCube.h.
|
staticprivate |
Definition at line 221 of file RFFlagCube.h.
|
staticprivate |
number of instances in use
Definition at line 261 of file RFFlagCube.h.
Referenced by numInstances().
|
private |
|
private |
pre-flag policy (can be set on a per-instance basis)
Definition at line 248 of file RFFlagCube.h.
|
staticprivate |
Definition at line 217 of file RFFlagCube.h.
|
staticprivate |
Definition at line 217 of file RFFlagCube.h.
|
staticprivate |
Definition at line 219 of file RFFlagCube.h.
|
private |
Definition at line 251 of file RFFlagCube.h.
|
private |
Definition at line 251 of file RFFlagCube.h.
|
private |
flagging stats for this instance
Definition at line 251 of file RFFlagCube.h.
|
private |
Definition at line 251 of file RFFlagCube.h.