casacore
LatticeFFT.h
Go to the documentation of this file.
1 //# LatticeFFT.h: Definitions for Lattice FFT functions
2 //# Copyright (C) 1996,1997,1998,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 //#
27 //# $Id$
28 
29 #ifndef LATTICES_LATTICEFFT_H
30 #define LATTICES_LATTICEFFT_H
31 
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/BasicSL/Complex.h>
34 
35 namespace casacore { //# NAMESPACE CASACORE - BEGIN
36 
37 template <class T> class Vector;
38 template <class T> class Lattice;
39 
40 // <summary>Functions for Fourier transforming Lattices</summary>
41 
42 // <reviewed reviewer="" date="" tests="" demos="">
43 // </reviewed>
44 
45 // <prerequisite>
46 // </prerequisite>
47 
48 // <etymology>
49 // </etymology>
50 
51 // <synopsis>
52 // </synopsis>
53 
54 // <example>
55 // <srcblock>
56 // </srcblock>
57 // </example>
58 
59 // <motivation>
60 // </motivation>
61 
62 // <todo asof="">
63 // </todo>
64 
66 {
67 public:
68  // 2-D in-place complex->complex FFT. Transforms over the first two
69  // dimensions and iterates over all the others. The Lattice must have two or
70  // more dimensions otherwise an AipsError is thrown.
71  static void cfft2d(Lattice<DComplex> & cLattice, const Bool toFrequency=True);
72  static void cfft2d(Lattice<Complex> & cLattice, const Bool toFrequency=True);
73 
74  // N-D in-place complex->complex FFT. Only transform over selected
75  // dimensions. Iterate over the others. whichAxes must be the same length as
76  // the number of dimensions in the Lattice otherwise an AipsError is thrown.
77  static void cfft(Lattice<DComplex> & cLattice,
78  const Vector<Bool> & whichAxes, const Bool toFrequency=True);
79  static void cfft(Lattice<Complex> & cLattice,
80  const Vector<Bool> & whichAxes, const Bool toFrequency=True);
81 
82  // Non-folded version
83  static void cfft0(Lattice<Complex> & cLattice,
84  const Vector<Bool> & whichAxes, const Bool toFrequency=True);
85 
86  // N-D in-place complex->complex FFT. Transform over all axes.
87  static void cfft(Lattice<DComplex> & cLattice, const Bool toFrequency=True);
88  static void cfft(Lattice<Complex> & cLattice, const Bool toFrequency=True);
89 
90  // N-D real->complex FFT. Only one half of the Hermition result is
91  // returned. Transforms are only done on selected dimensions. The origin of
92  // the transform is the center of the Lattice ie., [nx/2,ny/2,...] if
93  // doShift is True. Otherwise it is the first element ie., [0,0,...]
94  static void rcfft(Lattice<Complex> & out, const Lattice<Float> & in,
95  const Vector<Bool> & whichAxes, const Bool doShift=True,
96  Bool doFast=False);
97 
98  static void myrcfft(Lattice<Complex> & out, const Lattice<Float> & in,
99  const Vector<Bool> & whichAxes, const Bool doShift=True);
100 
101  // N-D real->complex FFT. Only one half of the Hermition result is
102  // returned. Transform over all dimensions. The origin of
103  // the transform is the center of the Lattice ie., [nx/2,ny/2,...] if
104  // doShift is True. Otherwise it is the first element ie., [0,0,...]
105  static void rcfft(Lattice<Complex> & out, const Lattice<Float> & in,
106  const Bool doShift=True, Bool doFast=False);
107  static void myrcfft(Lattice<Complex> & out, const Lattice<Float> & in,
108  const Bool doShift=True);
109 
110  // N-D complex->real FFT. Only one half of the Hermition input is
111  // required. If whichAxis is specified Transforms are only done on selected
112  // dimensions otherwise they are done on all axes. The origin of the
113  // transform is the center of the Lattice ie., [nx/2,ny/2,...] if doShift is
114  // True, otherwise it is the first element ie., [0,0,...]
115 
116  // These functions will <b>scramble the input Lattice</b> unless the versions
117  // with const inputs are used. The const input versions are less efficient as
118  // they create a temporary Lattice and copy the input data into it.
119  // <group>
120  static void crfft(Lattice<Float> & out, Lattice<Complex> & in,
121  const Vector<Bool> & whichAxes,
122  const Bool doShift=True, Bool doFast=False);
123  static void crfft(Lattice<Float> & out, Lattice<Complex> & in,
124  const Bool doShift=True, Bool doFast=False);
125  static void crfft(Lattice<Float> & out, const Lattice<Complex> & in,
126  const Bool doShift=True, Bool doFast=False);
127  // </group>
128 };
129 
130 } //# NAMESPACE CASACORE - END
131 
132 #endif
static void cfft2d(Lattice< DComplex > &cLattice, const Bool toFrequency=True)
2-D in-place complex->complex FFT.
A templated, abstract base class for array-like objects.
Definition: Functional.h:37
static void rcfft(Lattice< Complex > &out, const Lattice< Float > &in, const Vector< Bool > &whichAxes, const Bool doShift=True, Bool doFast=False)
N-D real->complex FFT.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:39
static void myrcfft(Lattice< Complex > &out, const Lattice< Float > &in, const Vector< Bool > &whichAxes, const Bool doShift=True)
const Bool False
Definition: aipstype.h:41
static void crfft(Lattice< Float > &out, Lattice< Complex > &in, const Vector< Bool > &whichAxes, const Bool doShift=True, Bool doFast=False)
N-D complex->real FFT.
Functions for Fourier transforming Lattices.
Definition: LatticeFFT.h:65
static void cfft(Lattice< DComplex > &cLattice, const Vector< Bool > &whichAxes, const Bool toFrequency=True)
N-D in-place complex->complex FFT.
const Bool True
Definition: aipstype.h:40
this file contains all the compiler specific defines
Definition: mainpage.dox:28
static void cfft0(Lattice< Complex > &cLattice, const Vector< Bool > &whichAxes, const Bool toFrequency=True)
Non-folded version.