casa::Flagger Class Reference

Flagger: high-performance automated flagging. More...

#include <Flagger.h>

Inheritance diagram for casa::Flagger:
casa::FlaggerEnums

List of all members.

Public Member Functions

 Flagger ()
 default constructor
 Flagger (MeasurementSet &ms)
 construct and attach to a measurement set
 ~Flagger ()
bool attach (MeasurementSet &ms, Bool setupAgentDefaults=True)
 Change or set the MS this Flagger refers to.
Bool selectdata (Bool useoriginalms=False, String field="", String spw="", String array="", String feed="", String scan="", String baseline="", String uvrange="", String time="", String correlation="", String intent="", String observation="")
 Set the data selection parameters.
Bool setdata (String field, String spw, String array, String feed, String scan, String baseline, String uvrange, String time, String correlation, String intent, String observation="")
 Make a data selection.
Bool setmanualflags (Bool autocorr, Bool unflag, String clipexpr, Vector< Double > cliprange, String clipcolumn, Bool outside, Bool channel_average, Double quackinterval=0.0, String quackmode=String("beg"), Bool quackincrement=Bool(false), String opmode=String("flag"), Double diameter=-1.0, Double lowerlimit=-1.0, Double upperlimit=91.0)
 Make a selection for manual flagging.
Bool clearflagselections (Int recordindex)
 Clean up all agents of type "select".
Bool printflagselections ()
Bool fillSelections (Record &rec)
 Fill the selection record to attach to the list of agents.
Bool setautoflagparams (String algorithm, Record &parameters)
 Set autoflag params.
Record getautoflagparams (String algorithm)
 Get default autoflag params.
Bool addAgent (RecordInterface &newAgent)
void detach ()
 Detaches from the MS.
Record run (Bool trial, Bool reset)
void summary (const RecordInterface &agents)
Bool saveFlagVersion (String versionname, String comment, String merge)
 flag version support.
Bool restoreFlagVersion (Vector< String > versionname, String merge)
Bool deleteFlagVersion (Vector< String > versionname)
Bool getFlagVersionList (Vector< String > &verlist)
const MeasurementSet & measSet () const
 returns current MS
uInt numAnt () const
 number of antennas in MS
uInt numIfr () const
 number of IFRs in MS
uInt numFeed () const
 number of feeds in MS
uInt numFeedCorr () const
 number of feed correlations 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 Public Member Functions

static const RecordInterface & defaultOptions ()
 returns a record of available options
static LogIO & logSink ()
 returns the log sink
static void reform_baselinelist (Matrix< Int > &baselinelist, unsigned nant)
static int my_aipspp_sum (const Array< Bool > &a)

Protected Member Functions

std::shared_ptr< RFABasecreateAgent (const String &name, RFChunkStats &chunk, const RecordInterface &parms, bool &only_selector)
 creates an agent by name
const RecordInterface & setupAgentDefaults ()
 sets up record of agents and default parameters
void printAgentReports ()
 print flagging reports from individual agents
void printSummaryReport (RFChunkStats &chunk)
Bool selectDataChannel ()

Protected Attributes

MeasurementSet ms
MeasurementSet originalms
std::vector< std::shared_ptr
< RFABase > > 
acc
MeasurementSet * mssel_p
 new added
VisSetvs_p
bool scan_looping
String msname_p
Bool nullSelect_p
Bool setdata_p
Bool selectdata_p
String dataMode_p
Vector< String > correlations_p
 Vector<Int> dataEnd_p; Vector<Int> dataStart_p, dataStep_p; Vector<Int> dataspectralwindowids_p; Vector<Int> spwidnchans_p;.
Vector< Int > datafieldids_p
Vector< Int > datadescids_p
MRadialVelocity mDataStart_p
MRadialVelocity mDataStep_p
uInt nant
uInt nifr
uInt nfeed
uInt nfeedcorr
Vector< Int > ifr2ant1
Vector< Int > ifr2ant2
Vector< String > antnames
Vector< Double > spwfreqs
Record agent_defaults

Static Protected Attributes

static LogIO os

Private Member Functions

 Flagger (const Flagger &)
Flaggeroperator= (const Flagger &)
void printAgentRecord (String &, uInt, const RecordInterface &)

Private Attributes

LogSink logSink_p
 Sink used to store history.
MeasurementSet * originalms_p
 Hold the original ms.
MSSelection * msselection_p
 MS Selection.
bool spw_selection
Record * agents_p
 List of Agents.
Int agentCount_p
Record * opts_p
 List of extra options.
Bool quack_agent_exists

Static Private Attributes

static const bool dbg
 Debug Message flag.

Detailed Description

Flagger: high-performance automated flagging.

Intended use:

Prerequisite

Etymology

MSFlagger and plain flagger were already taken.

Synopsis

Flagger 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); Flagger 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, Flagger was developed.

To Do

Definition at line 100 of file Flagger.h.


