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#ifndef IMAGES_WCELLIPSOID_H
27#define IMAGES_WCELLIPSOID_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/coordinates/Coordinates/CoordinateSystem.h>
31#include <casacore/images/Regions/WCRegion.h>
32#include <casacore/lattices/LRegions/RegionType.h>
33#include <casacore/casa/Arrays/Vector.h>
34#include <casacore/casa/Quanta/Quantum.h>
35
36namespace casacore { // # NAMESPACE CASACORE - BEGIN
37
38// <summary>
39// Class to define an n-dimensional ellipsoid in world coordinates.
40//
41// </summary>
42//
43// <use visibility=export>
44//
45// <reviewed reviewer="" date="" tests="">
46// </reviewed>
47//
48// <prerequisite>
49// <li> <linkto class=WCRegion>WCRegion</linkto>
50// <li> <linkto class=WCRegion>WCPolygon</linkto>
51// <li> <linkto class=LCRegion>LCRegion</linkto>
52// <li> <linkto class=CoordinateSystem>CoordinateSystem</linkto>
53// </prerequisite>
54//
55// <synopsis>
56//
57// </synopsis>
58//
59
60// <motivation>
61// Users must be able to specify ellipsoids in world as well as lattice
62// coordinates.
63// </motivation>
64//
65
66class WCEllipsoid : public WCRegion {
67 public:
68 // ellipsoid with axes parallel to coordinate axes
69 WCEllipsoid(const Vector<Quantity>& center, const Vector<Quantity>& radii,
70 const IPosition& pixelAxes, const CoordinateSystem& cSys,
72
73 // sphere. <src>pixelAxes</src> must have the same base units
74 // and those pixels musb be square or an exception is thrown.
75 WCEllipsoid(const Vector<Quantity>& center, const Quantity& radius, const IPosition& pixelAxes,
76 const CoordinateSystem& cSys, const RegionType::AbsRelType absRel = RegionType::Abs);
77
78 // 2-D ellipse . The axes must have the same base units
79 // and those pixels must be square or an exception is thrown.
80 // <src>theta</src> is the angle between the <src>pixelAxis0</src> and
81 // the major axis of the ellipse.
82 WCEllipsoid(const Quantity& xcenter, const Quantity& ycenter, const Quantity& majorAxis,
83 const Quantity& minorAxis, const Quantity& theta, const uInt pixelAxis0,
84 const uInt pixelAxis1, const CoordinateSystem& cSys,
86
88
90
91 Bool operator==(const WCRegion& other) const;
92
94
95 Bool canExtend() const;
96
97 String type() const;
98
99 static String className();
100
101 static WCEllipsoid* fromRecord(const TableRecord& rec, const String&);
102
103 TableRecord toRecord(const String& tableName) const;
104
105 LCRegion* doToLCRegion(const CoordinateSystem& csys, const IPosition& latticeShape,
106 const IPosition& pixelAxesMap, const IPosition& outOrder) const;
107
108 private:
109 // WARN do not change the order of the members of this enum
110 // or you will break backward compatibility with records previously
111 // saved persistently. Add new types to the end of the enum.
113
115
118
124
125 void _checkPixelAxes() const;
126 void _checkUnits() const;
127
128 void _init();
129};
130
131} // namespace casacore
132
133#endif
AbsRelType
Define if a region is absolute or relative.
Definition RegionType.h:71
String: the storage and methods of handling collections of characters.
Definition String.h:355
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?
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
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
Quantum< Double > Quantity
Definition Quantum.h:40