casacore
Loading...
Searching...
No Matches
LELSpectralIndex.h
Go to the documentation of this file.
1//# LELSpectralIndex.h: LEL function to calculate spectral index/
2//# Copyright (C) 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 LATTICES_LELSPECTRALINDEX_H
27#define LATTICES_LELSPECTRALINDEX_H
28
29
30//# Includes
31#include <casacore/casa/aips.h>
32#include <casacore/lattices/LEL/LELFunction.h>
33#include <casacore/casa/Containers/Block.h>
34
35namespace casacore { //# NAMESPACE CASACORE - BEGIN
36
37//# Forward Declarations
38
39
40// <summary>
41// This LEL class handles calculation of the spectral index.
42// </summary>
43
44// <use visibility=local>
45
46// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
47// </reviewed>
48
49// <prerequisite>
50// <li> <linkto class="Lattice"> Lattice</linkto>
51// <li> <linkto class="LatticeExpr"> LatticeExpr</linkto>
52// <li> <linkto class="LatticeExprNode"> LatticeExprNode</linkto>
53// <li> <linkto class="LELInterface"> LELInterface</linkto>
54// <li> <linkto class="LELFunctionEnums"> LELFunctionEnums</linkto>
55// </prerequisite>
56
57// <synopsis>
58// This LEL letter class is derived from LELInterface. It is used to
59// construct LEL objects that calculate the sepectral index from 2 other
60// LEL expression (usually images).
61// It operates on real types (Float,Double)
62// </synopsis>
63
64// <motivation>
65// This is a separate class (instead of being part of a LELFunction class),
66// because the calculation of the spectral index requires extra variables
67// (the frequencies) and some more complicated code.
68// </motivation>
69
70template<class T> class LELSpectralIndex : public LELInterface<T>
71{
72 //# Make members of parent class known.
73protected:
74 using LELInterface<T>::setAttr;
75
76public:
77 // Constructor takes operation and expressions to be operated upon
79
80 // Destructor
82
83 // Recursively evaluate the expression
84 virtual void eval (LELArray<T>& result,
85 const Slicer& section) const;
86
87 // Get the result of a scalar subexpression.
88 // Throws an exception as it is not possible.
89 virtual LELScalar<T> getScalar() const;
90
91 // Do further preparations (e.g. optimization) on the expression.
92 // Returns False.
94
95 // Get class name
96 virtual String className() const;
97
98 // Handle locking/syncing of a lattice in a lattice expression.
99 // <group>
100 virtual Bool lock (FileLocker::LockType, uInt nattempts);
101 virtual void unlock();
103 virtual void resync();
104 // </group>
105
106private:
108 Block<Double> itsLogFreq; //# log(f0/f1)
111};
112
113
114
115} //# NAMESPACE CASACORE - END
116
117#ifndef CASACORE_NO_AUTO_TEMPLATES
118#include <casacore/lattices/LEL/LELSpectralIndex.tcc>
119#endif //# CASACORE_NO_AUTO_TEMPLATES
120#endif
simple 1-D array
Definition Block.h:198
LockType
Define the possible lock types.
Definition FileLocker.h:93
void setAttr(const LELAttribute &attrib)
Set the expression attributes of this object.
virtual String className() const
Get class name.
virtual void eval(LELArray< T > &result, const Slicer &section) const
Recursively evaluate the expression
virtual Bool prepareScalarExpr()
Do further preparations (e.g.
virtual Bool lock(FileLocker::LockType, uInt nattempts)
Handle locking/syncing of a lattice in a lattice expression.
virtual Bool hasLock(FileLocker::LockType) const
LELSpectralIndex(const Block< LatticeExprNode > &expr)
Constructor takes operation and expressions to be operated upon.
virtual LELScalar< T > getScalar() const
Get the result of a scalar subexpression.
String: the storage and methods of handling collections of characters.
Definition String.h:223
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40