Constructor & Destructor Documentation

casa::Flagger::Flagger (  ) 

default constructor

casa::Flagger::Flagger ( MeasurementSet &  ms  ) 

construct and attach to a measurement set

casa::Flagger::~Flagger (  ) 
casa::Flagger::Flagger ( const Flagger  )  [inline, private]

Definition at line 266 of file Flagger.h.


Member Function Documentation

Bool casa::Flagger::addAgent ( RecordInterface &  newAgent  ) 
const Vector<String>& casa::Flagger::antNames (  )  const [inline]

names of antennas

Definition at line 237 of file Flagger.h.

References antnames.

bool casa::Flagger::attach ( MeasurementSet &  ms,
Bool  setupAgentDefaults = True 
)

Change or set the MS this Flagger refers to.

Bool casa::Flagger::clearflagselections ( Int  recordindex  ) 

Clean up all agents of type "select".

Bool clearflagselections(Vector<Int> &recordlist,Vector<String> &agentlist);

std::shared_ptr<RFABase> casa::Flagger::createAgent ( const String &  name,
RFChunkStats chunk,
const RecordInterface &  parms,
bool &  only_selector 
) [protected]

creates an agent by name

const RecordInterface& casa::Flagger::defaultAgents (  )  const [inline]

returns a record with all available agents and their default options

Definition at line 250 of file Flagger.h.

References agent_defaults.

static const RecordInterface& casa::Flagger::defaultOptions (  )  [static]

returns a record of available options

Bool casa::Flagger::deleteFlagVersion ( Vector< String >  versionname  ) 
void casa::Flagger::detach (  ) 

Detaches from the MS.

Bool casa::Flagger::fillSelections ( Record &  rec  ) 

Fill the selection record to attach to the list of agents.

Record casa::Flagger::getautoflagparams ( String  algorithm  ) 

Get default autoflag params.

Bool casa::Flagger::getFlagVersionList ( Vector< String > &  verlist  ) 
uInt casa::Flagger::ifrNumber ( Int  ant1,
Int  ant2 
) const

derives a flat IFR index from two antenna indices

Vector<Int> casa::Flagger::ifrNumbers ( Vector< Int >  ant1,
Vector< Int >  ant2 
) const

vector version of above

void casa::Flagger::ifrToAnt ( uInt &  ant1,
uInt &  ant2,
uInt  ifr 
) const

derives antenna indices from a flat IFR index

static LogIO& casa::Flagger::logSink (  )  [inline, static]

returns the log sink

Definition at line 257 of file Flagger.h.

References os.

const MeasurementSet& casa::Flagger::measSet (  )  const [inline]

returns current MS

Definition at line 218 of file Flagger.h.

References ms.

static int casa::Flagger::my_aipspp_sum ( const Array< Bool > &  a  )  [static]
uInt casa::Flagger::numAnt (  )  const [inline]

number of antennas in MS

Definition at line 221 of file Flagger.h.

References nant.

uInt casa::Flagger::numFeed (  )  const [inline]

number of feeds in MS

Definition at line 229 of file Flagger.h.

References nfeed.

uInt casa::Flagger::numFeedCorr (  )  const [inline]

number of feed correlations in MS

Definition at line 233 of file Flagger.h.

References nfeedcorr.

uInt casa::Flagger::numIfr (  )  const [inline]

number of IFRs in MS

Definition at line 225 of file Flagger.h.

References nifr.

Flagger& casa::Flagger::operator= ( const Flagger  )  [inline, private]

Definition at line 268 of file Flagger.h.

void casa::Flagger::printAgentRecord ( String &  ,
uInt  ,
const RecordInterface &   
) [private]
void casa::Flagger::printAgentReports (  )  [protected]

print flagging reports from individual agents

Bool casa::Flagger::printflagselections (  ) 
void casa::Flagger::printSummaryReport ( RFChunkStats chunk  )  [protected]
static void casa::Flagger::reform_baselinelist ( Matrix< Int > &  baselinelist,
unsigned  nant 
) [static]
Bool casa::Flagger::restoreFlagVersion ( Vector< String >  versionname,
String  merge 
)
Record casa::Flagger::run ( Bool  trial,
Bool  reset 
)
Bool casa::Flagger::saveFlagVersion ( String  versionname,
String  comment,
String  merge 
)

flag version support.

Bool casa::Flagger::selectdata ( Bool  useoriginalms = False,
String  field = "",
String  spw = "",
String  array = "",
String  feed = "",
String  scan = "",
String  baseline = "",
String  uvrange = "",
String  time = "",
String  correlation = "",
String  intent = "",
String  observation = "" 
)

Set the data selection parameters.

Bool casa::Flagger::selectDataChannel (  )  [protected]
Bool casa::Flagger::setautoflagparams ( String  algorithm,
Record &  parameters 
)

Set autoflag params.

