casacore
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DFTServer.h
Go to the documentation of this file.
1 //# DFTServer.h: This class contains methods for doing n-D slow Fourier transforms
2 //# Copyright (C) 1994,1995,1996,1999,2000,2001,2003
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: aips2-request@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 
28 #ifndef SCIMATH_DFTSERVER_H
29 #define SCIMATH_DFTSERVER_H
30 
31 
32 #include <casacore/casa/aips.h>
40 #include <casacore/casa/math.h>
41 
42 namespace casacore { //# NAMESPACE CASACORE - BEGIN
43 
44 template<class T> class Matrix;
45 
46 // <summary>
47 // Error class for <linkto class=DFTServer>DFTServer</linkto> class
48 // </summary>
49 
50 // <synopsis>
51 // Error class for <linkto class=DFTServer>DFTServer</linkto> class.
52 // </synopsis>
53 
54 class DFTError: public AipsError
55 {
56 public:
57  DFTError(): AipsError("DFTError") {}
58  DFTError(const Char *m) : AipsError(m) {}
59  DFTError(const String &m) : AipsError(m) {}
60 
61  virtual ~DFTError() noexcept {}
62 };
63 
64 // <summary>
65 // Class containing methods for doing n-D slow Fourier transforms
66 // </summary>
67 
68 // <synopsis>
69 // The DFTServer class contains methods for doing n-dimensional
70 // Slow Fourier Transforms. (In practice, the maximum dimension is 3).
71 //
72 // </synopsis>
73 
74 template<class T>
75 class DFTServer
76 {
77 public:
78 // default constructor
79  DFTServer();
80 
81 // copy constructor
82  DFTServer(const DFTServer<T> &);
83 
84 // Other constructors
85 // <group>
87  DFTServer(int, int, int);
89 // </group>
90 
91 // destructor
92  ~DFTServer();
93 
94 // assignment
96 
97 // n-d real <src> <-> </src> complex dft
98  void rcdft(Array<T> &, Array<T> &);
99 
100 // n-d complex <src> <-> </src> real dft
101  void crdft(Array<T> &, Array<T> &);
102 
103 // n-d complex <src> <-> </src> complex dft
104  void cxdft(Array<T> &, Array<T> &, int);
105 
106 // display only the real component of the data
107  void showReal(Array<T> &);
108 
109 // display both the real and the imaginary components of the data
110  void showComplex(Array<T> &);
111 
112 private:
113  // dimension of the both input and output data
115 
116  // number of time data points
117  int numTime;
118 
119  // number of frequency data points
120  int numFreq;
121 
122  // set to 1 (true) if a crfft is done
123  int crFlag;
124 
125 
126 // does a complex to complex DFT
127  void c2c(Matrix<T> &, Matrix<T> &, int);
128 
129 // turn a general array into a matrix
131 
132 };
133 
134 
135 } //# NAMESPACE CASACORE - END
136 
137 #ifndef CASACORE_NO_AUTO_TEMPLATES
138 #include <casacore/scimath/Mathematics/DFTServer.tcc>
139 #endif //# CASACORE_NO_AUTO_TEMPLATES
140 #endif //DFT_SERVER
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:118
~DFTServer()
destructor
DFTError(const String &m)
Definition: DFTServer.h:59
int dimension
dimension of the both input and output data
Definition: DFTServer.h:114
char Char
Definition: aipstype.h:46
DFTError(const Char *m)
Definition: DFTServer.h:58
DFTServer< T > & operator=(const DFTServer< T > &)
assignment
Matrix< T > getMatrix(Array< T > &)
turn a general array into a matrix
void cxdft(Array< T > &, Array< T > &, int)
n-d complex &lt;-&gt; complex dft
int crFlag
set to 1 (true) if a crfft is done
Definition: DFTServer.h:123
Class containing methods for doing n-D slow Fourier transforms.
Definition: DFTServer.h:75
void crdft(Array< T > &, Array< T > &)
n-d complex &lt;-&gt; real dft
int numFreq
number of frequency data points
Definition: DFTServer.h:120
void rcdft(Array< T > &, Array< T > &)
n-d real &lt;-&gt; complex dft
int numTime
number of time data points
Definition: DFTServer.h:117
Error class for DFTServer class.
Definition: DFTServer.h:54
virtual ~DFTError() noexcept
Definition: DFTServer.h:61
Base class for all Casacore library errors.
Definition: Error.h:134
void c2c(Matrix< T > &, Matrix< T > &, int)
does a complex to complex DFT
void showComplex(Array< T > &)
display both the real and the imaginary components of the data
String: the storage and methods of handling collections of characters.
Definition: String.h:225
void showReal(Array< T > &)
display only the real component of the data
DFTServer()
default constructor