casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
casa::ImageBeamSet Class Reference

Represents a set of restoring beams associated with an image. More...

#include <ImageBeamSet.h>

List of all members.

Public Types

enum  AxisType {
  SPECTRAL,
  POLARIZATION
}

Public Member Functions

 ImageBeamSet ()
 Construct an empty beam set.
 ImageBeamSet (const Array< GaussianBeam > &beams, const Vector< AxisType > &axes)
 Construct a beam set from an array of beams with the representing the specified image axes.
 ImageBeamSet (const GaussianBeam &beam)
 construct an ImageBeamSet representing a single beam
 ImageBeamSet (const IPosition &shape, const Vector< AxisType > &axes)
 create an ImageBeamSet of the specified shape with all GaussianBeams initialized to null beams.
 ImageBeamSet (const GaussianBeam &beam, const IPosition &shape, const Vector< AxisType > &axes)
 create an ImageBeamSet of the specified shape with all GaussianBeams initialized to beam.
 ImageBeamSet (const ImageBeamSet &other)
 ~ImageBeamSet ()
ImageBeamSetoperator= (const ImageBeamSet &other)
const GaussianBeamoperator() (const IPosition &) const
Array< GaussianBeamoperator[] (uInt i) const
const Array< GaussianBeam > & operator() (const IPosition &start, const IPosition &end) const
Bool operator== (const ImageBeamSet &other) const
Bool operator!= (const ImageBeamSet &other) const
const Vector< AxisType > & getAxes () const
 get the axis types associated with the beam array.
const GaussianBeamgetBeam () const
 get the single global beam.
const GaussianBeamgetBeam (const IPosition &position, const Vector< AxisType > &axes=Vector< AxisType >(0)) const
 get the beam at the specified location
void setBeam (const GaussianBeam &beam, const IPosition &position)
 set the beam at a given location.
void setBeams (const IPosition &begin, const IPosition &end, const Array< GaussianBeam > &beams)
 set the beams from the specified beginning to specified ending positions.
Bool hasSingleBeam () const
 does this beam set contain only a single beam?
Bool hasMultiBeam () const
 does this beam set contain multiple beams?
size_t size () const
 return the size of the beam array.
void resize (const IPosition &pos)
 resize the beam array.
const Array< GaussianBeam > & getBeams () const
 get the beam array
void setBeams (const Array< GaussianBeam > &beams)
 set the beam array.
size_t nelements () const
 get the number of elements in the beam array
Bool empty () const
 is the beam array empty?
IPosition shape () const
 get the shape of the beam array
size_t ndim () const
 get the number of dimensions in the beam array
void set (const GaussianBeam &beam)
 set all beams to the same value
GaussianBeam getMinAreaBeam () const
 get the beam in the set which has the smallest area
GaussianBeam getMaxAreaBeam () const
 get the beam in the set which has the largest area
IPosition getMaxAreaBeamPosition () const
 get the position of the beam with the maximum area
IPosition getMinAreaBeamPosition () const
 get the position of the beam with the minimum area
GaussianBeam getMaxAreaBeamForPol (IPosition &pos, const Int polarization) const
 get maximal area beam and its position in the _beams array for the given polarization.
GaussianBeam getMinAreaBeamForPol (IPosition &pos, const Int polarization) const
 get minimal area beam and its position in the _beams array for the given polarization.
GaussianBeam getMedianAreaBeamForPol (IPosition &pos, const Int polarization) const
 get median area beam and its position in the _beams array for the given polarization.
Int getAxis (const AxisType type) const
 get the axis number for the specified type.
GaussianBeam getCommonBeam () const
 Get a beam to which all other beams in the set can be convolved.
Record toRecord (Bool exceptionIfNull) const
 convert to a record.

Static Public Member Functions

static const StringclassName ()
static ImageBeamSet fromRecord (const Record &rec, Bool exceptIfNull)
 if exceptIfNull, throw an exception if any beam in the record is null

Private Types

typedef std::map< AxisType, uIntAxesMap

Private Member Functions

IPosition _truePosition (const IPosition &position, const Vector< AxisType > &axes) const
void _checkAxisTypeSize (const Vector< AxisType > &axes) const
void _makeStokesMaps (const Bool beamsAreIdentical, const Int affectedStokes=-1)
uInt _nStokes () const
uInt _nChannels () const
void _calculateAreas ()
GaussianBeam _getBeamForPol (IPosition &pos, const vector< IPosition > &map, const Int polarization) const

