casa
$Rev:20696$
|
00001 //# MSSelUtil.h: this defines MSSelUtil, a helper class for MSSelector 00002 //# Copyright (C) 1998,1999,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 //# 00027 //# $Id: MSSelUtil.h 20838 2009-12-01 10:10:55Z gervandiepen $ 00028 00029 #ifndef MS_MSSELUTIL_H 00030 #define MS_MSSELUTIL_H 00031 00032 #include <casa/aips.h> 00033 #include <casa/Arrays/Matrix.h> 00034 #include <casa/BasicSL/Complex.h> 00035 00036 namespace casa { //# NAMESPACE CASA - BEGIN 00037 00038 // <summary> 00039 // Helper class for MSFlagger with templated static function 00040 // </summary> 00041 // <use visibility=local> 00042 // <synopsis> 00043 // Helper class for MSFlagger/DOms with templated static function to difference 00044 // data in one of two directions. 00045 // </synopsis> 00046 00047 template <class T> class MSSelUtil 00048 { 00049 public: 00050 // Compute the absolute difference of the data, subtracting 00051 // either the previous value (window==2) or the average over 00052 // the window (window>2). If doMedian==True is specified, the 00053 // median difference over the window is returned for window>2. 00054 // Takes flagging into account. 00055 // diffAxis==2,3: row or time, diffAxis==1: channel 00056 // Handles 3d and 4d data arrays. 00057 static Array<Float> diffData(const Array<T>& data, 00058 const Array<Bool>& flag, 00059 const Array<Bool>& flagRow, 00060 Int diffAxis, 00061 Int window, 00062 Bool doMedian=False); 00063 }; 00064 00065 } //# NAMESPACE CASA - END 00066 00067 #ifndef CASACORE_NO_AUTO_TEMPLATES 00068 #include <ms/MeasurementSets/MSSelUtil.tcc> 00069 #endif //# CASACORE_NO_AUTO_TEMPLATES 00070 #endif