casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AnnEllipse.h
Go to the documentation of this file.
1 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
3 //# License for more details.
4 //#
5 //# You should have received a copy of the GNU Library General Public License
6 //# along with this library; if not, write to the Free Software Foundation,
7 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
8 //#
9 //# Correspondence concerning AIPS++ should be addressed as follows:
10 //# Internet email: aips2-request@nrao.edu.
11 //# Postal address: AIPS++ Project Office
12 //# National Radio Astronomy Observatory
13 //# 520 Edgemont Road
14 //# Charlottesville, VA 22903-2475 USA
15 //#
16 
17 #ifndef ANNOTATIONS_ANNELLIPSE_H
18 #define ANNOTATIONS_ANNELLIPSE_H
19 
21 
22 
23 #include <casa/aips.h>
24 
25 namespace casa {
26 
27 // <summary>
28 // This class represents an annotation of an elliptical (in position coordinates) region specified
29 // in an ascii region file as proposed in CAS-2285. It is specified by its center position
30 // semi-major and semi-minor axes, and position angle.
31 // </summary>
32 // <author>Dave Mehringer</author>
33 // <use visibility=export>
34 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
35 // </reviewed>
36 // <prerequisite>
37 
38 // </prerequisite>
39 
40 // <etymology>
41 // Holds the specification of a an annotation of an elliptical region as specified in ASCII format.
42 // Specified by center position, semi-major and semi-minor axes, and position angle.
43 // </etymology>
44 
45 // <synopsis>
46 // This class represents an annotation of an elliptical region in coordinate space specified by
47 // center, semi-major and semi-minor axes, and position angle
48 // </synopsis>
49 
50 class AnnEllipse: public AnnRegion {
51 
52 public:
53 
54  // <src>positionAngle</src> is defined as the angle between north and the
55  // ellipse major axis. Note the lengths are for the semi-major and semi-minor axes,
56  // not the major and minor axes
57  // <group>
58 
59  AnnEllipse(
60  const casacore::Quantity& xcenter, const casacore::Quantity& ycenter,
61  const casacore::Quantity& semiMajorAxis,
62  const casacore::Quantity& semiMinorAxis, const casacore::Quantity& positionAngle,
63  const casacore::String& dirRefFrameString,
64  const casacore::CoordinateSystem& csys,
65  const casacore::IPosition& imShape,
66  const casacore::Quantity& beginFreq,
67  const casacore::Quantity& endFreq,
68  const casacore::String& freqRefFrameString,
69  const casacore::String& dopplerString,
70  const casacore::Quantity& restfreq,
72  const casacore::Bool annotationOnly,
73  const casacore::Bool requireImageRegion=true
74  );
75 
76  // Simplified constructor.
77  // all frequencies are used (these can be set after construction).
78  // xcenter and ycenter
79  // must be in the same frame as the csys direction coordinate.
80  // is a region (not just an annotation), although this value can be changed after
81  // construction.
82  AnnEllipse(
83  const casacore::Quantity& xcenter, const casacore::Quantity& ycenter,
84  const casacore::Quantity& semiMajorAxis,
85  const casacore::Quantity& semiMinorAxis, const casacore::Quantity& positionAngle,
86  const casacore::CoordinateSystem& csys,
87  const casacore::IPosition& imShape,
89  const casacore::Bool requireImageRegion=true
90  );
91 
92  // implicit copy constructor and destructor are fine
93 
94  //</group>
95 
96  AnnEllipse& operator=(const AnnEllipse& other);
97 
98  casacore::Bool operator==(const AnnEllipse& other) const;
99 
100  // Get the center position, tranformed to the reference
101  // from of the coordinate system if necessary
103 
104  // get semi-major axis. The quantity will have units
105  // of angular measure
107 
108  // get semi-minor axis. The quantity will have units
109  // of angular measure
111 
112  // get position angle. The quantity will have units
113  // of angular measure and will be measured from north through east,
114  // using the normal astronomical convention.
116 
117  virtual std::ostream& print(std::ostream &os) const;
118 
119 
120 private:
125 
126  void _init(const casacore::Quantity& xcenter, const casacore::Quantity& ycenter);
127 };
128 
129 }
130 
131 #endif /* ASCIIELLIPSEREGION_H_ */
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
This class represents an annotation of an elliptical (in position coordinates) region specified in an...
Definition: AnnEllipse.h:50
A Measure: astronomical direction.
Definition: MDirection.h:174
casacore::Quantity _convertedSemiMajorAxis
Definition: AnnEllipse.h:122
casacore::Quantity _convertedSemiMinorAxis
Definition: AnnEllipse.h:122
casacore::Quantity _convertedPositionAngle
Definition: AnnEllipse.h:122
A 1-D Specialization of the Array class.
casacore::Quantity getSemiMajorAxis() const
get semi-major axis.
This class represents a annotation referring to a region specified in an ascii region file as propose...
Definition: AnnRegion.h:53
casacore::MDirection getCenter() const
Get the center position, tranformed to the reference from of the coordinate system if necessary...
casacore::Quantity _inputSemiMinorAxis
Definition: AnnEllipse.h:122
casacore::Quantity getSemiMinorAxis() const
get semi-minor axis.
virtual std::ostream & print(std::ostream &os) const
casacore::Quantity _inputPositionAngle
Definition: AnnEllipse.h:122
AnnotationBase::Direction _inputCenter
Definition: AnnEllipse.h:121
AnnEllipse & operator=(const AnnEllipse &other)
implicit copy constructor and destructor are fine
AnnEllipse(const casacore::Quantity &xcenter, const casacore::Quantity &ycenter, const casacore::Quantity &semiMajorAxis, const casacore::Quantity &semiMinorAxis, const casacore::Quantity &positionAngle, const casacore::String &dirRefFrameString, const casacore::CoordinateSystem &csys, const casacore::IPosition &imShape, const casacore::Quantity &beginFreq, const casacore::Quantity &endFreq, const casacore::String &freqRefFrameString, const casacore::String &dopplerString, const casacore::Quantity &restfreq, const casacore::Vector< casacore::Stokes::StokesTypes > stokes, const casacore::Bool annotationOnly, const casacore::Bool requireImageRegion=true)
positionAngle is defined as the angle between north and the ellipse major axis.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Quantity getPositionAngle() const
get position angle.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Bool operator==(const AnnEllipse &other) const
casacore::Quantity _inputSemiMajorAxis
Definition: AnnEllipse.h:122
Interconvert pixel and world coordinates.