casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
RFAUVBinner.h
Go to the documentation of this file.
00001 //# RFAUVBinner.h: this defines RFAUVBinner
00002 //# Copyright (C) 2000,2001
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id$
00027 #ifndef FLAGGING_RFAUVBINNER_H
00028 #define FLAGGING_RFAUVBINNER_H
00029 
00030 #include <flagging/Flagging/RFAFlagCubeBase.h> 
00031 #include <flagging/Flagging/RFDataMapper.h> 
00032 #include <flagging/Flagging/RFFloatLattice.h>
00033 #include <flagging/Flagging/RFFlagCube.h> 
00034 #include <flagging/Flagging/RFRowClipper.h> 
00035 #include <scimath/Mathematics/RigidVector.h>
00036     
00037 namespace casa { //# NAMESPACE CASA - BEGIN
00038 
00039 // <summary>
00040 // RFAUVBinner: flagging via UV binning
00041 // </summary>
00042 
00043 // <use visibility=local>
00044 
00045 // <reviewed reviewer="" date="" tests="" demos="">
00046 // </reviewed>
00047 
00048 // <prerequisite>
00049 //   <li> RFDataMapper
00050 //   <li> RFFlagCubeBase
00051 //   <li> RFCubeLattice
00052 // </prerequisite>
00053 //
00054 // <synopsis>
00055 // </synopsis>
00056 //
00057 // <todo asof="2001/04/16">
00058 //   <li> make UV-distance matrix static, to share between multiple instances
00059 //   <li> collect population statistics across all channels
00060 //   <li> 3D bins (ampl-UVdist-channel)?
00061 //   <li> think how to solve "encroaching" problem to achieve a better
00062 //        probability distribution. Perhaps two sets of staggered bins,
00063 //        and for each point use the count of the bigger bin?
00064 // </todo>
00065 
00066 class RFAUVBinner : public RFAFlagCubeBase, public RFDataMapper
00067 {
00068 public:
00069   RFAUVBinner  ( RFChunkStats &ch,const RecordInterface &parm ); 
00070   virtual ~RFAUVBinner () {};
00071   
00072   virtual uInt estimateMemoryUse ();
00073   virtual Bool newChunk (Int &maxmem);
00074   virtual void endChunk ();
00075   virtual void startData (bool verbose);
00076   virtual void startDry (bool verbose);
00077   virtual IterMode iterTime (uInt it);
00078   virtual IterMode iterRow  (uInt ir);
00079   virtual IterMode iterDry  (uInt it);
00080   virtual IterMode endData  ();
00081   virtual IterMode endDry  ();
00082 
00083   virtual String getDesc ();
00084   static const RecordInterface & getDefaults ();
00085   
00086 protected:
00087   IPosition computeBin( Float uv,Float y,uInt ich );
00088 
00089   Double  threshold;
00090   uInt    min_population;
00091   uInt    nbin_y,nbin_uv;
00092   Bool    binned;
00093   
00094 // current UVW column
00095   Vector< RigidVector<Double,3> > *puvw;
00096 
00097 // lattice of yvalues [NCH,NIFR,NTIME]
00098   RFFloatLattice yvalue;
00099 // matrix of UV distances [NIFR,NTIME]
00100   Matrix<Float> uvdist;
00101 
00102 // ranges and bin sizes
00103   Vector<Float> ymin,ymax,ybinsize,
00104 // for UV, we have individual ranges/bins per each channel
00105                uvmin,uvmax,uvbinsize;
00106 // bin counts
00107   Cube<Int> bincounts;
00108   Vector<Int> totcounts;
00109 };
00110 
00111 
00112 } //# NAMESPACE CASA - END
00113 
00114 #endif