Loading...
Searching...
No Matches
casacore::Gaussian3DParam< Type > Class Template Reference
Functionals_module_internal_classes

More...

`#include <Gaussian3DParam.h>`

## Public Types

enum | { H , CX , CY , CZ , AX , AY , AZ , THETA , PHI , NPAR }
| Parameter handling for the functional for 3D Gaussian Class. More...
Public Types inherited from casacore::Function< Type >
typedef FunctionTraits< Type >::ArgType | ArgType
typedef const ArgType * | FunctionArg

## Public Member Functions

| Gaussian3DParam ()
| Constructs the three dimensional Gaussians.
| 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)
| Copy construcor.
template<class W>
| Gaussian3DParam (const Gaussian3DParam< W > &other)
Gaussian3DParam< Type > & | operator= (const Gaussian3DParam< Type > &other)
| Copy assignment.
virtual | ~Gaussian3DParam ()
| Destructor.
virtual const String & | name () const
| Give name of function.
virtual uInt | ndim () const
| Return dimensionality.
Type | height () const
| Get or set the peak height of the Gaussian.
void | setHeight (const Type &height)
Type | flux () const
| Get or set the total flux of the Gaussian.
void | setFlux (const Type &flux)
Vector< Type > | center () const
| Get or cet the center coordinates of the Gaussian.
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
| Get or set the sigma-width of the Gaussian.
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
| Get or set the rotation angles of the Gaussian.
void | settheta (const Type &sT)
Type | phi () const
void | setphi (const Type &sP)
Public Member Functions inherited from casacore::Function< Type >
| Function ()
| Constructors.
virtual | ~Function ()
| Destructor.
uInt | nparameters () const
| Returns the number of parameters.
virtual Type | eval (FunctionArg x) const=0
| Evaluate the function object.
Type & | operator[] (const uInt n)
| Manipulate the nth parameter (0-based) with no index check.
virtual Type | operator() () const
| Evaluate this function object at xor at x, y.
Bool & | mask (const uInt n)
| Manipulate the mask associated with the nth parameter (e.g.
const FunctionParam< Type > & | parameters () const
| Return the parameter interface.
const Vector< ArgType > & | argp () const
| Get arg_p and parset_p.
Bool | parsetp () const
void | lockParam ()
| Compiler cannot always find the correct 'const' version of parameter access.
void | unlockParam ()
virtual void | setMode (const RecordInterface &mode)
| get/set the function mode.
virtual void | getMode (RecordInterface &mode) const
virtual Bool | hasMode () const
| return True if the implementing function supports a mode.
ostream & | print (ostream &os) const
| Print the function (i.e.
virtual Function< Type, Type > * | clone () const=0
| Return a copy of this object from the heap.
virtual Function< typename FunctionTraits< Type >::DiffType > * | cloneAD () const
virtual Function< typename FunctionTraits< Type >::BaseType > * | cloneNonAD () const
Public Member Functions inherited from casacore::Functional< FunctionTraits< Type >::ArgType, Type >
virtual | ~Functional ()
| Destructor.
virtual Type | operator() (const FunctionTraits< Type >::ArgType &x) const=0
| Map a Domain x into a Range y value.
Public Member Functions inherited from casacore::Functional< Vector< FunctionTraits< Type >::ArgType >, Type >
virtual | ~Functional ()
| Destructor.
virtual Type | operator() (const Vector< FunctionTraits< Type >::ArgType > &x) const=0
| Map a Domain x into a Range y value.

## Protected Member Functions

void | settrigvals () const

## Protected Attributes

Type | fwhm2int
Type | stoT_p
Type | stoP_p
Type | cosT_p
Type | sinT_p
Type | cosP_p
Type | sinP_p
Type | cosTcosP_p
Type | cosTsinP_p
Type | sinTcosP_p
Type | sinTsinP_p
Protected Attributes inherited from casacore::Function< Type >
FunctionParam< Type > | param_p
| The parameters and masks.
Vector< ArgType > | arg_p
| Aid for non-contiguous argument storage.
Bool | parset_p
| Indicate parameter written.
Bool | locked_p
| Indicate that parameters are expected to be locked from changing.

## Detailed Description

template<class Type>
class casacore::Gaussian3DParam< Type >

Parameter handling for 3 dimensional Gaussian class

### Intended use:

Internal

### Review Status

Test programs:
  tGaussian3DParam

### Prerequisite

- FunctionParam class
- Function class

### 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:

1. The height of the Gaussian. This is identical to the value returned using the height member function.
2. The center of the Gaussian in the x direction. This is identical to the value returned using the xCenter member function.
3. The center of the Gaussian in the y direction. This is identical to the value returned using the yCenter member function.
4. The center of the Gaussian in the z direction. This is identical to the value returned using the zCenter member function.
5. The width of the Gaussian along the x-axis.
6. The width of the Gaussian along the y-axis.
7. The width of the Gaussian along the z-axis.
8. The longitudinal position angle, theta (in radians)
9. 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.

Tip: 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;
casacore::Gaussian3D
Definition Gaussian3D.h:142
casacore::Vector
Definition Vector.h:82

### 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.

Definition at line 144 of file Gaussian3DParam.h.

## Member Enumeration Documentation

## anonymous enum

template<class Type>

anonymous enum

Parameter handling for the functional for 3D Gaussian Class.

Similar to Gaussian2DParam, but width parameters are not adjusted for FWHM; they are identical to the parameters used in the function.

Position angle parameters are restricted to -PI/4 < angle < PI/4.

Enumerator
H |
CX |
CY |
CZ |
AX |
AY |
AZ |
THETA |
PHI |
NPAR |

Definition at line 155 of file Gaussian3DParam.h.

## Constructor & Destructor Documentation

## Gaussian3DParam() [1/5]

template<class Type>

casacore::Gaussian3DParam< Type >::Gaussian3DParam | ( |  | ) |

Constructs the three dimensional Gaussians.

Defaults: height = 1, center = {0,0,0}, width = {1,1,1}, theta = phi = 0

Referenced by Gaussian3DParam(), Gaussian3DParam(), and operator=().

## Gaussian3DParam() [2/5]

template<class Type>

casacore::Gaussian3DParam< Type >::Gaussian3DParam | ( | Type | height,
|  | const Vector< Type > & | center,
|  | const Vector< Type > & | width,
|  | Type | theta,
|  | Type | phi )

References center(), height(), phi(), theta(), and width().

## Gaussian3DParam() [3/5]

template<class Type>

casacore::Gaussian3DParam< Type >::Gaussian3DParam | ( | Type & | height,
|  | Type & | xCenter,
|  | Type & | yCenter,
|  | Type & | zCenter,
|  | Type & | xWidth,
|  | Type & | yWidth,
|  | Type & | zWidth,
|  | Type & | theta,
|  | Type & | phi )

References height(), phi(), theta(), xCenter(), xWidth(), yCenter(), yWidth(), zCenter(), and zWidth().

## Gaussian3DParam() [4/5]

template<class Type>

casacore::Gaussian3DParam< Type >::Gaussian3DParam | ( | const Gaussian3DParam< Type > & | other | ) |

Copy construcor.

References Gaussian3DParam().

## Gaussian3DParam() [5/5]

template<class Type>
template<class W>

casacore::Gaussian3DParam< Type >::Gaussian3DParam | ( | const Gaussian3DParam< W > & | other | ) |

inline

Definition at line 184 of file Gaussian3DParam.h.

References casacore::Function< Type >::Function(), fwhm2int, Gaussian3DParam(), casacore::log(), settrigvals(), and casacore::sqrt().

## ~Gaussian3DParam()

template<class Type>

virtual casacore::Gaussian3DParam< Type >::~Gaussian3DParam | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## center()

template<class Type>

Vector< Type > casacore::Gaussian3DParam< Type >::center | ( |  | ) | const

Get or cet the center coordinates of the Gaussian.

Referenced by Gaussian3DParam(), and setCenter().

## flux()

template<class Type>

Type casacore::Gaussian3DParam< Type >::flux | ( |  | ) | const

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.)

Referenced by setFlux().

## height()

template<class Type>

Type casacore::Gaussian3DParam< Type >::height | ( |  | ) | const

Get or set the peak height of the Gaussian.

Referenced by Gaussian3DParam(), Gaussian3DParam(), and setHeight().

## name()

template<class Type>

virtual const String & casacore::Gaussian3DParam< Type >::name | ( |  | ) | const

inline virtual

Give name of function.

Reimplemented from casacore::Function< Type >.

Definition at line 197 of file Gaussian3DParam.h.

## ndim()

template<class Type>

virtual uInt casacore::Gaussian3DParam< Type >::ndim | ( |  | ) | const

inline virtual

Return dimensionality.

Implements casacore::Function< Type >.

Definition at line 201 of file Gaussian3DParam.h.

## operator=()

template<class Type>

Gaussian3DParam< Type > & casacore::Gaussian3DParam< Type >::operator= | ( | const Gaussian3DParam< Type > & | other | ) |

Copy assignment.

References Gaussian3DParam().

## phi()

template<class Type>

Type casacore::Gaussian3DParam< Type >::phi | ( |  | ) | const

Referenced by Gaussian3DParam(), and Gaussian3DParam().

## setCenter()

template<class Type>

void casacore::Gaussian3DParam< Type >::setCenter | ( | const Vector< Type > & | center | ) |

References center().

## setFlux()

template<class Type>

void casacore::Gaussian3DParam< Type >::setFlux | ( | const Type & | flux | ) |

References flux().

## setHeight()

template<class Type>

void casacore::Gaussian3DParam< Type >::setHeight | ( | const Type & | height | ) |

References height().

## setphi()

template<class Type>

void casacore::Gaussian3DParam< Type >::setphi | ( | const Type & | sP | ) |

## settheta()

template<class Type>

void casacore::Gaussian3DParam< Type >::settheta | ( | const Type & | sT | ) |

## settrigvals()

template<class Type>

void casacore::Gaussian3DParam< Type >::settrigvals | ( |  | ) | const

protected

Referenced by Gaussian3DParam().

## setWidth()

template<class Type>

void casacore::Gaussian3DParam< Type >::setWidth | ( | const Vector< Type > & | width | ) |

References width().

## setXcenter()

template<class Type>

void casacore::Gaussian3DParam< Type >::setXcenter | ( | const Type & | xcenter | ) |

## setXwidth()

template<class Type>

void casacore::Gaussian3DParam< Type >::setXwidth | ( | const Type & | xwidth | ) |

## setYcenter()

template<class Type>

void casacore::Gaussian3DParam< Type >::setYcenter | ( | const Type & | ycenter | ) |

## setYwidth()

template<class Type>

void casacore::Gaussian3DParam< Type >::setYwidth | ( | const Type & | ywidth | ) |

## setZcenter()

template<class Type>

void casacore::Gaussian3DParam< Type >::setZcenter | ( | const Type & | zcenter | ) |

## setZwidth()

template<class Type>

void casacore::Gaussian3DParam< Type >::setZwidth | ( | const Type & | zwidth | ) |

## theta()

template<class Type>

Type casacore::Gaussian3DParam< Type >::theta | ( |  | ) | const

Get or set the rotation angles of the Gaussian.

Theta=logitude, phi=latitude

Referenced by Gaussian3DParam(), and Gaussian3DParam().

## width()

template<class Type>

Vector< Type > casacore::Gaussian3DParam< Type >::width | ( |  | ) | const

Get or set the sigma-width of the Gaussian.

Referenced by Gaussian3DParam(), and setWidth().

## xCenter()

template<class Type>

Type casacore::Gaussian3DParam< Type >::xCenter | ( |  | ) | const

Referenced by Gaussian3DParam().

## xWidth()

template<class Type>

Type casacore::Gaussian3DParam< Type >::xWidth | ( |  | ) | const

Referenced by Gaussian3DParam().

## yCenter()

template<class Type>

Type casacore::Gaussian3DParam< Type >::yCenter | ( |  | ) | const

Referenced by Gaussian3DParam().

## yWidth()

template<class Type>

Type casacore::Gaussian3DParam< Type >::yWidth | ( |  | ) | const

Referenced by Gaussian3DParam().

## zCenter()

template<class Type>

Type casacore::Gaussian3DParam< Type >::zCenter | ( |  | ) | const

Referenced by Gaussian3DParam().

## zWidth()

template<class Type>

Type casacore::Gaussian3DParam< Type >::zWidth | ( |  | ) | const

Referenced by Gaussian3DParam().

## Member Data Documentation

## cosP_p

template<class Type>

Type casacore::Gaussian3DParam< Type >::cosP_p

mutable protected

Definition at line 259 of file Gaussian3DParam.h.

## cosT_p

template<class Type>

Type casacore::Gaussian3DParam< Type >::cosT_p

mutable protected

Definition at line 258 of file Gaussian3DParam.h.

## cosTcosP_p

template<class Type>

Type casacore::Gaussian3DParam< Type >::cosTcosP_p

mutable protected

Definition at line 260 of file Gaussian3DParam.h.

## cosTsinP_p

template<class Type>

Type casacore::Gaussian3DParam< Type >::cosTsinP_p

mutable protected

Definition at line 261 of file Gaussian3DParam.h.

## fwhm2int

template<class Type>

Type casacore::Gaussian3DParam< Type >::fwhm2int

protected

Definition at line 254 of file Gaussian3DParam.h.

Referenced by Gaussian3DParam().

## sinP_p

template<class Type>

Type casacore::Gaussian3DParam< Type >::sinP_p

protected

Definition at line 259 of file Gaussian3DParam.h.

## sinT_p

template<class Type>

Type casacore::Gaussian3DParam< Type >::sinT_p

protected

Definition at line 258 of file Gaussian3DParam.h.

## sinTcosP_p

template<class Type>

Type casacore::Gaussian3DParam< Type >::sinTcosP_p

mutable protected

Definition at line 262 of file Gaussian3DParam.h.

## sinTsinP_p

template<class Type>

Type casacore::Gaussian3DParam< Type >::sinTsinP_p

mutable protected

Definition at line 263 of file Gaussian3DParam.h.

## stoP_p

template<class Type>

Type casacore::Gaussian3DParam< Type >::stoP_p

mutable protected

Definition at line 257 of file Gaussian3DParam.h.

## stoT_p

template<class Type>

Type casacore::Gaussian3DParam< Type >::stoT_p

mutable protected

Definition at line 256 of file Gaussian3DParam.h.

The documentation for this class was generated from the following file:

- scimath/Functionals/Gaussian3DParam.h