Static Private Member Functions

static void _checkForDups (const Vector< AxisType > &axes)
static std::map< AxisType, uInt_setAxesMap (const Vector< AxisType > &axisTypes)
static void _transformEllipseByScaling (Double &transformedMajor, Double &transformedMinor, Double &transformedPa, Double major, Double minor, Double pa, Double xScaleFactor, Double yScaleFactor)

Private Attributes

Array< GaussianBeam_beams
Vector< AxisType_axes
Array< Double_areas
String _areaUnit
GaussianBeam _minBeam
GaussianBeam _maxBeam
IPosition _minBeamPos
IPosition _maxBeamPos
vector< IPosition_maxStokesMap
vector< IPosition_minStokesMap
vector< IPosition_medianStokesMap
AxesMap _axesMap

Static Private Attributes

static const String _DEFAULT_AREA_UNIT

Detailed Description

Represents a set of restoring beams associated with an image.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Etymology

A Set of Beams associated with an Image.

Synopsis

This class represents a set of restoring beams associated with a deconvolved image.

Example

Motivation

Restoring beams are used many places in image analysis tasks.

Definition at line 69 of file ImageBeamSet.h.


Member Typedef Documentation

typedef std::map<AxisType, uInt> casa::ImageBeamSet::AxesMap [private]

Definition at line 241 of file ImageBeamSet.h.


Member Enumeration Documentation

Enumerator:
SPECTRAL 
POLARIZATION 

Definition at line 72 of file ImageBeamSet.h.


Constructor & Destructor Documentation

Construct an empty beam set.

casa::ImageBeamSet::ImageBeamSet ( const Array< GaussianBeam > &  beams,
const Vector< AxisType > &  axes 
)

Construct a beam set from an array of beams with the representing the specified image axes.

The number of dimensions in the beams Array must match the number of elements in the axes Vector.

construct an ImageBeamSet representing a single beam

casa::ImageBeamSet::ImageBeamSet ( const IPosition shape,
const Vector< AxisType > &  axes 
)

create an ImageBeamSet of the specified shape with all GaussianBeams initialized to null beams.

casa::ImageBeamSet::ImageBeamSet ( const GaussianBeam beam,
const IPosition shape,
const Vector< AxisType > &  axes 
)

create an ImageBeamSet of the specified shape with all GaussianBeams initialized to beam.


Member Function Documentation

void casa::ImageBeamSet::_checkAxisTypeSize ( const Vector< AxisType > &  axes) const [private]
static void casa::ImageBeamSet::_checkForDups ( const Vector< AxisType > &  axes) [static, private]
GaussianBeam casa::ImageBeamSet::_getBeamForPol ( IPosition pos,
const vector< IPosition > &  map,
const Int  polarization 
) const [private]
void casa::ImageBeamSet::_makeStokesMaps ( const Bool  beamsAreIdentical,
const Int  affectedStokes = -1 
) [private]
uInt casa::ImageBeamSet::_nChannels ( ) const [private]
uInt casa::ImageBeamSet::_nStokes ( ) const [private]
static std::map<AxisType, uInt> casa::ImageBeamSet::_setAxesMap ( const Vector< AxisType > &  axisTypes) [static, private]
static void casa::ImageBeamSet::_transformEllipseByScaling ( Double transformedMajor,
Double transformedMinor,
Double transformedPa,
Double  major,
Double  minor,
Double  pa,
Double  xScaleFactor,
Double  yScaleFactor 
) [static, private]
IPosition casa::ImageBeamSet::_truePosition ( const IPosition position,
const Vector< AxisType > &  axes 
) const [private]
static const String& casa::ImageBeamSet::className ( ) [static]

is the beam array empty?

static ImageBeamSet casa::ImageBeamSet::fromRecord ( const Record rec,
Bool  exceptIfNull 
) [static]

if exceptIfNull, throw an exception if any beam in the record is null

get the axis types associated with the beam array.

Int casa::ImageBeamSet::getAxis ( const AxisType  type) const

get the axis number for the specified type.

Return -1 if there is no such axis

get the single global beam.

