RedFlagger.h
Classes
- RedFlagger -- RedFlagger: high-performance automated flagging (full description)
Interface
- Protected Members
- RFABase * createAgent ( const String &name,RFChunkStats &chunk,const RecordInterface &parms )
- const RecordInterface & setupAgentDefaults ()
- void setupPlotters ( const RecordInterface &opt )
- void cleanupPlotters ()
- void plotAgentReports ( PGPlotterInterface &pgp)
- void printAgentReports ( )
- void plotSummaryReport ( PGPlotterInterface &pgp,RFChunkStats &chunk,const RecordInterface &opt )
- void printSummaryReport ( RFChunkStats &chunk,const RecordInterface &opt )
- Public Members
- RedFlagger ()
- RedFlagger ( const MeasurementSet &ms )
- ~RedFlagger ()
- void attach( const MeasurementSet &ms, Bool setupAgentDefaults=True )
- Bool setdata(const String& mode, const Vector<Int>& nchan, const Vector<Int>& start, const Vector<Int>& step, const MRadialVelocity& mStart, const MRadialVelocity& mStep, const Vector<Int>& spectralwindowids, const Vector<Int>& fieldid, const String& msSelect="")
- void detach()
- void run ( const RecordInterface &agents,const RecordInterface &opt,uInt indexing_base=0 )
- void summary ( const RecordInterface &agents,const RecordInterface &opt,uInt indexing_base=0 )
- const MeasurementSet & measSet() const
- uInt numAnt () const
- uInt numIfr () const
- uInt numTime () const
- const Vector<String> & antNames() const
- uInt ifrNumber ( Int ant1,Int ant2 ) const
- Vector<Int> ifrNumbers ( Vector<Int> ant1,Vector<Int> ant2 ) const
- void ifrToAnt ( uInt &ant1,uInt &ant2,uInt ifr ) const
- const RecordInterface & defaultAgents () const
- static const RecordInterface & defaultOptions ()
- static LogIO & logSink ()
- PGPlotterInterface & pgprep ()
- PGPlotterInterface & pgpscr ()
- void setReportPanels ( Int nx,Int ny )
- Bool selectDataChannel(VisSet& vs, Vector<Int>& spectralwindowids, String& dataMode, Vector<Int>& dataNchan, Vector<Int>& dataStart, Vector<Int>& dataStep, MRadialVelocity& mDataStart, MRadialVelocity& mDataStep)
- Private Members
- RedFlagger( const RedFlagger & )
- RedFlagger& operator=(const RedFlagger &)
- void printAgentRecord(String &, uInt, const RecordInterface &)
Prerequisite
Etymology
If it flags, why not red? Plus MSFlagger and plain flagger were already
taken.
Synopsis
RedFlagger performs automated flagging operations on a measurement set.
The class is constructed from an MS. After that, the run method may be used
to run any number of flagging agents.
Example
// construct MS and flagger
MeasurementSet ms("test.MS2",Table::Update);
RedFlagger flagger(ms);
// build record of global flagging options
Record opt(Record::Variable);
// build record of flagging agents to be run
Record selopt( flagger.defaultAgents().asRecord("select") );
selopt.define(RF_POLICY,"RESET");
selopt.define(RF_AUTOCORR,True);
Record agents(Record::Variable);
agents.defineRecord("select",selopt);
// perform the flagging
flagger.run(agents,opt);
Motivation
We need an automated flagging tool. Existing tools (MSFlagger and flagger.g)
were too slow. Hence, RedFlagger was developed.
To Do
- add this feature
- fix this bug
- start discussion of this possible extension
Member Description
RFABase * createAgent ( const String &name,RFChunkStats &chunk,const RecordInterface &parms )
creates an agent by name
sets up record of agents and default parameters
void setupPlotters ( const RecordInterface &opt )
sets up debug and report plotting objects
detaches from all active plotters
plots flagging reports from individual agents
void plotSummaryReport ( PGPlotterInterface &pgp,RFChunkStats &chunk,const RecordInterface &opt )
plots a flagging summary
default constructor
RedFlagger ( const MeasurementSet &ms )
construct and attach to a measurement set
void attach( const MeasurementSet &ms, Bool setupAgentDefaults=True )
Change or set the MS this RedFlagger refers to.
Bool setdata(const String& mode, const Vector<Int>& nchan, const Vector<Int>& start, const Vector<Int>& step, const MRadialVelocity& mStart, const MRadialVelocity& mStep, const Vector<Int>& spectralwindowids, const Vector<Int>& fieldid, const String& msSelect="")
Set the data selection parameters
Detaches from the MS
void run ( const RecordInterface &agents,const RecordInterface &opt,uInt indexing_base=0 )
Runs the flagger. agent is a record of agents (name+options). opt is a
record of additional options.
Set indexing_base to 1 if agent options use 1-based indexing. usually,
this is only necessary if options are being passed from Glish.
void summary ( const RecordInterface &agents,const RecordInterface &opt,uInt indexing_base=0 )
returns current MS
uInt numAnt () const
number of antennas in MS
uInt numIfr () const
number of IFRs in MS
number of time slots in MS
names of antennas
uInt ifrNumber ( Int ant1,Int ant2 ) const
derives a flat IFR index from two antenna indices
vector version of above
void ifrToAnt ( uInt &ant1,uInt &ant2,uInt ifr ) const
derives antenna indices from a flat IFR index
const RecordInterface & defaultAgents () const
returns a record with all available agents and their default options
static const RecordInterface & defaultOptions ()
returns a record of available options
returns the log sink
PGPlotterInterface & pgprep ()
returns the flag report plotter
PGPlotterInterface & pgpscr ()
returns the screen ("debug") plotter
Uses SUBP to divide the flag report PGPlotter into subpanes.
Keeps track of the current setting, so no extra pagebreaks are produced
Utility function to do channel selection
RedFlagger( const RedFlagger & )
RedFlagger& operator=(const RedFlagger &)