casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFATimeFreqCrop.h
Go to the documentation of this file.
1 //# RFATimeFreqCrop.h : This defines RFATimeFreqCrop
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 
28 #ifndef FLAGGING_RFATIMEFREQCROP_H
29 #define FLAGGING_RFATIMEFREQCROP_H
30 
36 #include <casa/Arrays/Vector.h>
38 #include <scimath/Fitting.h>
43 #include <msvis/MSVis/VisBuffer.h>
44 
45 namespace casa { //# NAMESPACE CASA - BEGIN
46 
47 
48 // <summary>
49 // RFATimeFreqCrop : 2-Dimensional casacore::Time Frequency Autoflag agent
50 // </summary>
51 
52 // <use visibility=local>
53 
54 // <reviewed reviewer="" date="" tests="" demos="">
55 // </reviewed>
56 
57 // <prerequisite>
58 // <li> RFDataMapper
59 // <li> RFFlagCubeBase
60 // <li> RFCubeLattice
61 // </prerequisite>
62 //
63 // <synopsis>
64 // </synopsis>
65 //
66 // <todo asof="2002/08/06">
67 // <li>
68 // <li>
69 // <li>
70 // // </todo>
71 
72 
73 
74 //class RFATimeFreqCrop : public RFADiffMapBase
76 {
77 public:
79  virtual ~RFATimeFreqCrop ();
80 
82  virtual void endChunk ();
83  virtual void startData (bool verbose);
84  virtual IterMode iterTime (casacore::uInt itime);
85  virtual IterMode iterRow (casacore::uInt irow);
86  virtual IterMode endData ();
87  virtual void startFlag (bool verbose);
88  virtual void iterFlag(casacore::uInt itime);
89  static const casacore::RecordInterface & getDefaults ();
90 
91 private:
92 
101 
104 
105  void AllocateMemory();
106  void FlagZeros();
107  void RunTFCrop();
113  void ExtendFlags();
114  void FillChunkFlags();
115 
116  // casacore::uInt itime;
119  // casacore::uInt TimeStamps;
122 
123  // casacore::Cube <casacore::Complex> *vv; // visCube ptr - for one timestamp
124  casacore::Cube <casacore::Complex> vc; // visCube ptr - for one timestamp
125  casacore::Cube <casacore::Bool> ff; // flagCube ptr - for one timestamp
126  casacore::Vector <casacore::Bool> fr; // rowflag ptr - for one timestamp
129  casacore::Cube<casacore::Float> meanBP; // mean bandpass - npol x nbaselines x nchannels
130  casacore::Cube<casacore::Float> cleanBP; // cleaned bandpasses - npol x nbaselines x nchannels
131  casacore::Vector<casacore::Bool> rowflags; // rowflags from the casacore::MS - ntime x nbaselines
132  casacore::Vector<casacore::Bool> baselineflags; // flags for baselines - NumB (for internal use)
133 
134  casacore::Cube<casacore::Bool> chunkflags; // Flags for the entire chunk.
135 
136  casacore::Vector<casacore::Float> tempBP; // temporary workspace - nchannels
137  casacore::Vector<casacore::Float> tempTS; // temporary workspace - ntimes
138  casacore::Vector<casacore::Bool> flagBP; // temporary list of flags - nchannels
139  casacore::Vector<casacore::Bool> flagTS; // temporary list of flags - ntimes
140  casacore::Vector<casacore::Float> fitBP; // temporary fit array - nchannels
141  casacore::Vector<casacore::Float> fitTS; // temporary fit array - ntimes
142 
143  casacore::Float T_TOL,F_TOL,ANT_TOL,BASELN_TOL; // casacore::Input parameters
144  casacore::uInt FlagLevel,CorrChoice,NumTime,MaxNPieces;//casacore::Input parameters
146  // casacore::uInt nPol;
151 
153 
155 
156  // casacore::uInt passcnt;
157  // casacore::uInt iterRowcnt;
160 
161  casacore::uInt NumT; // Number of timestamps in one block
162  casacore::uInt NumB; // Number of baselines.
163  casacore::uInt NumAnt; // Number of antennas.
164  casacore::uInt NumC; // Number of channels
165  casacore::uInt NumP; // Number of polarizations
166 
167  FlagCubeIterator flag_iter; // Local Flag Iterator
168 };
169 
170 
171 
172 } //# NAMESPACE CASA - END
173 
174 #ifndef AIPS_NO_TEMPLATE_SRC
175 #include <flagging/Flagging/RFATimeFreqCrop.tcc>
176 #endif //# AIPS_NO_TEMPLATE_SRC
177 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
casacore::Bool StopAndExit
casacore::Vector< casacore::Bool > baselineflags
Abstract RedFlagger Agent class with a flag cube.
casacore::Cube< casacore::Float > meanBP
int Int
Definition: aipstype.h:50
casacore::Vector< casacore::Bool > rowflags
void FlagTimeSeries(casacore::uInt pl, casacore::uInt bs)
casacore::Cube< casacore::Float > visc
casacore::uInt BaselineIndex(casacore::uInt row, casacore::uInt a1, casacore::uInt a2)
void Ants(casacore::uInt bs, casacore::uInt *a1, casacore::uInt *a2)
casacore::Float T_TOL
virtual IterMode endData()
Called after a pass is completed successfully (i.e., not stopped by start or iter methods)...
casacore::Vector< casacore::Bool > fr
casacore::Cube< casacore::Bool > ff
casacore::Vector< casacore::Float > tempTS
virtual IterMode iterRow(casacore::uInt irow)
iterRow() is called once per each row in the VisBuffer.
void LineFit(casacore::Vector< casacore::Float > data, casacore::Vector< casacore::Bool > flag, casacore::Vector< casacore::Float > fit, casacore::uInt lim1, casacore::uInt lim2)
RFFlagCube flag
flag cube lattice
casacore::Float UStd(casacore::Vector< casacore::Float > vect, casacore::Vector< casacore::Bool > flag, casacore::Vector< casacore::Float > fit)
casacore::uInt iterTimecnt
casacore::uInt passcnt; casacore::uInt iterRowcnt;
casacore::String msname
casacore::uInt TimeStamps;
void PolyFit(casacore::Vector< casacore::Float > data, casacore::Vector< casacore::Bool > flag, casacore::Vector< casacore::Float > fit, casacore::uInt lim1, casacore::uInt lim2, casacore::uInt deg)
casacore::Vector< casacore::Int > ant1
virtual casacore::Bool newChunk(casacore::Int &i)
Called before iterating over a chunk.
casacore::uInt NumTime
virtual void endChunk()
Called once finished with a chunk.
casacore::Float ANT_TOL
casacore::Bool IgnorePreflags
casacore::IPosition cubepos
casacore::IPosition matpos
casacore::Bool FreqLineFit
casacore::uInt nPol;
IterMode
iteration modes
Definition: RFABase.h:63
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
Definition: PlotData.h:48
casacore::Vector< casacore::Int > ant2
casacore::uInt MaxNPieces
casacore::Cube< casacore::Bool > chunkflags
virtual ~RFATimeFreqCrop()
casacore::Vector< casacore::String > Expr
casacore::Cube< casacore::Bool > flagc
casacore::uInt FlagLevel
casacore::Vector< casacore::Bool > flagTS
casacore::Cube< casacore::Float > cleanBP
VisibilityIterator & vi
casacore::uInt itime;
casacore::Cube< casacore::Complex > vc
casacore::Cube &lt;casacore::Complex&gt; *vv; // visCube ptr - for one timestamp
casacore::String Column
RFATimeFreqCrop : 2-Dimensional casacore::Time Frequency Autoflag agent.
static const casacore::RecordInterface & getDefaults()
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Matrix< casacore::Bool > RowFlags
virtual IterMode iterTime(casacore::uInt itime)
Iteration methods for a data pass.
void Display_ds9(casacore::Int xdim, casacore::Int ydim, casacore::Matrix< casacore::Float > &data, casacore::Int frame)
float Float
Definition: aipstype.h:54
virtual void iterFlag(casacore::uInt itime)
Iteration method for a flag pass.
void FlagBandPass(casacore::uInt pl, casacore::uInt bs)
casacore::Vector< casacore::Bool > flagBP
casacore::Vector< casacore::Float > tempBP
void GrowFlags(casacore::uInt pl, casacore::uInt bs)
void FitCleanBandPass(casacore::uInt pl, casacore::uInt bs)
casacore::Vector< casacore::Float > fitBP
RFATimeFreqCrop(RFChunkStats &ch, const casacore::RecordInterface &parm)
FlagCubeIterator flag_iter
casacore::uInt CorrChoice
LatticeExprNode mean(const LatticeExprNode &expr)
virtual void startFlag(bool verbose)
Called before starting the fetch-flags pass.
void CleanBand(casacore::Vector< casacore::Float > data, casacore::Vector< casacore::Float > fit)
casacore::uInt timecnt
casacore::Bool ShowPlots
RFA::IterMode ShowFlagPlots()
virtual void startData(bool verbose)
Called before starting a data pass on a chunk.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
RFChunkStats: vital information and flagging stats for a visibility chunk.
Definition: RFChunkStats.h:89
VisBuffers encapsulate one chunk of visibility data for processing.
Definition: VisBuffer.h:153
VisibilityIterator iterates through one or more writable MeasurementSets.
casacore::Float UMean(casacore::Vector< casacore::Float > vect, casacore::Vector< casacore::Bool > flag)
casacore::Float BASELN_TOL
Abstract base class for Record classes.
casacore::Float F_TOL
void Plot_ds9(casacore::Int dim, casacore::Vector< casacore::Float > data1, casacore::Vector< casacore::Float > data2)
unsigned int uInt
Definition: aipstype.h:51
casacore::Vector< casacore::Float > fitTS
RFDataMapper: maps complex visibilities to a single real value.
Definition: RFDataMapper.h:73