If there are multiple beams, an exception is thrown.

const GaussianBeam& casa::ImageBeamSet::getBeam ( const IPosition position,
const Vector< AxisType > &  axes = VectorAxisType >(0) 
) const

get the beam at the specified location

get the beam array

Get a beam to which all other beams in the set can be convolved.

If all other beams can be convolved to the maximum area beam in the set, that beam will be returned. If not, this is guaranteed to be the minimum area beam to which all beams in the set can be convolved if all but one of the beams in the set can be convolved to the beam in the set with the largest area. Otherwise, the returned beam may or may not be the smallest possible beam to which all the beams in the set can be convolved.

get the beam in the set which has the largest area

GaussianBeam casa::ImageBeamSet::getMaxAreaBeamForPol ( IPosition pos,
const Int  polarization 
) const

get maximal area beam and its position in the _beams array for the given polarization.

Use polarization=-1 if the image has no polarization axis to do stats over all the beams.

get the position of the beam with the maximum area

GaussianBeam casa::ImageBeamSet::getMedianAreaBeamForPol ( IPosition pos,
const Int  polarization 
) const

get median area beam and its position in the _beams array for the given polarization.

Use polarization=-1 if the image has no polarization axis to do stats over all the beams.

get the beam in the set which has the smallest area

GaussianBeam casa::ImageBeamSet::getMinAreaBeamForPol ( IPosition pos,
const Int  polarization 
) const

get minimal area beam and its position in the _beams array for the given polarization.

Use polarization=-1 if the image has no polarization axis to do stats over all the beams.

get the position of the beam with the minimum area

does this beam set contain multiple beams?

does this beam set contain only a single beam?

size_t casa::ImageBeamSet::ndim ( ) const

get the number of dimensions in the beam array

get the number of elements in the beam array

Bool casa::ImageBeamSet::operator!= ( const ImageBeamSet other) const
const GaussianBeam& casa::ImageBeamSet::operator() ( const IPosition ) const
const Array<GaussianBeam>& casa::ImageBeamSet::operator() ( const IPosition start,
const IPosition end 
) const
ImageBeamSet& casa::ImageBeamSet::operator= ( const ImageBeamSet other)
Bool casa::ImageBeamSet::operator== ( const ImageBeamSet other) const
Array<GaussianBeam> casa::ImageBeamSet::operator[] ( uInt  i) const
void casa::ImageBeamSet::resize ( const IPosition pos)

resize the beam array.

If pos has a different dimensionality than the current beam array, an exception is thrown.

void casa::ImageBeamSet::set ( const GaussianBeam beam)

set all beams to the same value

void casa::ImageBeamSet::setBeam ( const GaussianBeam beam,
const IPosition position 
)

set the beam at a given location.

Optionally, the axis types can be supplied so one can specify the position using a different axis ordering than the current object has. If specified, axes must have the same number of elements as the dimensionality of the current beam set and all axes of the current beam set must be elements.

void casa::ImageBeamSet::setBeams ( const IPosition begin,
const IPosition end,
const Array< GaussianBeam > &  beams 
)

set the beams from the specified beginning to specified ending positions.

void casa::ImageBeamSet::setBeams ( const Array< GaussianBeam > &  beams)

set the beam array.

get the shape of the beam array

size_t casa::ImageBeamSet::size ( ) const

return the size of the beam array.

Record casa::ImageBeamSet::toRecord ( Bool  exceptionIfNull) const

convert to a record.

If exceptionIfNull, an excption will be raised if any beam in the set is the null beam.


Member Data Documentation

Definition at line 246 of file ImageBeamSet.h.

Definition at line 247 of file ImageBeamSet.h.

Definition at line 245 of file ImageBeamSet.h.

Definition at line 252 of file ImageBeamSet.h.

Definition at line 244 of file ImageBeamSet.h.

Definition at line 242 of file ImageBeamSet.h.

Definition at line 248 of file ImageBeamSet.h.

Definition at line 249 of file ImageBeamSet.h.

Definition at line 250 of file ImageBeamSet.h.

Definition at line 250 of file ImageBeamSet.h.

Definition at line 248 of file ImageBeamSet.h.

Definition at line 249 of file ImageBeamSet.h.

Definition at line 250 of file ImageBeamSet.h.


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