Line data Source code
1 : //# RFAMedianClip.h: this defines RFATimeMedian and RFAFreqMedian 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_RFAMEDIANCLIP_H 28 : #define FLAGGING_RFAMEDIANCLIP_H 29 : 30 : #include <flagging/Flagging/RFADiffBase.h> 31 : #include <casacore/scimath/Mathematics/MedianSlider.h> 32 : 33 : namespace casa { //# NAMESPACE CASA - BEGIN 34 : 35 : // <summary> 36 : // RFATimeMedian: RedFlagger Agent for clipping relative to median over time 37 : // </summary> 38 : 39 : // <use visibility=local> 40 : 41 : // <reviewed reviewer="" date="" tests="" demos=""> 42 : // </reviewed> 43 : 44 : // <prerequisite> 45 : // <li> MedianSlider 46 : // <li> RFADiffMapBase 47 : // </prerequisite> 48 : // 49 : // <synopsis> 50 : // RFATimeMedian computes a sliding median of some quantity (as established 51 : // in RFADiffMapbase) over time, per each channel. Deviation w/respect to 52 : // the median is passed to RFADiffBase for the actual flagging. 53 : // </synopsis> 54 : // 55 : // <todo asof="2001/04/16"> 56 : // <li> add this feature 57 : // <li> fix this bug 58 : // <li> start discussion of this possible extension 59 : // </todo> 60 : 61 : class RFATimeMedian : public RFADiffMapBase 62 : { 63 : public: 64 : RFATimeMedian ( RFChunkStats &ch,const casacore::RecordInterface &parm ); 65 : virtual ~RFATimeMedian (); 66 : 67 : virtual casacore::Bool newChunk (casacore::Int &maxmem); 68 : virtual void endChunk (); 69 : virtual void startData (bool verbose); 70 : virtual IterMode iterTime (casacore::uInt itime); 71 : virtual IterMode iterRow (casacore::uInt irow); 72 : virtual IterMode endData (); 73 : virtual casacore::String getDesc (); 74 : static const casacore::RecordInterface & getDefaults (); 75 : 76 : protected: 77 : casacore::uInt itime; 78 : casacore::MedianSlider & slider (casacore::uInt ich,casacore::uInt ifr); 79 : 80 : FlagCubeIterator flag_iter; 81 : 82 : casacore::uInt halfwin; 83 : casacore::MedianSlider *msl; 84 : 85 : }; 86 : 87 0 : inline casacore::MedianSlider & RFATimeMedian::slider (casacore::uInt ich,casacore::uInt ifr) 88 : { 89 0 : return msl[ ifr*num(CHAN) + ich ]; 90 : } 91 : 92 : 93 : // <summary> 94 : // RFAFreqMedian: RedFlagger Agent for clipping relative to median over frequency 95 : // </summary> 96 : 97 : // <use visibility=local> 98 : 99 : // <reviewed reviewer="" date="" tests="" demos=""> 100 : // </reviewed> 101 : 102 : // <prerequisite> 103 : // <li> MedianSlider 104 : // <li> RFADiffMapBase 105 : // </prerequisite> 106 : // 107 : // <synopsis> 108 : // RFAFreqMedian computes a sliding median of some quantity (as established 109 : // in RFADiffMapbase) over frequency, per each row. Deviation w/respect to 110 : // the median is passed to RFADiffBase for the actual flagging. 111 : // </synopsis> 112 : // 113 : // <todo asof="2001/04/16"> 114 : // <li> add this feature 115 : // <li> fix this bug 116 : // <li> start discussion of this possible extension 117 : // </todo> 118 : 119 : class RFAFreqMedian : public RFADiffMapBase 120 : { 121 : public: 122 : RFAFreqMedian ( RFChunkStats &ch,const casacore::RecordInterface &parm ); 123 0 : virtual ~RFAFreqMedian () {}; 124 : 125 : virtual casacore::Bool newChunk (casacore::Int &maxmem); 126 : virtual RFA::IterMode iterRow (casacore::uInt irow); 127 : virtual casacore::String getDesc (); 128 : static const casacore::RecordInterface & getDefaults (); 129 : 130 : protected: 131 : casacore::uInt halfwin; 132 : 133 : }; 134 : 135 : 136 : } //# NAMESPACE CASA - END 137 : 138 : #endif