casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFASelector.h
Go to the documentation of this file.
1 
2 //# RFASelector.h: this defines RFASelector
3 //# Copyright (C) 2000,2001
4 //# Associated Universities, Inc. Washington DC, USA.
5 //#
6 //# This library is free software; you can redistribute it and/or modify it
7 //# under the terms of the GNU Library General Public License as published by
8 //# the Free Software Foundation; either version 2 of the License, or (at your
9 //# option) any later version.
10 //#
11 //# This library is distributed in the hope that it will be useful, but WITHOUT
12 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 //# License for more details.
15 //#
16 //# You should have received a copy of the GNU Library General Public License
17 //# along with this library; if not, write to the Free Software Foundation,
18 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19 //#
20 //# Correspondence concerning AIPS++ should be addressed as follows:
21 //# Internet email: aips2-request@nrao.edu.
22 //# Postal address: AIPS++ Project Office
23 //# National Radio Astronomy Observatory
24 //# 520 Edgemont Road
25 //# Charlottesville, VA 22903-2475 USA
26 //#
27 //# $Id$
28 #ifndef FLAGGING_RFASELECTOR_H
29 #define FLAGGING_RFASELECTOR_H
30 
34 #include <casa/Arrays/LogiVector.h>
35 
36 namespace casa { //# NAMESPACE CASA - BEGIN
37 
38 // <summary>
39 // RFASelector: flags pixels/rows based on a specified selection
40 // </summary>
41 
42 // <use visibility=local>
43 
44 // <reviewed reviewer="" date="" tests="" demos="">
45 // </reviewed>
46 
47 // <prerequisite>
48 // <li> RFAFlagCubebase
49 // </prerequisite>
50 //
51 // <etymology>
52 // RedFlaggerAgent Selector
53 // </etymology>
54 //
55 // <synopsis>
56 // RFASelector accepts a whole bunch of options to select a subset of the
57 // casacore::MS (by time, antenna, baseline, channel/frequency, etc.), and to flag/unflag
58 // the whole selection, or specific parts of it (autocorrelations, specific
59 // time slots, VLA quacks, etc.)
60 // </synopsis>
61 //
62 // <todo asof="2001/04/16">
63 // <li> add this feature
64 // <li> fix this bug
65 // <li> start discussion of this possible extension
66 // </todo>
67 
69 {
70 public:
71 // constructor.
73  virtual ~RFASelector ();
74 
76  virtual casacore::Bool newChunk ( casacore::Int &maxmem );
77  virtual IterMode iterTime ( casacore::uInt it );
78  virtual void endRows(casacore::uInt itime);
79  virtual IterMode iterRow ( casacore::uInt ir );
80  virtual void iterFlag(casacore::uInt itime);
81  virtual void startData(bool verbose);
82 
83  virtual casacore::String getDesc ();
84  static const casacore::RecordInterface & getDefaults ();
85 
88 
89 protected:
90  typedef struct ClipInfo {
93  casacore::Bool channel_average; // average data over channels?
94  casacore::Bool clip; // flag outside range if true (otherwise flag inside)
95  casacore::Float offset; // offset added to value (used for angles, etc.)
96  } ClipInfo;
97 
98 
99  template<class T> casacore::Bool reformRange( casacore::Matrix<T> &rng,const casacore::Array<T> &arr );
100  template<class T> casacore::Bool parseRange( casacore::Matrix<T> &rng,const casacore::RecordInterface &parm,const casacore::String &id );
101  template<class T> casacore::Bool find( casacore::uInt &index,const T &obj,const casacore::Vector<T> &arr );
102 
104  void addString ( casacore::String &str,const casacore::String &s1,const char *sep=" " );
105  virtual void processRow ( casacore::uInt ifr,casacore::uInt it );
108  void parseClipField ( const casacore::RecordInterface &spec,casacore::Bool clip );
109  void addClipInfoDesc ( const casacore::Block<ClipInfo> &clip );
110 
111  // shadow mode
112  casacore::Double diameter; /* diameter to use. If negative use
113  the diameters array (true antenna diameters)
114  */
117 
118  // elevation
119  double lowerlimit;
120  double upperlimit;
121 
122 // description of agent
124 // selection arguments
129  casacore::LogicalVector sel_ifr,flagchan,sel_feed;
132  casacore::LogicalVector sel_clip_active;
139 
141 
142 };
143 
144 
145 
146 
147 } //# NAMESPACE CASA - END
148 
149 #ifndef AIPS_NO_TEMPLATE_SRC
150 #include <flagging/Flagging/RFASelector.tcc>
151 #endif //# AIPS_NO_TEMPLATE_SRC
152 #endif
casacore::LogicalVector sel_feed
Definition: RFASelector.h:129
Abstract RedFlagger Agent class with a flag cube.
A 1-D Specialization of the Array class.
casacore::Bool sel_autocorr
Definition: RFASelector.h:130
int Int
Definition: aipstype.h:50
casacore::Bool unflag
Definition: RFASelector.h:130
casacore::Vector< casacore::Int > sel_observation
Definition: RFASelector.h:137
virtual casacore::Bool newChunk(casacore::Int &maxmem)
Called before iterating over a chunk.
casacore::Float offset
Definition: RFASelector.h:95
casacore::Bool parseMinMax(casacore::Float &vmin, casacore::Float &vmax, const casacore::RecordInterface &spec, casacore::uInt f0)
casacore::Matrix< casacore::Int > sel_chan
Definition: RFASelector.h:126
casacore::Matrix< casacore::Double > sel_time
Definition: RFASelector.h:125
casacore::Bool quack_increment
Definition: RFASelector.h:136
casacore::LogicalVector flagchan
Definition: RFASelector.h:129
virtual void processRow(casacore::uInt ifr, casacore::uInt it)
casacore::String sel_column
Definition: RFASelector.h:138
virtual IterMode iterRow(casacore::uInt ir)
iterRow() is called once per each row in the VisBuffer.
casacore::Bool parseRange(casacore::Matrix< T > &rng, const casacore::RecordInterface &parm, const casacore::String &id)
casacore::Bool find(casacore::uInt &index, const T &obj, const casacore::Vector< T > &arr)
casacore::Vector< casacore::Double > diameters
Definition: RFASelector.h:115
casacore::Double quack_si
Definition: RFASelector.h:134
A 2-D Specialization of the Array class.
casacore::Vector< casacore::Int > sel_scannumber
Definition: RFASelector.h:137
casacore::Bool sum_sel_clip_active
Definition: RFASelector.h:133
casacore::Bool parseTimes(casacore::Array< casacore::Double > &times, const casacore::RecordInterface &parm, const casacore::String &id, casacore::Bool secs=false)
double lowerlimit
elevation
Definition: RFASelector.h:119
void parseClipField(const casacore::RecordInterface &spec, casacore::Bool clip)
casacore::Double diameter
shadow mode
Definition: RFASelector.h:112
struct casa::RFASelector::ClipInfo ClipInfo
casacore::Block< ClipInfo > sel_clip_row
Definition: RFASelector.h:131
IterMode
iteration modes
Definition: RFABase.h:63
casacore::Matrix< casacore::Double > sel_freq
selection arguments
Definition: RFASelector.h:125
virtual casacore::uInt estimateMemoryUse()
This method is called before iterating over a chunk, to inquire the expected memory use...
virtual void endRows(casacore::uInt itime)
Called at end of time chunk.
casacore::ROMSAntennaColumns * ac
Definition: RFASelector.h:116
virtual casacore::uInt estimateMemoryUse()
This method is called before iterating over a chunk, to inquire the expected memory use...
Definition: RFASelector.h:75
virtual void iterFlag(casacore::uInt itime)
Iteration method for a flag pass.
virtual casacore::String getDesc()
called to obtain a short description of this RFA
virtual IterMode iterTime(casacore::uInt it)
Iteration methods for a data pass.
casacore::Bool shadow
Definition: RFASelector.h:140
void addString(casacore::String &str, const casacore::String &s1, const char *sep=" ")
casacore::Vector< casacore::Int > sel_stateid
Definition: RFASelector.h:127
RFASelector: flags pixels/rows based on a specified selection.
Definition: RFASelector.h:68
casacore::String desc_str
description of agent
Definition: RFASelector.h:123
RFASelector(RFChunkStats &ch, const casacore::RecordInterface &parm)
constructor.
double Double
Definition: aipstype.h:55
casacore::LogicalVector sel_ifr
Definition: RFASelector.h:129
casacore::LogicalVector sel_clip_active
Definition: RFASelector.h:132
casacore::Vector< casacore::Int > sel_arrayid
Definition: RFASelector.h:137
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Matrix< casacore::Double > sel_timerng
Definition: RFASelector.h:125
float Float
Definition: aipstype.h:54
casacore::Vector< casacore::String > sel_fieldnames
Definition: RFASelector.h:128
virtual void startData(bool verbose)
Called before starting a data pass on a chunk.
casacore::Bool reformRange(casacore::Matrix< T > &rng, const casacore::Array< T > &arr)
template &lt;class T, class U&gt; class vector;
Definition: MSFlagger.h:37
casacore::Bool channel_average
Definition: RFASelector.h:93
casacore::Block< ClipInfo > sel_clip
Definition: RFASelector.h:131
casacore::Vector< casacore::Int > sel_fieldid
Definition: RFASelector.h:127
casacore::Matrix< casacore::Double > sel_uvrange
Definition: RFASelector.h:125
simple 1-D array
static const casacore::RecordInterface & getDefaults()
casacore::Vector< casacore::Int > sel_spwid
Definition: RFASelector.h:127
A class to provide easy read-only access to MSAntenna columns.
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
void fortestingonly_parseClipField(const casacore::RecordInterface &spec, casacore::Bool clip)
Abstract base class for Record classes.
virtual ~RFASelector()
casacore::Bool fortestingonly_parseMinMax(casacore::Float &vmin, casacore::Float &vmax, const casacore::RecordInterface &spec, casacore::uInt f0)
casacore::Bool select_fullrow
Definition: RFASelector.h:140
casacore::String quack_mode
Definition: RFASelector.h:135
casacore::Bool flag_everything
Definition: RFASelector.h:140
casacore::Vector< casacore::Int > sel_corr
Definition: RFASelector.h:127
void addClipInfo(const casacore::Vector< casacore::String > &expr, casacore::Float vmin, casacore::Float vmax, casacore::Bool clip, casacore::Bool channel_average)
casacore::Double quack_dt
Definition: RFASelector.h:134
casacore::Bool elevation
Definition: RFASelector.h:140
unsigned int uInt
Definition: aipstype.h:51
void addClipInfoDesc(const casacore::Block< ClipInfo > &clip)
RFDataMapper: maps complex visibilities to a single real value.
Definition: RFDataMapper.h:73