casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFAFlagExaminer.h
Go to the documentation of this file.
1 //# RFAFlagExaminer.h: this defines RFAFlagExaminer
2 //# Copyright (C) 2000,2001
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 #ifndef FLAGGING_RFAFLAGEXAMINER_H
28 #define FLAGGING_RFAFLAGEXAMINER_H
29 
33 #include <casa/Arrays/LogiVector.h>
34 
35 namespace casa { //# NAMESPACE CASA - BEGIN
36 
37 // <summary>
38 // RFAFlagExaminer: Examine the flags and get statistics. perform extensions too.
39 // </summary>
40 
41 // <use visibility=local>
42 
43 // <reviewed reviewer="" date="" tests="" demos="">
44 // </reviewed>
45 
46 // <prerequisite>
47 // <li> RFASelector
48 // </prerequisite>
49 //
50 // <etymology>
51 // RedFlaggerAgent Selector
52 // </etymology>
53 //
54 // <synopsis>
55 // RFAFlagExaminer accepts a whole bunch of options to select a subset of the
56 // casacore::MS (by time, antenna, baseline, channel/frequency, etc.), and to flag/unflag
57 // the whole selection, or specific parts of it (autocorrelations, specific
58 // time slots, VLA quacks, etc.)
59 // </synopsis>
60 //
61 // <todo asof="2001/04/16">
62 // <li> add this feature
63 // <li> fix this bug
64 // <li> start discussion of this possible extension
65 // </todo>
66 
68 {
69 public:
70 // constructor.
72  virtual ~RFAFlagExaminer ();
73 
74  virtual void iterFlag( casacore::uInt it );
75  virtual IterMode iterRow( casacore::uInt irow );
76  virtual casacore::Bool newChunk(casacore::Int &maxmem);
77  virtual void endChunk();
78 
79 
80  virtual void startData(bool verbose){RFAFlagCubeBase::startData(verbose);return;};
81  virtual void startFlag(bool verbose);
82  virtual void endFlag();
83  virtual void finalize();
84  virtual void initialize();
85  virtual void initializeIter(casacore::uInt it);
86  virtual void finalizeIter(casacore::uInt it);
87  virtual casacore::String getID() {return casacore::String("FlagExaminer");};
88 
89  virtual casacore::Record getResult();
90 
91 // virtual casacore::String getDesc ();
92 // static const casacore::RecordInterface & getDefaults ();
93 
94 private:
95  void processRow ( casacore::uInt ifr,casacore::uInt it ) ;
98 
99  // accumulated over all chunks
101  accumTotalFlags, accumTotalCount, /* accumRowFlags, */
103 
104  // per chunk
107 
108  // Statistics per antenna, baseline, spw, etc.
109  // These maps of maps is used e.g. like:
110  //
111  // accumflags["baseline"]["2&&7"] == 42
112  // accumflags["spw" ]["0" ] == 17
113  //
114  // which means that there were 42 flags on baseline 2 - 7, etc.
115  std::map<std::string, std::map<std::string, casacore::uInt64> > accumflags;
116  std::map<std::string, std::map<std::string, casacore::uInt64> > accumtotal;
117 
118  std::vector<casacore::uInt64> accumflags_channel;
119  std::vector<casacore::uInt64> accumtotal_channel;
120  std::vector<casacore::uInt64> accumflags_correlation;
121  std::vector<casacore::uInt64> accumtotal_correlation;
122 
123 };
124 
125 } //# NAMESPACE CASA - END
126 
127 #ifndef AIPS_NO_TEMPLATE_SRC
128 #include <flagging/Flagging/RFAFlagExaminer.tcc>
129 #endif //# AIPS_NO_TEMPLATE_SRC
130 #endif
casacore::uInt64 inTotalCount
std::vector< casacore::uInt64 > accumtotal_correlation
casacore::uInt64 totalrowcount
int Int
Definition: aipstype.h:50
RFAFlagExaminer(RFChunkStats &ch, const casacore::RecordInterface &parm)
constructor.
casacore::uInt64 totalflags
virtual void initializeIter(casacore::uInt it)
std::vector< casacore::uInt64 > accumflags_channel
virtual void endChunk()
Called once finished with a chunk.
casacore::uInt64 inTotalRowCount
virtual IterMode iterRow(casacore::uInt irow)
iterRow() is called once per each row in the VisBuffer.
unsigned long long uInt64
Definition: aipsxtype.h:39
virtual void endFlag()
Called after a flag pass is complete.
casacore::uInt64 totalcount
casacore::uInt64 totalrowflags
virtual casacore::Bool newChunk(casacore::Int &maxmem)
Called before iterating over a chunk.
virtual void finalizeIter(casacore::uInt it)
IterMode
iteration modes
Definition: RFABase.h:63
std::vector< casacore::uInt64 > accumflags_correlation
casacore::uInt64 accumTotalFlags
accumulated over all chunks
casacore::uInt64 accumTotalRowFlags
std::map< std::string, std::map< std::string, casacore::uInt64 > > accumtotal
casacore::uInt64 outTotalRowCount
RFASelector: flags pixels/rows based on a specified selection.
Definition: RFASelector.h:68
virtual void startData(bool verbose)
Called before starting a data pass on a chunk.
casacore::uInt64 outTotalFlags
virtual ~RFAFlagExaminer()
RFAFlagExaminer: Examine the flags and get statistics. perform extensions too.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
void processRow(casacore::uInt ifr, casacore::uInt it)
virtual casacore::String getDesc (); static const casacore::RecordInterface &amp; getDefaults (); ...
casacore::uInt64 inTotalRowFlags
std::vector< casacore::uInt64 > accumtotal_channel
virtual casacore::Record getResult()
casacore::uInt64 outTotalRowFlags
casacore::uInt64 inTotalFlags
per chunk
std::map< std::string, std::map< std::string, casacore::uInt64 > > accumflags
Statistics per antenna, baseline, spw, etc.
casacore::uInt64 accumTotalCount
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual void iterFlag(casacore::uInt it)
Iteration method for a flag pass.
RFChunkStats: vital information and flagging stats for a visibility chunk.
Definition: RFChunkStats.h:89
casacore::uInt64 accumTotalRowCount
Abstract base class for Record classes.
virtual void initialize()
Initialize chunk.
virtual void finalize()
casacore::uInt64 outTotalCount
virtual casacore::String getID()
unsigned int uInt
Definition: aipstype.h:51
virtual void startData(bool verbose)
Called before starting a data pass on a chunk.
virtual void startFlag(bool verbose)
Called before starting the fetch-flags pass.