RFFlagCube.h
Classes
- RFFlagCube -- RFFlagCube: a cube of flags (full description)
Interface
- Public Members
- RFFlagCube ( RFChunkStats &ch,Bool ignore=False,Bool reset=False,LogIO &os=default_sink )
- ~RFFlagCube ()
- LogIO & logSink ()
- static uInt estimateMemoryUse ( const RFChunkStats &ch )
- void init ( RFlagWord polmsk,const String &name = "" )
- void cleanup ()
- String getSummary ()
- void printStats ()
- void plotStats (PGPlotterInterface &pgp)
- static Int numStatPlots (const RFChunkStats &chunk)
- FlagMatrix * reset ()
- FlagMatrix * advance ( uInt it,Bool getFlags=False )
- void getMSFlags ()
- void setMSFlags ()
- FlagCubeIterator newCustomIter ()
- const FlagMatrix & flagMatrix ()
- const FlagMatrix & rowFlagMatrix ()
- const LogicalMatrix rowFlagMap ()
- const LogicalMatrix rowAvailabilityMap ()
- Bool setFlag ( uInt ich,uInt ifr,FlagCubeIterator &iter )
- Bool clearFlag ( uInt ich,uInt ifr,FlagCubeIterator &iter )
- RFlagWord getFlag ( uInt ich,uInt ifr,FlagCubeIterator &iter )
- Bool setFlag ( uInt ich,uInt ifr )
- Bool clearFlag ( uInt ich,uInt ifr )
- RFlagWord getFlag ( uInt ich,uInt ifr )
- Bool preFlagged ( uInt ich,uInt ifr )
- Bool agentFlagged ( uInt ich,uInt ifr )
- Bool anyFlagged ( uInt ich,uInt ifr )
- Bool setRowFlag ( uInt ifr,uInt itime )
- Bool clearRowFlag ( uInt ifr,uInt itime )
- RFlagWord getRowFlag ( uInt ifr,uInt itime )
- Bool rowPreFlagged ( uInt ifr,uInt itime )
- Bool rowAgentFlagged ( uInt ifr,uInt itime )
- Bool rowFlagged ( uInt ifr,uInt itime )
- FlagCubeIterator & iterator ()
- RFlagWord flagMask ()
- RFlagWord corrMask ()
- RFlagWord checkCorrMask ()
- static RFlagWord fullCorrMask ()
- RFlagWord corrFlagMask ()
- static RFlagWord corrFlagMask ( RFlagWord cmask )
- static Int numInstances ()
- static void setMaxMem ( Int maxmem )
- static int getMaxMem ()
- Protected Members
- void plotIfrMap ( PGPlotterInterface &pgp,const Matrix<Float> &img,const LogicalVector &ifrvalid)
- void plotAntAxis ( PGPlotterInterface &pgp,const Vector<uInt> &antnums,Bool yaxis )
- void plotImage ( PGPlotterInterface &pgp,const Matrix<Float> &img, const char *labelx,const char *labely,const char *labeltop, Bool wedge = True,Float xbox=0,Float ybox=0,Bool xfreq=False)
- uInt num ( StatEnums which )
- static RFlagWord agent_corrmasks[sizeof(RFlagWord)*8]
Prerequisite
Synopsis
RFFlagCube implements an [NCHAN,NIFR,NTIME] cube of flags, stored in
a 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.
Example
Motivation
To Do
- add this feature
- fix this bug
- start discussion of this possible extension
Member Description
RFFlagCube ( RFChunkStats &ch,Bool ignore=False,Bool reset=False,LogIO &os=default_sink )
constructor
returns reference to logsink
static uInt estimateMemoryUse ( const RFChunkStats &ch )
returns estimated size of flag cube for a given chunk.
void init ( RFlagWord polmsk,const String &name = "" )
creates flag cube for current chunk. name is name of agent.
cleans up at end of chunk
returns summary of stats in text form
prints flagging stats to stderr
void plotStats (PGPlotterInterface &pgp)
produces a plot of the flagging stats
returns number of stat plots which will be done
FlagMatrix * reset ()
resets at start of pass
FlagMatrix * advance ( uInt it,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().
fills global flag lattice with apriori flags from a VisBuffer (if required)
transfers all flags from lattice into VisBuffer
creates a custom iterator
const FlagMatrix & flagMatrix ()
Returns full flag matrix (i.e. cursor of global iterator)
Returns matrix of row flags
const LogicalMatrix rowFlagMap ()
Returns boolean NIFRxNT map of row flags
Returns boolean NIFRxNT map of rows actually present in the data
Bool setFlag ( uInt ich,uInt ifr,FlagCubeIterator &iter )
sets or clears a flag at the given flag cursor
Bool clearFlag ( uInt ich,uInt ifr,FlagCubeIterator &iter )
RFlagWord getFlag ( uInt ich,uInt ifr,FlagCubeIterator &iter )
Gets full flag word at the given flag cursor.
Bool setFlag ( uInt ich,uInt ifr )
Versions of above that use global flag cursor
Bool clearFlag ( uInt ich,uInt ifr )
RFlagWord getFlag ( uInt ich,uInt ifr )
Bool preFlagged ( uInt ich,uInt ifr )
the preFlagged() function uses the corr-mask to tell if any of this
agent's correlations are pre-flagged. Uses internal cursor.
Bool agentFlagged ( uInt ich,uInt ifr )
The agentFlagged() uses the corr-flagmask to tell if any of my
correlations are flagged by any agent (including myself).
(i.e. has anyone flagged my correlations?). Uses internal cursor.
Bool anyFlagged ( uInt ich,uInt ifr )
This corresponds to preFlagged OR agentFlagged. Uses internal cursor.
Bool setRowFlag ( uInt ifr,uInt itime )
Sets or clears a row flag
Bool clearRowFlag ( uInt ifr,uInt itime )
RFlagWord getRowFlag ( uInt ifr,uInt itime )
Gets full row flag word
Bool rowPreFlagged ( uInt ifr,uInt itime )
tells if a row is pre-flagged in the MS (or does not exist)
tells if a row is flagged by any agent
Bool rowFlagged ( uInt ifr,uInt itime )
preFlagged OR agentFlagged
FlagCubeIterator & iterator ()
returns reference to internal iterator
returns flag mask for this agent
returns correlations mask for this agent
returns the checked-correlations mask for this agent
(=0 for RESET/IGNORE policies, or =corrMask() for HONOR policy).
returns mask of all correlations
returns combination of flag masks corresponding to agents that operate
on correlations in this agent's corrmask (including myself).
(in essence, flag&corrFlagMask() == has anyone flagged my correlations)
Invalidated by init(), and only becomes valid at next reset()!
static RFlagWord corrFlagMask ( RFlagWord cmask )
for the given corr-mask, returns the corrFlagMask
returns the number of instances of the flag cube
static void setMaxMem ( Int maxmem )
sets the maximum memory usage for the flag cube
returns the current maximum memory usage
void plotIfrMap ( PGPlotterInterface &pgp,const Matrix<Float> &img,const LogicalVector &ifrvalid)
helper methods for generating plots
void plotAntAxis ( PGPlotterInterface &pgp,const Vector<uInt> &antnums,Bool yaxis )
void plotImage ( PGPlotterInterface &pgp,const Matrix<Float> &img, const char *labelx,const char *labely,const char *labeltop, Bool wedge = True,Float xbox=0,Float ybox=0,Bool xfreq=False)
uInt num ( StatEnums which )
chunk
shortcut to RFChunkStats::num
static RFlagWord agent_corrmasks[sizeof(RFlagWord)*8]
bitmask for all correlations in MS (low N bits)
agent_corrmasks is an array of correlation masks for every object instance