casacore
Loading...
Searching...
No Matches
MSSelUtil.h
Go to the documentation of this file.
1// # MSSelUtil.h: this defines MSSelUtil, a helper class for MSSelector
2// # Copyright (C) 1998,1999,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#ifndef MS_MSSELUTIL_H
27#define MS_MSSELUTIL_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/casa/Arrays/Matrix.h>
31#include <casacore/casa/BasicSL/Complex.h>
32
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
35// <summary>
36// Helper class for MSFlagger with templated static function
37// </summary>
38// <use visibility=local>
39// <synopsis>
40// Helper class for MSFlagger/DOms with templated static function to difference
41// data in one of two directions.
42// </synopsis>
43
44template <class T>
45class MSSelUtil {
46 public:
47 // Compute the absolute difference of the data, subtracting
48 // either the previous value (window==2) or the average over
49 // the window (window>2). If doMedian==True is specified, the
50 // median difference over the window is returned for window>2.
51 // Takes flagging into account.
52 // diffAxis==2,3: row or time, diffAxis==1: channel
53 // Handles 3d and 4d data arrays.
54 static Array<Float> diffData(const Array<T>& data, const Array<Bool>& flag,
55 const Array<Bool>& flagRow, Int diffAxis, Int window,
56 Bool doMedian = False);
57};
58
59} // namespace casacore
60
61#ifndef CASACORE_NO_AUTO_TEMPLATES
62#include <casacore/ms/MSSel/MSSelUtil.tcc>
63#endif // # CASACORE_NO_AUTO_TEMPLATES
64#endif
static Array< Float > diffData(const Array< T > &data, const Array< Bool > &flag, const Array< Bool > &flagRow, Int diffAxis, Int window, Bool doMedian=False)
Compute the absolute difference of the data, subtracting either the previous value (window==2) or the...
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40