Flagger: high-performance automated flagging. More...
#include <Flagger.h>
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 ¶meters) |
| 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< RFABase > | createAgent (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 | |
| VisSet * | vs_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 &) | |
| Flagger & | operator= (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. | |
Flagger: high-performance automated flagging.
MSFlagger and plain flagger were already taken.
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.
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);
We need an automated flagging tool. Existing tools (MSFlagger and flagger.g) were too slow. Hence, Flagger was developed.
Definition at line 100 of file Flagger.h.
| 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] |
| Bool casa::Flagger::addAgent | ( | RecordInterface & | newAgent | ) |
| const Vector<String>& casa::Flagger::antNames | ( | ) | const [inline] |
| 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] |
| const MeasurementSet& casa::Flagger::measSet | ( | ) | const [inline] |
| static int casa::Flagger::my_aipspp_sum | ( | const Array< Bool > & | a | ) | [static] |
| uInt casa::Flagger::numAnt | ( | ) | const [inline] |
| uInt casa::Flagger::numFeed | ( | ) | const [inline] |
| uInt casa::Flagger::numFeedCorr | ( | ) | const [inline] |
| uInt casa::Flagger::numIfr | ( | ) | const [inline] |
| 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 | ) |
std::vector<std::shared_ptr<RFABase> > casa::Flagger::acc [protected] |
Record casa::Flagger::agent_defaults [protected] |
Definition at line 145 of file Flagger.h.
Referenced by defaultAgents().
Int casa::Flagger::agentCount_p [private] |
Record* casa::Flagger::agents_p [private] |
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;.
Vector<Int> casa::Flagger::datadescids_p [protected] |
Vector<Int> casa::Flagger::datafieldids_p [protected] |
String casa::Flagger::dataMode_p [protected] |
const bool casa::Flagger::dbg [static, private] |
Vector<Int> casa::Flagger::ifr2ant1 [protected] |
Vector<Int> casa::Flagger::ifr2ant2 [protected] |
LogSink casa::Flagger::logSink_p [private] |
MRadialVelocity casa::Flagger::mDataStart_p [protected] |
MRadialVelocity casa::Flagger::mDataStep_p [protected] |
MeasurementSet casa::Flagger::ms [protected] |
String casa::Flagger::msname_p [protected] |
MeasurementSet* casa::Flagger::mssel_p [protected] |
MSSelection* casa::Flagger::msselection_p [private] |
uInt casa::Flagger::nant [protected] |
uInt casa::Flagger::nfeed [protected] |
uInt casa::Flagger::nfeedcorr [protected] |
Definition at line 140 of file Flagger.h.
Referenced by numFeedCorr().
uInt casa::Flagger::nifr [protected] |
Bool casa::Flagger::nullSelect_p [protected] |
Record* casa::Flagger::opts_p [private] |
MeasurementSet casa::Flagger::originalms [protected] |
MeasurementSet* casa::Flagger::originalms_p [private] |
LogIO casa::Flagger::os [static, protected] |
Bool casa::Flagger::quack_agent_exists [private] |
bool casa::Flagger::scan_looping [protected] |
Bool casa::Flagger::selectdata_p [protected] |
Bool casa::Flagger::setdata_p [protected] |
bool casa::Flagger::spw_selection [private] |
Vector<Double> casa::Flagger::spwfreqs [protected] |
VisSet* casa::Flagger::vs_p [protected] |
1.6.1