casacore
Loading...
Searching...
No Matches
GaussianBeam.h
Go to the documentation of this file.
1// # Copyright (C) 1996,1997,1998,1999,2000,2001,2003
2// # Associated Universities, Inc. Washington DC, USA.
3// #
4// # This library is free software; you can redistribute it and/or modify it
5// # under the terms of the GNU Library General Public License as published by
6// # the Free Software Foundation; either version 2 of the License, or (at your
7// # option) any later version.
8// #
9// # This library is distributed in the hope that it will be useful, but WITHOUT
10// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12// # License for more details.
13// #
14// # You should have received a copy of the GNU Library General Public License
15// # along with this library; if not, write to the Free Software Foundation,
16// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17// #
18// # Correspondence concerning AIPS++ should be addressed as follows:
19// # Internet email: casa-feedback@nrao.edu.
20// # Postal address: AIPS++ Project Office
21// # National Radio Astronomy Observatory
22// # 520 Edgemont Road
23// # Charlottesville, VA 22903-2475 USA
24
25#ifndef SCIMATH_GAUSSIANBEAM_H
26#define SCIMATH_GAUSSIANBEAM_H
27
28#include <casacore/casa/aips.h>
29#include <casacore/casa/Quanta/Quantum.h>
30
31namespace casacore {
32
33// <summary>
34// Represents a Gaussian restoring beam associated with an image.
35// </summary>
36
37// <use visibility=export>
38
39// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
40// </reviewed>
41
42// <prerequisite>
43// </prerequisite>
44
45// <etymology>
46// A Gaussian Beam.
47// </etymology>
48
49// <synopsis>
50// This class represents a Gaussian restoring beam associated with
51// a deconvolved image.
52// </synopsis>
53//
54// <example>
55
56// </example>
57
58// <motivation>
59// Restoring beams are used many places in image analysis tasks.
60// </motivation>
61
62// <todo>
63// </todo>
64
66 public:
67 static const GaussianBeam NULL_BEAM;
68
69 // create a beam with all quantities zero (a null beam).
71
72 // Construct a beam from a set of Quantities. If minor > major
73 // an exception is thrown. If any units are not angular, an
74 // exception is thrown
75 GaussianBeam(const Quantity& major, const Quantity& minor, const Quantity& pa);
76
77 // Construct a beam from a 3-Vector of Quantities representing
78 // the major axis, the minor axis and the position angle (in that order).
79 // If parms[1] > parms[0] (minor axis > major axis),
80 // an exception is thrown. If any units are not angular, an
81 // exception is thrown
83
85
87
89
90 Bool operator==(const GaussianBeam& other) const;
91
92 Bool operator!=(const GaussianBeam& other) const;
93
94 // returns the major axis in the same units as it had at construction
95 const Quantity& getMajor() const;
96
97 // returns the value portion of the major axis in the specified units
98 Double getMajor(const Unit& u) const;
99
100 // returns the minor axis in the same units as it had at construction
101 const Quantity& getMinor() const;
102
103 // returns the value portion of the minor axis in the specified units
104 Double getMinor(const Unit& u) const;
105
106 // returns the position angle's value as it was at construction,
107 // unless <src>unwrap</src> is True, in which case the value of the angle
108 // returned will be between -90 and 90 degrees (but with unit the same
109 // as it had when this object was constructed).
110 Quantity getPA(const Bool unwrap = True) const;
111
112 // returns the value portion of the position angle in the specified units
113 Double getPA(const Unit& u, const Bool unwrap = True) const;
114
115 // returns the beam area in the specified <src>unit</src>, which much conform to
116 // solid angle units.
117 Double getArea(const Unit& unit) const;
118
119 // is this object a null beam (ie is either its major and/or minor axis zero)?
120 Bool isNull() const;
121
122 // returns GassianBeam.
123 static const String& className();
124
126
127 void setMajorMinor(const Quantity& majAx, const Quantity& minAx);
128
129 // if unwrap=True, unwrap pa so its value lies in the range
130 // -90 to 90 degrees before setting it.
131 void setPA(const Quantity& pa, Bool unwrap = False);
132
133 static GaussianBeam fromRecord(const Record& rec);
134
135 // convert this object to a three-Vector of (major FWHM, minor FWHM, and pa).
136 // If <src>unwrap</src> is True, the returned pa will fall between -90 and +90
137 // degrees.
138 Vector<Quantity> toVector(const Bool unwrap = True) const;
139
140 // convert stored Quantities to the specified units
141 void convert(const String& majUnit, const String& minUnit, const String& paUnit);
142
143 protected:
145
146 private:
147 static Quantity _unwrap(const Quantity& pa);
148};
149
150ostream& operator<<(ostream& os, const GaussianBeam& beam);
151
153
154Bool near(const GaussianBeam& left, const GaussianBeam& other, const Double relWidthTol,
155 const Quantity& absPaTol);
156
157} // namespace casacore
158
159#endif
Double getMajor(const Unit &u) const
returns the value portion of the major axis in the specified units
Bool operator!=(const GaussianBeam &other) const
void convert(const String &majUnit, const String &minUnit, const String &paUnit)
convert stored Quantities to the specified units
static const String & className()
returns GassianBeam.
Record toRecord() const
void setMajorMinor(const Quantity &majAx, const Quantity &minAx)
Bool isNull() const
is this object a null beam (ie is either its major and/or minor axis zero)?
GaussianBeam(const GaussianBeam &other)
Double getMinor(const Unit &u) const
returns the value portion of the minor axis in the specified units
GaussianBeam(const Vector< Quantity > &parms)
Construct a beam from a 3-Vector of Quantities representing the major axis, the minor axis and the po...
static GaussianBeam fromRecord(const Record &rec)
const Quantity & getMajor() const
returns the major axis in the same units as it had at construction
Quantity getPA(const Bool unwrap=True) const
returns the position angle's value as it was at construction, unless unwrap is True,...
GaussianBeam(const Quantity &major, const Quantity &minor, const Quantity &pa)
Construct a beam from a set of Quantities.
Double getArea(const Unit &unit) const
returns the beam area in the specified unit, which much conform to solid angle units.
static Quantity _unwrap(const Quantity &pa)
Double getPA(const Unit &u, const Bool unwrap=True) const
returns the value portion of the position angle in the specified units
GaussianBeam()
create a beam with all quantities zero (a null beam).
Vector< Quantity > toVector(const Bool unwrap=True) const
convert this object to a three-Vector of (major FWHM, minor FWHM, and pa).
const Quantity & getMinor() const
returns the minor axis in the same units as it had at construction
void setPA(const Quantity &pa, Bool unwrap=False)
if unwrap=True, unwrap pa so its value lies in the range -90 to 90 degrees before setting it.
static const GaussianBeam NULL_BEAM
Bool operator==(const GaussianBeam &other) const
GaussianBeam & operator=(const GaussianBeam &other)
String: the storage and methods of handling collections of characters.
Definition String.h:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
LatticeExprNode pa(const LatticeExprNode &left, const LatticeExprNode &right)
This function finds 180/pi*atan2(left,right)/2.
const Bool False
Definition aipstype.h:42
ostream & operator<<(ostream &os, const IComplex &)
Show on ostream.
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
Quantum< Double > Quantity
Definition Quantum.h:40
const Bool True
Definition aipstype.h:41
double Double
Definition aipstype.h:53
Bool near(const GaussianBeam &left, const GaussianBeam &other, const Double relWidthTol, const Quantity &absPaTol)