casacore
Loading...
Searching...
No Matches
WCEllipsoid.h
Go to the documentation of this file.
1//# WCPolygon.h: Class to define a polygonal world coordinate region
2//# Copyright (C) 1998,1999,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
27#ifndef IMAGES_WCELLIPSOID_H
28#define IMAGES_WCELLIPSOID_H
29
30#include <casacore/casa/aips.h>
31#include <casacore/coordinates/Coordinates/CoordinateSystem.h>
32#include <casacore/images/Regions/WCRegion.h>
33#include <casacore/lattices/LRegions/RegionType.h>
34#include <casacore/casa/Arrays/Vector.h>
35#include <casacore/casa/Quanta/Quantum.h>
36
37namespace casacore { //# NAMESPACE CASACORE - BEGIN
38
39
40// <summary>
41// Class to define an n-dimensional ellipsoid in world coordinates.
42//
43// </summary>
44//
45// <use visibility=export>
46//
47// <reviewed reviewer="" date="" tests="">
48// </reviewed>
49//
50// <prerequisite>
51// <li> <linkto class=WCRegion>WCRegion</linkto>
52// <li> <linkto class=WCRegion>WCPolygon</linkto>
53// <li> <linkto class=LCRegion>LCRegion</linkto>
54// <li> <linkto class=CoordinateSystem>CoordinateSystem</linkto>
55// </prerequisite>
56//
57// <synopsis>
58//
59// </synopsis>
60//
61
62// <motivation>
63// Users must be able to specify ellipsoids in world as well as lattice
64// coordinates.
65// </motivation>
66//
67
68
69class WCEllipsoid : public WCRegion
70{
71public:
72
73 // ellipsoid with axes parallel to coordinate axes
75 const Vector<Quantity>& center,
76 const Vector<Quantity>& radii,
77 const IPosition& pixelAxes,
78 const CoordinateSystem& cSys,
80 );
81
82 // sphere. <src>pixelAxes</src> must have the same base units
83 // and those pixels musb be square or an exception is thrown.
85 const Vector<Quantity>& center,
86 const Quantity& radius,
87 const IPosition& pixelAxes,
88 const CoordinateSystem& cSys,
90 );
91
92 // 2-D ellipse . The axes must have the same base units
93 // and those pixels must be square or an exception is thrown.
94 // <src>theta</src> is the angle between the <src>pixelAxis0</src> and
95 // the major axis of the ellipse.
97 const Quantity& xcenter, const Quantity& ycenter,
98 const Quantity& majorAxis, const Quantity& minorAxis,
99 const Quantity& theta,
100 const uInt pixelAxis0, const uInt pixelAxis1,
101 const CoordinateSystem& cSys,
103 );
104
106
108
109 Bool operator== (const WCRegion& other) const;
110
112
114
115 String type() const;
116
118
120 const TableRecord& rec,
121 const String&
122 );
123
124 TableRecord toRecord(const String& tableName) const;
125
127 const CoordinateSystem& csys,
128 const IPosition& latticeShape,
129 const IPosition& pixelAxesMap,
130 const IPosition& outOrder
131 ) const;
132
133private:
134
135 // WARN do not change the order of the members of this enum
136 // or you will break backward compatibility with records previously
137 // saved persistently. Add new types to the end of the enum.
143
145
148
154
155 void _checkPixelAxes() const;
156 void _checkUnits() const;
157
158 void _init();
159
160};
161
162} //# NAMESPACE CASACORE - END
163
164#endif
AbsRelType
Define if a region is absolute or relative.
Definition RegionType.h:73
String: the storage and methods of handling collections of characters.
Definition String.h:223
WCEllipsoid(const Vector< Quantity > &center, const Vector< Quantity > &radii, const IPosition &pixelAxes, const CoordinateSystem &cSys, const RegionType::AbsRelType absRel=RegionType::Abs)
ellipsoid with axes parallel to coordinate axes
Vector< Quantity > _radii
LCRegion * doToLCRegion(const CoordinateSystem &csys, const IPosition &latticeShape, const IPosition &pixelAxesMap, const IPosition &outOrder) const
Convert to an LCRegion using the given coordinate system and shape.
WCRegion * cloneRegion() const
Clone a WCRegion object.
TableRecord toRecord(const String &tableName) const
Convert the (derived) object to a record.
RegionType::AbsRelType _absRel
Bool operator==(const WCRegion &other) const
Comparison.
Bool canExtend() const
Can the region extend itself? By default it cannot.
CoordinateSystem _csys
static String className()
WCEllipsoid(const Vector< Quantity > &center, const Quantity &radius, const IPosition &pixelAxes, const CoordinateSystem &cSys, const RegionType::AbsRelType absRel=RegionType::Abs)
sphere.
WCEllipsoid & operator=(const WCEllipsoid &that)
void _checkUnits() const
static WCEllipsoid * fromRecord(const TableRecord &rec, const String &)
WCEllipsoid(const Quantity &xcenter, const Quantity &ycenter, const Quantity &majorAxis, const Quantity &minorAxis, const Quantity &theta, const uInt pixelAxis0, const uInt pixelAxis1, const CoordinateSystem &cSys, const RegionType::AbsRelType absRel=RegionType::Abs)
2-D ellipse.
SpecialType
WARN do not change the order of the members of this enum or you will break backward compatibility wit...
WCEllipsoid(const WCEllipsoid &that)
void _checkPixelAxes() const
String type() const
Return region type.
Vector< Quantity > _center
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40