RedFlagger.h

Classes

RedFlagger -- RedFlagger: high-performance automated flagging (full description)

class RedFlagger : public FlaggerEnums

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 &)

Description

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

Member Description

RFABase * createAgent ( const String &name,RFChunkStats &chunk,const RecordInterface &parms )

creates an agent by name

const RecordInterface & setupAgentDefaults ()

sets up record of agents and default parameters

void setupPlotters ( const RecordInterface &opt )

sets up debug and report plotting objects

void cleanupPlotters ()

detaches from all active plotters

void plotAgentReports ( PGPlotterInterface &pgp)

plots flagging reports from individual agents

void printAgentReports ( )

void plotSummaryReport ( PGPlotterInterface &pgp,RFChunkStats &chunk,const RecordInterface &opt )

plots a flagging summary

void printSummaryReport ( RFChunkStats &chunk,const RecordInterface &opt )

RedFlagger ()

default constructor

RedFlagger ( const MeasurementSet &ms )

construct and attach to a measurement set

~RedFlagger ()

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

void detach()

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 )

const MeasurementSet & measSet() const

returns current MS

uInt numAnt () const

number of antennas in MS

uInt numIfr () const

number of IFRs in MS

uInt numTime () const

number of time slots in MS

const Vector<String> & antNames() const

names of antennas

uInt ifrNumber ( Int ant1,Int ant2 ) const

derives a flat IFR index from two antenna indices

Vector<Int> ifrNumbers ( Vector<Int> ant1,Vector<Int> ant2 ) const

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

static LogIO & logSink ()

returns the log sink

PGPlotterInterface & pgprep ()

returns the flag report plotter

PGPlotterInterface & pgpscr ()

returns the screen ("debug") plotter

void setReportPanels ( Int nx,Int ny )

Uses SUBP to divide the flag report PGPlotter into subpanes. Keeps track of the current setting, so no extra pagebreaks are produced

Bool selectDataChannel(VisSet& vs, Vector<Int>& spectralwindowids, String& dataMode, Vector<Int>& dataNchan, Vector<Int>& dataStart, Vector<Int>& dataStep, MRadialVelocity& mDataStart, MRadialVelocity& mDataStep)

Utility function to do channel selection

RedFlagger( const RedFlagger & )

RedFlagger& operator=(const RedFlagger &)

void printAgentRecord(String &, uInt, const RecordInterface &)