Bool casa::Flagger::setdata ( String  field,
String  spw,
String  array,
String  feed,
String  scan,
String  baseline,
String  uvrange,
String  time,
String  correlation,
String  intent,
String  observation = "" 
)

Make a data selection.

Bool casa::Flagger::setmanualflags ( Bool  autocorr,
Bool  unflag,
String  clipexpr,
Vector< Double >  cliprange,
String  clipcolumn,
Bool  outside,
Bool  channel_average,
Double  quackinterval = 0.0,
String  quackmode = String("beg"),
Bool  quackincrement = Bool(false),
String  opmode = String("flag"),
Double  diameter = -1.0,
Double  lowerlimit = -1.0,
Double  upperlimit = 91.0 
)

Make a selection for manual flagging.

const RecordInterface& casa::Flagger::setupAgentDefaults (  )  [protected]

sets up record of agents and default parameters

void casa::Flagger::summary ( const RecordInterface &  agents  ) 

Member Data Documentation

std::vector<std::shared_ptr<RFABase> > casa::Flagger::acc [protected]

Definition at line 117 of file Flagger.h.

Record casa::Flagger::agent_defaults [protected]

Definition at line 145 of file Flagger.h.

Referenced by defaultAgents().

Definition at line 284 of file Flagger.h.

Record* casa::Flagger::agents_p [private]

List of Agents.

Definition at line 283 of file Flagger.h.

Vector<String> casa::Flagger::antnames [protected]

Definition at line 142 of file Flagger.h.

Referenced by antNames().

Vector<String> casa::Flagger::correlations_p [protected]

Vector<Int> dataEnd_p; Vector<Int> dataStart_p, dataStep_p; Vector<Int> dataspectralwindowids_p; Vector<Int> spwidnchans_p;.

Definition at line 133 of file Flagger.h.

Vector<Int> casa::Flagger::datadescids_p [protected]

Definition at line 135 of file Flagger.h.

Vector<Int> casa::Flagger::datafieldids_p [protected]

Definition at line 134 of file Flagger.h.

String casa::Flagger::dataMode_p [protected]

Definition at line 127 of file Flagger.h.

const bool casa::Flagger::dbg [static, private]

Debug Message flag.

Definition at line 290 of file Flagger.h.

Vector<Int> casa::Flagger::ifr2ant1 [protected]

Definition at line 141 of file Flagger.h.

Vector<Int> casa::Flagger::ifr2ant2 [protected]

Definition at line 141 of file Flagger.h.

LogSink casa::Flagger::logSink_p [private]

Sink used to store history.

Definition at line 273 of file Flagger.h.

MRadialVelocity casa::Flagger::mDataStart_p [protected]

Definition at line 136 of file Flagger.h.

MRadialVelocity casa::Flagger::mDataStep_p [protected]

Definition at line 137 of file Flagger.h.

MeasurementSet casa::Flagger::ms [protected]

Definition at line 115 of file Flagger.h.

Referenced by measSet().

String casa::Flagger::msname_p [protected]

Definition at line 123 of file Flagger.h.

MeasurementSet* casa::Flagger::mssel_p [protected]

new added

Definition at line 120 of file Flagger.h.

MSSelection* casa::Flagger::msselection_p [private]

MS Selection.

Definition at line 279 of file Flagger.h.

uInt casa::Flagger::nant [protected]

Definition at line 140 of file Flagger.h.

Referenced by numAnt().

uInt casa::Flagger::nfeed [protected]

Definition at line 140 of file Flagger.h.

Referenced by numFeed().

uInt casa::Flagger::nfeedcorr [protected]

Definition at line 140 of file Flagger.h.

Referenced by numFeedCorr().

uInt casa::Flagger::nifr [protected]

Definition at line 140 of file Flagger.h.

Referenced by numIfr().

Bool casa::Flagger::nullSelect_p [protected]

Definition at line 124 of file Flagger.h.

Record* casa::Flagger::opts_p [private]

List of extra options.

Definition at line 287 of file Flagger.h.

MeasurementSet casa::Flagger::originalms [protected]

Definition at line 116 of file Flagger.h.

MeasurementSet* casa::Flagger::originalms_p [private]

Hold the original ms.

Definition at line 276 of file Flagger.h.

LogIO casa::Flagger::os [static, protected]

Definition at line 147 of file Flagger.h.

Referenced by logSink().

Definition at line 292 of file Flagger.h.

bool casa::Flagger::scan_looping [protected]

Definition at line 122 of file Flagger.h.

Bool casa::Flagger::selectdata_p [protected]

Definition at line 126 of file Flagger.h.

Bool casa::Flagger::setdata_p [protected]

Definition at line 125 of file Flagger.h.

Definition at line 280 of file Flagger.h.

Vector<Double> casa::Flagger::spwfreqs [protected]

Definition at line 143 of file Flagger.h.

Definition at line 121 of file Flagger.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1