casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LimbDarkenedDiskShape.h
Go to the documentation of this file.
1 //# LimbDarkenedDiskShape.h: defines LimbDarkened Disk shape
2 //
3 //# CASA - Common Astronomy Software Applications (http://casa.nrao.edu/)
4 //# Copyright (C) 2012
5 //# Associated Universities, Inc. Washington DC, USA.
6 //#
7 //# This library is free software; you can redistribute it and/or modify it
8 //# under the terms of the GNU Lesser General Public License as published by
9 //# the Free Software Foundation; either version 2.1 of the License, or (at your
10 //# option) any later version.
11 //#
12 //# This library is distributed in the hope that it will be useful, but WITHOUT
13 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 //# License for more details.
16 //#
17 //# You should have received a copy of the GNU Lesser General Public License
18 //# along with this library; if not, write to the Free Software Foundation,
19 //# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 //#
21 //#
22 //#
23 //# $Id$
24 
25 #ifndef COMPONENT_LIMBDARKENED_DISKSHAPE_H
26 #define COMPONENT_LIMBDARKENED_DISKSHAPE_H
27 
28 //#! Includes go here
29 #include <casa/aips.h>
30 #include <casa/BasicSL/Complex.h>
32 
33 namespace casacore{
34 
35 class MDirection;
36 class MVAngle;
37 template <class Qtype> class Quantum;
38 template <class T> class Matrix;
39 template <class T> class Vector;
40 }
41 
42 namespace casa { //# NAMESPACE CASA - BEGIN
43 
44 //# Forward Declarations
45 
46 // <summary>A limb-darkened disk model for the spatial distribution of emission</summary>
47 
48 //<use visibility=export>
49 
50 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
51 // </reviewed>
52 
53 // <prerequisite>
54 // <li><linkto class=TwoSidedShape>TwoSidedShape</linkto>
55 // </prerequisite>
56 //
57 // <etymology>
58 //#! Except when it is obvious (e.g., "casacore::Array") explain how the class name
59 //#! expresses the role of this class. Example: casacore::IPosition is short for
60 //#! "Integral Position" - a specialized integer vector for specifying
61 //#! array dimensions and indices.
62 // </etymology>
63 //
64 // <synopsis>
65 // A LimbDarkenedDiskShape models the spatial distribution of radiation from
66 // the sky as a using a limb-darkened elliptical disk with user specified major axis
67 // width, minor axis width and position angle.
68 //
69 // This class like the other component shapes becomes more useful when used
70 // through the <linkto class=SkyComponent>SkyComponent</linkto> class, which
71 // incorperates the flux and spectral variation of the emission, or through the
72 // <linkto class=ComponentList>ComponentList</linkto> class, which handles
73 // groups of SkyComponent objects.
74 //
75 // The functionality of this class is similar to that of <linkto class=DiskShape>
76 // DiskShape</linkto> with an additional parameter to describe the exponent in
77 // the limb darkened disk model (\f$I=I_{0}(1-(r/R)^{2})^{n/2}\f$).
78 //
79 // </synopsis>
80 //
81 // <example>
82 //#! One or two concise (~10-20 lines) examples, with a modest amount of
83 //#! text to support code fragments. Use <srcblock> and </srcblock> to
84 //#! delimit example code.
85 // </example>
86 //
87 // <motivation>
88 //#! Insight into a class is often provided by a description of
89 //#! the circumstances that led to its conception and design. Describe
90 //#! them here.
91 // </motivation>
92 //
93 // <todo asof="yyyy/mm/dd">
94 //#! A casacore::List of bugs, limitations, extensions or planned refinements.
95 //#! The programmer should fill in a date in the "asof" field, which
96 //#! will usually be the date at which the class is submitted for review.
97 //#! If, during the review, new "todo" items come up, then the "asof"
98 //#! date should be changed to the end of the review period.
99 //# <li> add this feature
100 //# <li> fix this bug
101 //# <li> start discussion of this possible extension
102 // </todo>
103 
105 {
106 public:
107 
108 //#! Please arrange class members in the sections laid out below. A
109 //#! possible exception (there may be others) -- some operator functions
110 //#! may perform the same task as "General Member Functions", and so you
111 //#! may wish to group them together.
112 
113 //#! Friends
114 
115 //#! Enumerations
116 
117 //#! Constructors
118  //Default constsructor
120 
121  //<group>
126  const casacore::Float& n);
129  const casacore::Quantum<casacore::Double>& positionAngle,
130  const casacore::Float& n);
131  // </group>
132 
133  // The copy constructor
135 
136  // The destructor
137  virtual ~LimbDarkenedDiskShape();
138 
139  //#! Operators
140  //The assignment operator
142 
143  //#! General Member Functions
144  // get the type of the shape (always returns ComponentType::LimbDakenedDisk)
145  virtual ComponentType::Shape type() const;
146 
147  // use diskshape ones?
148  //<group>
149  virtual void setWidthInRad(const casacore::Double majorAxis,
150  const casacore::Double minorAxis,
151  const casacore::Double positionAngle);
152  virtual casacore::Double majorAxisInRad() const;
153  virtual casacore::Double minorAxisInRad() const;
154  virtual casacore::Double positionAngleInRad() const;
155  virtual casacore::Float getAttnFactor() const;
156  //set n factor in darkening equation, \f$I=I_{0}(1-(\frac{r}{R})^{2})^{\frac{n}{2}}\f$
157  virtual void setAttnFactor(const casacore::Float attnFactor);
159  virtual void setOptParameters(const casacore::Vector<casacore::Double>& newOptParms);
160  //</group>
161 
162  // Calculate the proportion of the flux that is in a pixel of specified size
163  // centered in the specified direction. The returned value will always be
164  // between zero and one (inclusive).
165  virtual casacore::Double sample(const casacore::MDirection& direction,
166  const casacore::MVAngle& pixelLatSize,
167  const casacore::MVAngle& pixelLongSize) const;
168 
169 
170  // Same as the previous function except that many directions can be sampled
171  // at once. The reference frame and pixel size must be the same for all the
172  // specified directions.
173  virtual void sample(casacore::Vector<casacore::Double>& scale,
175  const casacore::MDirection::Ref& refFrame,
176  const casacore::MVAngle& pixelLatSize,
177  const casacore::MVAngle& pixelLongSize) const;
178 
179  // Return the Fourier transform of the component at the specified point in
180  // the spatial frequency domain. The point is specified by a 3 element vector
181  // (u,v,w) that has units of meters and the frequency of the observation, in
182  // Hertz. These two quantities can be used to derive the required spatial
183  // frequency <src>(s = uvw*freq/c)</src>. The w component is not used in
184  // these functions.
185 
186  // The reference position for the transform is the direction of the
187  // component. As this component is symmetric about this point the transform
188  // is always a real value.
190  const casacore::Double& frequency) const;
191 
192 
193  // Same as the previous function except that many (u,v,w) points can be
194  // sampled at once. The uvw casacore::Matrix must have a first dimension of three, and
195  // a second dimension that is the same as the length of the scale
196  // Vector. Otherwise and exception is thrown (when compiled in debug mode).
198  const casacore::Double& frequency) const;
199 
200  //same as above except with many frequencies
202  const casacore::Vector<casacore::Double>& frequency) const;
203 
204  // Return a pointer to a copy of this object upcast to a ComponentShape
205  // object. The class that uses this function is responsible for deleting the
206  // pointer. This is used to implement a virtual copy constructor.
207  virtual ComponentShape* clone() const;
208 
209  // casacore::Function which checks the internal data of this class for correct
210  // dimensionality and consistent values. Returns true if everything is fine
211  // otherwise returns false.
212  virtual casacore::Bool ok() const;
213 
214  // return a pointer to this object.
215  virtual const ComponentShape* getPtr() const;
216 
217  virtual casacore::String sizeToString() const;
218 
219 private:
221  const casacore::MDirection::MVType& dirVal,
222  const casacore::Double majRad, const casacore::Double minRad,
223  const casacore::Double pixValue) const;
224 
226  static void rotateVis(casacore::Double& u, casacore::Double& v,
227  const casacore::Double cpa, const casacore::Double spa);
228 
229  //# The parameters of the limb-darkened disk
230  // <group>
236  // </group>
237 };
238 
239 } //# NAMESPACE CASA - END
240 
241 #endif
A Measure: astronomical direction.
Definition: MDirection.h:174
LimbDarkenedDiskShape & operator=(const LimbDarkenedDiskShape &other)
The assignment operator.
casacore::Double calcVis(casacore::Double u, casacore::Double v, const casacore::Double factor) const
A limb-darkened disk model for the spatial distribution of emission.
std::vector< double > Vector
Definition: ds9context.h:24
Base class for component shapes with two sides.
virtual casacore::Double majorAxisInRad() const
virtual ComponentType::Shape type() const
get the type of the shape (always returns ComponentType::LimbDakenedDisk)
virtual ComponentShape * clone() const
Return a pointer to a copy of this object upcast to a ComponentShape object.
virtual void setOptParameters(const casacore::Vector< casacore::Double > &newOptParms)
Shape
The shapes of all the components.
virtual casacore::String sizeToString() const
Get the string containing the various size quantities of a component.
LimbDarkenedDiskShape()
Default constsructor.
virtual casacore::Double positionAngleInRad() const
virtual casacore::Float getAttnFactor() const
virtual ~LimbDarkenedDiskShape()
The destructor.
casacore::Quantum< casacore::Double > minorAxis() const
static void rotateVis(casacore::Double &u, casacore::Double &v, const casacore::Double cpa, const casacore::Double spa)
Base class for component shapes.
double Double
Definition: aipstype.h:55
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Double axialRatio() const
float Float
Definition: aipstype.h:54
virtual casacore::Double minorAxisInRad() const
virtual casacore::DComplex visibility(const casacore::Vector< casacore::Double > &uvw, const casacore::Double &frequency) const
Return the Fourier transform of the component at the specified point in the spatial frequency domain...
casacore::Double calcSample(const casacore::MDirection::MVType &compDirValue, const casacore::MDirection::MVType &dirVal, const casacore::Double majRad, const casacore::Double minRad, const casacore::Double pixValue) const
virtual void setAttnFactor(const casacore::Float attnFactor)
set n factor in darkening equation,
casacore::Quantum< casacore::Double > positionAngle() const
virtual void setWidthInRad(const casacore::Double majorAxis, const casacore::Double minorAxis, const casacore::Double positionAngle)
use diskshape ones?
virtual const ComponentShape * getPtr() const
return a pointer to this object.
virtual casacore::Vector< casacore::Double > optParameters() const
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual casacore::Double sample(const casacore::MDirection &direction, const casacore::MVAngle &pixelLatSize, const casacore::MVAngle &pixelLongSize) const
Calculate the proportion of the flux that is in a pixel of specified size centered in the specified d...
Vector of three direction cosines.
Definition: MVDirection.h:106
casacore::Quantum< casacore::Double > majorAxis() const
virtual casacore::Bool ok() const
casacore::Function which checks the internal data of this class for correct dimensionality and consis...
Class to handle angle type conversions and I/O.
Definition: MVAngle.h:245
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42