Gaussian3DParam.h
Classes
- Gaussian3DParam -- Parameter handling for 3 dimensional Gaussian class (full description)
Interface
- Public Members
- Gaussian3DParam()
- Gaussian3DParam(Type height, const Vector<Type>& center, const Vector<Type>& width, Type theta, Type phi)
- Gaussian3DParam(Type &height, Type &xCenter, Type &yCenter, Type &zCenter, Type &xWidth, Type &yWidth, Type &zWidth, Type &theta, Type &phi)
- Gaussian3DParam(const Gaussian3DParam<Type> &other)
- template <class W> Gaussian3DParam(const Gaussian3DParam<W> &other) : Function<Type>(other), fwhm2int(Type(1.0)/sqrt(log(Type(16.0))))
- Gaussian3DParam<Type> &operator=(const Gaussian3DParam<Type> &other)
- virtual ~Gaussian3DParam()
- virtual const String &name() const
- virtual uInt ndim() const
- Type height() const
- void setHeight(const Type & height)
- Type flux() const
- void setFlux(const Type & flux)
- Vector<Type> center() const
- void setCenter(const Vector<Type>& center)
- Type xCenter() const
- void setXcenter(const Type & xcenter)
- Type yCenter() const
- void setYcenter(const Type & ycenter)
- Type zCenter() const
- void setZcenter(const Type & zcenter)
- Vector<Type> width() const
- void setWidth(const Vector<Type>& width)
- void setXwidth(const Type & xwidth)
- Type xWidth() const
- void setYwidth(const Type & ywidth)
- Type yWidth() const
- void setZwidth(const Type & zwidth)
- Type zWidth() const
- Type theta() const
- void settheta(const Type & sT)
- Type phi() const
- void setphi(const Type & sP)
- Protected Members
- void settrigvals() const
Review Status
- Programs:
- Tests:
Prerequisite
Etymology
A 3-dimensional Gaussian's parameters.
Synopsis
A Gaussian3D is described by a height, center, width,
and two position angles.
The width of the Gaussian is now specified in terms of the full width
at half maximum (FWHM), as with the 1D and 2D Gaussian functional classes.
The three axis values refer to the x, y, and z axes, and unlike with the
2D Gaussian any of the three axes may be the longest. Instead, the position
angles are restricted: The first position angle, theta, is the longitudinal
angle, referring to the rotation (counterclockwise) around the z-axis. The
second, phi, is the latidudinal angle, referring to the rotation around
the theta-rotated y axis. The domain of both angles is -pi/4 < A < pi/4.
(Note that the use of theta and phi corresponds to the mathematical
convention for these angles, not the physics convention.)
The parameter interface (see
FunctionParam class),
is used to provide an interface to the
Fitting classes.
There are 9 parameters that are used to describe the Gaussian:
- The height of the Gaussian. This is identical to the value
returned using the height member function.
- The center of the Gaussian in the x direction. This is identical to
the value returned using the xCenter member function.
- The center of the Gaussian in the y direction. This is identical to
the value returned using the yCenter member function.
- The center of the Gaussian in the z direction. This is identical to
the value returned using the zCenter member function.
- The width of the Gaussian along the x-axis.
- The width of the Gaussian along the y-axis.
- The width of the Gaussian along the z-axis.
- The longitudinal position angle, theta (in radians)
- The latitudinal position angle, phi (also in radians).
An enumeration for the H, CX,
CY,CZ, AX, AY,
AZ, THETA, PHI
parameter index is provided, enabling the setting
and reading of parameters with the [] operator. The
mask() methods can be used to check and set the parameter masks.
This class is in general used implicitly by the Gaussian3D
class only.
Other points to bear in mind when fitting this class to measured data
are:
- If you need to fit a circular Gaussian to data you should mask one or
both position angles. This avoids rank deficiency in the fitting
routines as the position angle is meaningless when the axes are
equal.
Example
Gaussian3D<Double> g(9.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.0);
Vector<Double> x(3);
x(0) = 1.0; x(1) = 0.5; x(2) = 0.0
cout << "g(" << x(0) << "," << x(1) << "," << x(2) << ")=" << g(x) << endl;
Template Type Argument Requirements (T)
- T should have standard numerical operators and exp() function. Current
implementation only tested for real types (and AutoDiff of them).
Thrown Exceptions
- Assertion in debug mode if attempt is made to set a negative width
- AipsError if incorrect parameter number specified.
- others?
To Do
- Gaussians that know about their DFT's could be required eventually.
Member Description
Gaussian3DParam()
Gaussian3DParam(Type height, const Vector<Type>& center, const Vector<Type>& width, Type theta, Type phi)
Gaussian3DParam(Type &height, Type &xCenter, Type &yCenter, Type &zCenter, Type &xWidth, Type &yWidth, Type &zWidth, Type &theta, Type &phi)
Constructs the three dimensional Gaussians. Defaults:
height = 1, center = {0,0,0}, width = {1,1,1}, theta = phi = 0
Gaussian3DParam(const Gaussian3DParam<Type> &other)
template <class W> Gaussian3DParam(const Gaussian3DParam<W> &other) : Function<Type>(other), fwhm2int(Type(1.0)/sqrt(log(Type(16.0))))
Copy construcor
Gaussian3DParam<Type> &operator=(const Gaussian3DParam<Type> &other)
Copy assignment
Destructor
virtual const String &name() const
Give name of function
virtual uInt ndim() const
Return dimensionality
Type height() const
void setHeight(const Type & height)
Get or set the peak height of the Gaussian
Type flux() const
void setFlux(const Type & flux)
Get or set the total flux of the Gaussian. (Note: Since this changes
the height of the Gaussian but not its width, always set the width
before setting the flux.)
Vector<Type> center() const
void setCenter(const Vector<Type>& center)
Type xCenter() const
void setXcenter(const Type & xcenter)
Type yCenter() const
void setYcenter(const Type & ycenter)
Type zCenter() const
void setZcenter(const Type & zcenter)
Get or cet the center coordinates of the Gaussian
Vector<Type> width() const
void setWidth(const Vector<Type>& width)
void setXwidth(const Type & xwidth)
Type xWidth() const
void setYwidth(const Type & ywidth)
Type yWidth() const
void setZwidth(const Type & zwidth)
Type zWidth() const
Get or set the sigma-width of the Gaussian
Type theta() const
void settheta(const Type & sT)
Type phi() const
void setphi(const Type & sP)
Get or set the rotation angles of the Gaussian.
Theta=logitude, phi=latitude