Line data Source code
1 : //# RFAUVBinner.h: this defines RFAUVBinner 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: casa-feedback@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_RFAUVBINNER_H 28 : #define FLAGGING_RFAUVBINNER_H 29 : 30 : #include <flagging/Flagging/RFAFlagCubeBase.h> 31 : #include <flagging/Flagging/RFDataMapper.h> 32 : #include <flagging/Flagging/RFFloatLattice.h> 33 : #include <flagging/Flagging/RFFlagCube.h> 34 : #include <flagging/Flagging/RFRowClipper.h> 35 : #include <casacore/scimath/Mathematics/RigidVector.h> 36 : 37 : namespace casa { //# NAMESPACE CASA - BEGIN 38 : 39 : // <summary> 40 : // RFAUVBinner: flagging via UV binning 41 : // </summary> 42 : 43 : // <use visibility=local> 44 : 45 : // <reviewed reviewer="" date="" tests="" demos=""> 46 : // </reviewed> 47 : 48 : // <prerequisite> 49 : // <li> RFDataMapper 50 : // <li> RFFlagCubeBase 51 : // <li> RFCubeLattice 52 : // </prerequisite> 53 : // 54 : // <synopsis> 55 : // </synopsis> 56 : // 57 : // <todo asof="2001/04/16"> 58 : // <li> make UV-distance matrix static, to share between multiple instances 59 : // <li> collect population statistics across all channels 60 : // <li> 3D bins (ampl-UVdist-channel)? 61 : // <li> think how to solve "encroaching" problem to achieve a better 62 : // probability distribution. Perhaps two sets of staggered bins, 63 : // and for each point use the count of the bigger bin? 64 : // </todo> 65 : 66 : class RFAUVBinner : public RFAFlagCubeBase, public RFDataMapper 67 : { 68 : public: 69 : RFAUVBinner ( RFChunkStats &ch,const casacore::RecordInterface &parm ); 70 0 : virtual ~RFAUVBinner () {}; 71 : 72 : virtual casacore::uInt estimateMemoryUse (); 73 : virtual casacore::Bool newChunk (casacore::Int &maxmem); 74 : virtual void endChunk (); 75 : virtual void startData (bool verbose); 76 : virtual void startDry (bool verbose); 77 : virtual IterMode iterTime (casacore::uInt it); 78 : virtual IterMode iterRow (casacore::uInt ir); 79 : virtual IterMode iterDry (casacore::uInt it); 80 : virtual IterMode endData (); 81 : virtual IterMode endDry (); 82 : 83 : virtual casacore::String getDesc (); 84 : static const casacore::RecordInterface & getDefaults (); 85 : 86 : protected: 87 : casacore::IPosition computeBin( casacore::Float uv,casacore::Float y,casacore::uInt ich ); 88 : 89 : casacore::Double threshold; 90 : casacore::uInt min_population; 91 : casacore::uInt nbin_y,nbin_uv; 92 : casacore::Bool binned; 93 : 94 : // current UVW column 95 : casacore::Vector< casacore::RigidVector<casacore::Double,3> > *puvw; 96 : 97 : // lattice of yvalues [NCH,NIFR,NTIME] 98 : RFFloatLattice yvalue; 99 : // matrix of UV distances [NIFR,NTIME] 100 : casacore::Matrix<casacore::Float> uvdist; 101 : 102 : // ranges and bin sizes 103 : casacore::Vector<casacore::Float> ymin,ymax,ybinsize, 104 : // for UV, we have individual ranges/bins per each channel 105 : uvmin,uvmax,uvbinsize; 106 : // bin counts 107 : casacore::Cube<casacore::Int> bincounts; 108 : casacore::Vector<casacore::Int> totcounts; 109 : }; 110 : 111 : 112 : } //# NAMESPACE CASA - END 113 : 114 : #endif