casa
$Rev:20696$
|
Represents a set of restoring beams associated with an image. More...
#include <ImageBeamSet.h>
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 () | |
ImageBeamSet & | operator= (const ImageBeamSet &other) |
const GaussianBeam & | operator() (const IPosition &) const |
Array< GaussianBeam > | operator[] (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 GaussianBeam & | getBeam () const |
get the single global beam. | |
const GaussianBeam & | getBeam (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 String & | className () |
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, uInt > | AxesMap |
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 |
Represents a set of restoring beams associated with an image.
Public interface
A Set of Beams associated with an Image.
This class represents a set of restoring beams associated with a deconvolved image.
Restoring beams are used many places in image analysis tasks.
Definition at line 69 of file ImageBeamSet.h.
typedef std::map<AxisType, uInt> casa::ImageBeamSet::AxesMap [private] |
Definition at line 241 of file ImageBeamSet.h.
Definition at line 72 of file ImageBeamSet.h.
Construct an empty beam set.
casa::ImageBeamSet::ImageBeamSet | ( | const Array< GaussianBeam > & | beams, |
const Vector< AxisType > & | axes | ||
) |
casa::ImageBeamSet::ImageBeamSet | ( | const GaussianBeam & | beam | ) |
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
.
casa::ImageBeamSet::ImageBeamSet | ( | const ImageBeamSet & | other | ) |
void casa::ImageBeamSet::_calculateAreas | ( | ) | [private] |
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] |
Bool casa::ImageBeamSet::empty | ( | ) | const |
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
const Vector<AxisType>& casa::ImageBeamSet::getAxes | ( | ) | const |
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
const GaussianBeam& casa::ImageBeamSet::getBeam | ( | ) | const |
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 = Vector< AxisType >(0) |
||
) | const |
get the beam at the specified location
const Array<GaussianBeam>& casa::ImageBeamSet::getBeams | ( | ) | const |
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
Bool casa::ImageBeamSet::hasMultiBeam | ( | ) | const |
does this beam set contain multiple beams?
Bool casa::ImageBeamSet::hasSingleBeam | ( | ) | const |
does this beam set contain only a single beam?
size_t casa::ImageBeamSet::ndim | ( | ) | const |
get the number of dimensions in the beam array
size_t casa::ImageBeamSet::nelements | ( | ) | const |
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.
IPosition casa::ImageBeamSet::shape | ( | ) | const |
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.
Array<Double> casa::ImageBeamSet::_areas [private] |
Definition at line 246 of file ImageBeamSet.h.
String casa::ImageBeamSet::_areaUnit [private] |
Definition at line 247 of file ImageBeamSet.h.
Vector<AxisType> casa::ImageBeamSet::_axes [private] |
Definition at line 245 of file ImageBeamSet.h.
AxesMap casa::ImageBeamSet::_axesMap [private] |
Definition at line 252 of file ImageBeamSet.h.
Array<GaussianBeam> casa::ImageBeamSet::_beams [private] |
Definition at line 244 of file ImageBeamSet.h.
const String casa::ImageBeamSet::_DEFAULT_AREA_UNIT [static, private] |
Definition at line 242 of file ImageBeamSet.h.
GaussianBeam casa::ImageBeamSet::_maxBeam [private] |
Definition at line 248 of file ImageBeamSet.h.
IPosition casa::ImageBeamSet::_maxBeamPos [private] |
Definition at line 249 of file ImageBeamSet.h.
vector<IPosition> casa::ImageBeamSet::_maxStokesMap [private] |
Definition at line 250 of file ImageBeamSet.h.
vector<IPosition> casa::ImageBeamSet::_medianStokesMap [private] |
Definition at line 250 of file ImageBeamSet.h.
GaussianBeam casa::ImageBeamSet::_minBeam [private] |
Definition at line 248 of file ImageBeamSet.h.
IPosition casa::ImageBeamSet::_minBeamPos [private] |
Definition at line 249 of file ImageBeamSet.h.
vector<IPosition> casa::ImageBeamSet::_minStokesMap [private] |
Definition at line 250 of file ImageBeamSet.h.