casacore
Loading...
Searching...
No Matches
GaussianConvert.h
Go to the documentation of this file.
1//# GaussianConvert.h: Class to convert units of Gaussians from pixel to world
2//# Copyright (C) 1997,1998,1999,2000
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 COORDINATES_GAUSSIANCONVERT_H
27#define COORDINATES_GAUSSIANCONVERT_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/casa/Arrays/Vector.h>
32#include <casacore/coordinates/Coordinates/CoordinateSystem.h>
33
34
35namespace casacore { //# NAMESPACE CASACORE - BEGIN
36
37template<class T> class Quantum;
38
39
40// <summary>
41// Converts Gaussian parameters between pixel and world
42// </summary>
43
44// <use visibility=export>
45
46// <reviewed reviewer="" date="" tests="">
47// </reviewed>
48
49// <prerequisite>
50// <li> <linkto class=CoordinateSystem>CoordinateSystem</linkto>
51// </prerequisite>
52
53// <synopsis>
54// Converts Gaussian parameters between world and pixel.
55// In the pixel coordinate system ([0,0] in center of image)
56// the position angle is positive +y to -x. This is consistent
57// with Gaussian2D. In the world coordinate system the pa
58// is positive N through E
59// </synopsis>
60
61// <example>
62// <srcblock>
63// </srcblock>
64// </example>
65
66// <todo asof="1998/12/11">
67// <li> Position angle signs require more thinking in Casacore
68// </todo>
69
71{
72public:
73
74 // Default constructor
76
77 // Constructor. You specify which world axes (must be length 2)
78 // of the coordinate system are the relevant ones for
79 // your gaussian (x then y)
81 const Vector<uInt>& worldAxes);
82
83 // Destructor
85
86 // Copy constructor. Uses copy semantics.
88
89 // Assignment operator. Uses copy semantics.
91
92 // (Re)set the coordinate system
94
95 // Re(set) the world axes
96 void setWorldAxes (const Vector<uInt>& worldAxes);
97
98 // Convert Gaussian parameters from pixels to world. Returns
99 // False if it fails with an error message recoverable with
100 // function errorMessage. If you set the units of the output
101 // axis quanta they will be honoured, otherwise they will come out
102 // in the axis units of the coordinate system. For the output position angle,
103 // if the output units are not set, the units of the input position angle
104 // will be used.
105 Bool toWorld(Quantum<Double>& majorAxisOut, Quantum<Double>& minorAxisOut,
106 Quantum<Double>& positionAngleOut, Double majorAxisIn,
107 Double minorAxisIn, const Quantum<Double>& positionAngleIn);
108
109 // Convert Gaussian parameters from world to pixel. Returns
110 // False if it fails with an error message recoverable with
111 // function errorMessage. For the output position angle,
112 // if the output units are not set, the units of the input position angle
113 // will be used.
114 Bool toPixel(Double& majorAxisOut, Double& minorAxisOut,
115 Quantum<Double>& positionAngleOut, const Quantum<Double>& majorAxisIn,
116 const Quantum<Double>& minorAxisIn, const Quantum<Double>& positionAngleIn);
117
118 // Convert location
119 // <group>
121 const Vector<Quantum<Double> >& world);
123 const Vector<Double>& pixel);
124 // </group>
125
126 // Recover error messages from the conversion functions
128
129
130private:
131
136
137 void convertAxes (Double& minorAxisOut, Double& majorAxisOut,
138 Quantum<Double>& positionAngleOut,
139 Double minorAxisIn, Double majorAxisIn,
140 const Quantum<Double>& positionAngleIn,
141 const CoordinateSystem& cSys,
142 String dir);
143
145
147
149
150};
151
152
153} //# NAMESPACE CASACORE - END
154
155#endif
GaussianConvert(const GaussianConvert &other)
Copy constructor.
Double positionAngleRange(Double pa)
~GaussianConvert()
Destructor.
GaussianConvert & operator=(const GaussianConvert &other)
Assignment operator.
void setCoordinateSystem(const CoordinateSystem &cSys)
(Re)set the coordinate system
String errorMessage() const
Recover error messages from the conversion functions.
void setWorldAxes(const Vector< uInt > &worldAxes)
Re(set) the world axes
Bool toWorld(Quantum< Double > &majorAxisOut, Quantum< Double > &minorAxisOut, Quantum< Double > &positionAngleOut, Double majorAxisIn, Double minorAxisIn, const Quantum< Double > &positionAngleIn)
Convert Gaussian parameters from pixels to world.
Bool toWorld(Vector< Quantum< Double > > &world, const Vector< Double > &pixel)
Bool toPixel(Double &majorAxisOut, Double &minorAxisOut, Quantum< Double > &positionAngleOut, const Quantum< Double > &majorAxisIn, const Quantum< Double > &minorAxisIn, const Quantum< Double > &positionAngleIn)
Convert Gaussian parameters from world to pixel.
Bool toPixel(Vector< Double > &pixel, const Vector< Quantum< Double > > &world)
Convert location.
GaussianConvert()
Default constructor.
void convertAxes(Double &minorAxisOut, Double &majorAxisOut, Quantum< Double > &positionAngleOut, Double minorAxisIn, Double majorAxisIn, const Quantum< Double > &positionAngleIn, const CoordinateSystem &cSys, String dir)
GaussianConvert(const CoordinateSystem &cSys, const Vector< uInt > &worldAxes)
Constructor.
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
LatticeExprNode pa(const LatticeExprNode &left, const LatticeExprNode &right)
This function finds 180/pi*atan2(left,right)/2.
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
double Double
Definition aipstype.h:53