casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MSSelUtil2.h
Go to the documentation of this file.
00001 #ifndef MS_MSSELUTIL2_H
00002 #define MS_MSSELUTIL2_H
00003 
00004 #include <casa/aips.h>
00005 #include <casa/Arrays/Matrix.h>
00006 #include <casa/BasicSL/Complex.h>
00007 
00008 namespace casa { //# NAMESPACE CASA - BEGIN
00009 template <class T> class MSSelUtil2
00010 {
00011   public:
00012   // reorder data from 3d (corr,chan,row) to 4d (corr,chan,ifr,time)
00013   static void reorderData(Array<T>& data,
00014                           const Vector<Int>& ifrSlot,
00015                           Int nIfr, 
00016                           const Vector<Int>& timeSlot, 
00017                           Int nTime,
00018                           const T& defvalue);
00019 
00020   // reorder data from 4d (corr,chan,ifr,time) to 3d (corr,chan,row) 
00021   static void reorderData(Array<T>& data, 
00022                           const Matrix<Int>& rowIndex,
00023                           Int nRow);
00024 
00025   // average data (with flags & weights applied) over it's last axis (time or
00026   // row), return in data (overwritten), dataFlag gives new flags.
00027   static void timeAverage(Array<Bool>& dataFlag, Array<T>& data, 
00028                           const Array<Bool>& flag, const Array<Float>& weight);
00029 
00030 };
00031 } //# NAMESPACE CASA - END
00032 
00033 #ifndef CASACORE_NO_AUTO_TEMPLATES
00034 #include <ms/MeasurementSets/MSSelUtil2.tcc>
00035 #endif //# CASACORE_NO_AUTO_TEMPLATES
00036 #endif