casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes
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 MeasurementSetmeasSet () 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< IntifrNumbers (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 RecordInterfacedefaultAgents () const
 returns a record with all available agents and their default options

Static Public Member Functions

static const RecordInterfacedefaultOptions ()
 returns a record of available options
static LogIOlogSink ()
 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

boost::shared_ptr< RFABasecreateAgent (const String &name, RFChunkStats &chunk, const RecordInterface &parms, bool &only_selector)
 creates an agent by name
const RecordInterfacesetupAgentDefaults ()
 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< boost::shared_ptr
< RFABase > > 
acc
MeasurementSetmssel_p
 new added
VisSetvs_p
bool scan_looping
String msname_p
Bool nullSelect_p
Bool setdata_p
Bool selectdata_p
String dataMode_p
Vector< Stringcorrelations_p
 Vector<Int> dataEnd_p; Vector<Int> dataStart_p, dataStep_p; Vector<Int> dataspectralwindowids_p; Vector<Int> spwidnchans_p;.
Vector< Intdatafieldids_p
Vector< Intdatadescids_p
MRadialVelocity mDataStart_p
MRadialVelocity mDataStep_p
uInt nant
uInt nifr
uInt nfeed
uInt nfeedcorr
Vector< Intifr2ant1
Vector< Intifr2ant2
Vector< Stringantnames
Vector< Doublespwfreqs
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.
MeasurementSetoriginalms_p
 Hold the original ms.
MSSelectionmsselection_p
 MS Selection.
bool spw_selection
Recordagents_p
 List of Agents.
Int agentCount_p
Recordopts_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 102 of file Flagger.h.


Constructor & Destructor Documentation

default constructor

construct and attach to a measurement set

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

Definition at line 268 of file Flagger.h.


Member Function Documentation

const Vector<String>& casa::Flagger::antNames ( ) const [inline]

names of antennas

Definition at line 239 of file Flagger.h.

References antnames.

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

Change or set the MS this Flagger refers to.

Clean up all agents of type "select".

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

boost::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 252 of file Flagger.h.

References agent_defaults.

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

returns a record of available options

Detaches from the MS.

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

Get default autoflag params.

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 259 of file Flagger.h.

References os.

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

returns current MS

Definition at line 220 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 223 of file Flagger.h.

References nant.

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

number of feeds in MS

Definition at line 231 of file Flagger.h.

References nfeed.

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

number of feed correlations in MS

Definition at line 235 of file Flagger.h.

References nfeedcorr.

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

number of IFRs in MS

Definition at line 227 of file Flagger.h.

References nifr.

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

Definition at line 270 of file Flagger.h.

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

print flagging reports from individual agents

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::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.

sets up record of agents and default parameters

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

Member Data Documentation

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

Definition at line 119 of file Flagger.h.

Definition at line 147 of file Flagger.h.

Referenced by defaultAgents().

Definition at line 286 of file Flagger.h.

List of Agents.

Definition at line 285 of file Flagger.h.

Definition at line 144 of file Flagger.h.

Referenced by antNames().

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

Definition at line 135 of file Flagger.h.

Definition at line 137 of file Flagger.h.

Definition at line 136 of file Flagger.h.

Definition at line 129 of file Flagger.h.

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

Debug Message flag.

Definition at line 292 of file Flagger.h.

Definition at line 143 of file Flagger.h.

Definition at line 143 of file Flagger.h.

Sink used to store history.

Definition at line 275 of file Flagger.h.

Definition at line 138 of file Flagger.h.

Definition at line 139 of file Flagger.h.

Definition at line 117 of file Flagger.h.

Referenced by measSet().

Definition at line 125 of file Flagger.h.

new added

Definition at line 122 of file Flagger.h.

MS Selection.

Definition at line 281 of file Flagger.h.

Definition at line 142 of file Flagger.h.

Referenced by numAnt().

Definition at line 142 of file Flagger.h.

Referenced by numFeed().

Definition at line 142 of file Flagger.h.

Referenced by numFeedCorr().

Definition at line 142 of file Flagger.h.

Referenced by numIfr().

Definition at line 126 of file Flagger.h.

List of extra options.

Definition at line 289 of file Flagger.h.

Definition at line 118 of file Flagger.h.

Hold the original ms.

Definition at line 278 of file Flagger.h.

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

Definition at line 149 of file Flagger.h.

Referenced by logSink().

Definition at line 294 of file Flagger.h.

bool casa::Flagger::scan_looping [protected]

Definition at line 124 of file Flagger.h.

Definition at line 128 of file Flagger.h.

Definition at line 127 of file Flagger.h.

Definition at line 282 of file Flagger.h.

Definition at line 145 of file Flagger.h.

Definition at line 123 of file Flagger.h.


The documentation for this class was generated from the following file: