casa
$Rev:20696$
|
This class represents a annotation referring to a region specified in an ascii region file as proposed in CAS-2285 <author>Dave Mehringer</author> More...
#include <AnnRegion.h>
Public Member Functions | |
virtual | ~AnnRegion () |
void | setAnnotationOnly (const Bool isAnnotationOnly) |
Bool | isAnnotationOnly () const |
is this region an annotation only? ie just for graphical rendering? | |
virtual TableRecord | asRecord () const |
virtual ImageRegion | asImageRegion () const |
virtual WCRegion * | getRegion () const |
virtual Bool | isRegion () const |
returns True unless overridden. | |
void | setDifference (const Bool difference) |
Bool | isDifference () const |
vector< Double > | getSpectralPixelRange () const |
get the pixel range included in the spectral selection. | |
Protected Member Functions | |
AnnRegion (const Type shape, const String &dirRefFrameString, const CoordinateSystem &csys, const IPosition &imShape, const Quantity &beginFreq, const Quantity &endFreq, const String &freqRefFrame, const String &dopplerString, const Quantity &restfreq, const Vector< Stokes::StokesTypes > stokes, const Bool annotationOnly) | |
only to be called by subclasses | |
AnnRegion (const Type shape, const CoordinateSystem &csys, const IPosition &imShape, const Vector< Stokes::StokesTypes > &stokes) | |
use if all coordinate values will be specified in the same frames as the input coordinate system. | |
AnnRegion (const AnnRegion &other) | |
implicitly defined copy constructor is fine AnnRegion(AnnRegion& other); | |
AnnRegion & | operator= (const AnnRegion &rhs) |
assignment operator | |
void | _extend () |
extend the direction plane region over spectral and/or polarization coordinates | |
void | _toRecord (const ImageRegion ®ion) |
Quantity | _lengthToAngle (const Quantity &quantity, const uInt pixelAxis) const |
convert a length in pixels to an angle. | |
virtual void | _printPrefix (ostream &os) const |
void | _setDirectionRegion (const ImageRegion ®ion) |
subclasses must call this at construction to set their base region defined in the direction plane | |
Bool | _setFrequencyLimits (const Quantity &beginFreq, const Quantity &endFreq, const String &freqRefFrame, const String &dopplerString, const Quantity &restfreq) |
if freqRefFrame=="" -> use the reference frame of the coordinate system if dopplerString=="" -> use the doppler system associated with the coordinate system if restfreq=Quantity(0, "Hz") -> use the rest frequency associated with the coordinate system Tacitly does nothing if the coordinate system has no spectral axis. | |
Private Member Functions | |
WCBox | _makeExtensionBox (const Vector< Quantity > &freqRange, const Vector< Stokes::StokesTypes > &stokesRange, const IPosition &pixelAxes) const |
void | _init () |
Private Attributes | |
Bool | _isAnnotationOnly |
Bool | _isDifference |
Bool | _constructing |
ImageRegion | _imageRegion |
ImageRegion | _directionRegion |
IPosition | _imShape |
vector< Double > | _spectralPixelRange |
Static Private Attributes | |
static const String | _class |
This class represents a annotation referring to a region specified in an ascii region file as proposed in CAS-2285 <author>Dave Mehringer</author>
Public interface
Holds the specification of an annotation containing a region as specified in ASCII format.
This class is meant to be a container for all parameters necessary to specify a region per the format proposal attached to CAS-2285 (https://bugs.nrao.edu/browse/CAS-2285).
Conversions of frequency from one reference frame to another are done here. The position of the reference pixel in the supplied coordinate system is used when converting frequencies.
Definition at line 53 of file AnnRegion.h.
virtual casa::AnnRegion::~AnnRegion | ( | ) | [virtual] |
casa::AnnRegion::AnnRegion | ( | const Type | shape, |
const String & | dirRefFrameString, | ||
const CoordinateSystem & | csys, | ||
const IPosition & | imShape, | ||
const Quantity & | beginFreq, | ||
const Quantity & | endFreq, | ||
const String & | freqRefFrame, | ||
const String & | dopplerString, | ||
const Quantity & | restfreq, | ||
const Vector< Stokes::StokesTypes > | stokes, | ||
const Bool | annotationOnly | ||
) | [protected] |
only to be called by subclasses
beginFreq and endFreq can both be 0, in which case all the spectral range is used if a spectral axis exists in csys</csys>. If one of <src>beginFreq
or endFreq
is given, the other must be given. Frequency units can either conform to Hz, m/s, or pix. If beginFreq
and endFreq
are not specifed or if they are specified in pixel units, freqRefFrame
, dopplerString
, and restfreq
are ignored. If provided, beginFreq
and endFreq
must conform to the same units.
casa::AnnRegion::AnnRegion | ( | const Type | shape, |
const CoordinateSystem & | csys, | ||
const IPosition & | imShape, | ||
const Vector< Stokes::StokesTypes > & | stokes | ||
) | [protected] |
use if all coordinate values will be specified in the same frames as the input coordinate system.
frequencies and the annotationOnly flag can be set after construction. By default, all frequencies and all polarizations are used, and the annotationOnly flag is False
casa::AnnRegion::AnnRegion | ( | const AnnRegion & | other | ) | [protected] |
implicitly defined copy constructor is fine AnnRegion(AnnRegion& other);
copy constructor
void casa::AnnRegion::_extend | ( | ) | [protected] |
extend the direction plane region over spectral and/or polarization coordinates
void casa::AnnRegion::_init | ( | ) | [private] |
Reimplemented from casa::AnnotationBase.
Reimplemented in casa::AnnCenterBox, casa::AnnAnnulus, casa::AnnPolygon, and casa::AnnPolyline.
Quantity casa::AnnRegion::_lengthToAngle | ( | const Quantity & | quantity, |
const uInt | pixelAxis | ||
) | const [protected] |
convert a length in pixels to an angle.
WCBox casa::AnnRegion::_makeExtensionBox | ( | const Vector< Quantity > & | freqRange, |
const Vector< Stokes::StokesTypes > & | stokesRange, | ||
const IPosition & | pixelAxes | ||
) | const [private] |
virtual void casa::AnnRegion::_printPrefix | ( | ostream & | os | ) | const [protected, virtual] |
void casa::AnnRegion::_setDirectionRegion | ( | const ImageRegion & | region | ) | [protected] |
subclasses must call this at construction to set their base region defined in the direction plane
Bool casa::AnnRegion::_setFrequencyLimits | ( | const Quantity & | beginFreq, |
const Quantity & | endFreq, | ||
const String & | freqRefFrame, | ||
const String & | dopplerString, | ||
const Quantity & | restfreq | ||
) | [protected, virtual] |
if freqRefFrame=="" -> use the reference frame of the coordinate system if dopplerString=="" -> use the doppler system associated with the coordinate system if restfreq=Quantity(0, "Hz") -> use the rest frequency associated with the coordinate system Tacitly does nothing if the coordinate system has no spectral axis.
Returns True if frequencies actually need to be set and were set.
Reimplemented from casa::AnnotationBase.
void casa::AnnRegion::_toRecord | ( | const ImageRegion & | region | ) | [protected] |
virtual ImageRegion casa::AnnRegion::asImageRegion | ( | ) | const [virtual] |
virtual TableRecord casa::AnnRegion::asRecord | ( | ) | const [virtual] |
virtual WCRegion* casa::AnnRegion::getRegion | ( | ) | const [virtual] |
vector<Double> casa::AnnRegion::getSpectralPixelRange | ( | ) | const |
get the pixel range included in the spectral selection.
If there is no spectral axis, a zero length vector is returned. Otherwise, a vector of two values is returned. The zeroth value will always be less than or equal to the first.
Bool casa::AnnRegion::isAnnotationOnly | ( | ) | const [virtual] |
is this region an annotation only? ie just for graphical rendering?
Reimplemented from casa::AnnotationBase.
Bool casa::AnnRegion::isDifference | ( | ) | const |
virtual Bool casa::AnnRegion::isRegion | ( | ) | const [virtual] |
returns True unless overridden.
Reimplemented from casa::AnnotationBase.
void casa::AnnRegion::setAnnotationOnly | ( | const Bool | isAnnotationOnly | ) |
void casa::AnnRegion::setDifference | ( | const Bool | difference | ) |
const String casa::AnnRegion::_class [static, private] |
Reimplemented from casa::AnnotationBase.
Definition at line 167 of file AnnRegion.h.
Bool casa::AnnRegion::_constructing [private] |
Definition at line 162 of file AnnRegion.h.
ImageRegion casa::AnnRegion::_directionRegion [private] |
Definition at line 163 of file AnnRegion.h.
ImageRegion casa::AnnRegion::_imageRegion [private] |
Definition at line 163 of file AnnRegion.h.
IPosition casa::AnnRegion::_imShape [private] |
Definition at line 164 of file AnnRegion.h.
Bool casa::AnnRegion::_isAnnotationOnly [private] |
Definition at line 161 of file AnnRegion.h.
Bool casa::AnnRegion::_isDifference [private] |
Definition at line 162 of file AnnRegion.h.
vector<Double> casa::AnnRegion::_spectralPixelRange [private] |
Definition at line 165 of file AnnRegion.h.