Loading...
Searching...
No Matches
GaussianBeam.h
Go to the documentation of this file.
//# Copyright (C) 1996,1997,1998,1999,2000,2001,2003
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: casa-feedback@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
#ifndef SCIMATH_GAUSSIANBEAM_H
#define SCIMATH_GAUSSIANBEAM_H
#include <casacore/casa/aips.h>
#include <casacore/casa/Quanta/Quantum.h>
namespace casacore {
// <summary>
// Represents a Gaussian restoring beam associated with an image.
// </summary>
// <use visibility=export>
// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
// </reviewed>
// <prerequisite>
// </prerequisite>
// <etymology>
// A Gaussian Beam.
// </etymology>
// <synopsis>
// This class represents a Gaussian restoring beam associated with
// a deconvolved image.
// </synopsis>
//
// <example>
// </example>
// <motivation>
// Restoring beams are used many places in image analysis tasks.
// </motivation>
// <todo>
// </todo>
class GaussianBeam {
public:
static const GaussianBeam NULL_BEAM;
// create a beam with all quantities zero (a null beam).
GaussianBeam();
// Construct a beam from a set of Quantities. If minor > major
// an exception is thrown. If any units are not angular, an
// exception is thrown
GaussianBeam(
const Quantity& major, const Quantity& minor,
const Quantity& pa
);
// Construct a beam from a 3-Vector of Quantities representing
// the major axis, the minor axis and the position angle (in that order).
// If parms[1] > parms[0] (minor axis > major axis),
// an exception is thrown. If any units are not angular, an
// exception is thrown
GaussianBeam(
const Vector<Quantity>& parms
);
GaussianBeam(const GaussianBeam& other);
~GaussianBeam();
GaussianBeam& operator=(const GaussianBeam& other);
Bool operator==(const GaussianBeam& other) const;
Bool operator!=(const GaussianBeam& other) const;
// returns the major axis in the same units as it had at construction
const Quantity& getMajor() const;
// returns the value portion of the major axis in the specified units
Double getMajor(const Unit& u) const;
// returns the minor axis in the same units as it had at construction
const Quantity& getMinor() const;
// returns the value portion of the minor axis in the specified units
Double getMinor(const Unit& u) const;
// returns the position angle's value as it was at construction,
// unless <src>unwrap</src> is True, in which case the value of the angle
// returned will be between -90 and 90 degrees (but with unit the same
// as it had when this object was constructed).
Quantity getPA(const Bool unwrap=True) const;
// returns the value portion of the position angle in the specified units
Double getPA(const Unit& u, const Bool unwrap=True) const;
// returns the beam area in the specified <src>unit</src>, which much conform to
// solid angle units.
Double getArea(const Unit& unit) const;
// is this object a null beam (ie is either its major and/or minor axis zero)?
Bool isNull() const;
// returns GassianBeam.
static const String& className();
Record toRecord() const;
void setMajorMinor(const Quantity& majAx, const Quantity& minAx);
// if unwrap=True, unwrap pa so its value lies in the range
// -90 to 90 degrees before setting it.
void setPA(const Quantity& pa, Bool unwrap=False);
static GaussianBeam fromRecord(const Record& rec);
// convert this object to a three-Vector of (major FWHM, minor FWHM, and pa).
// If <src>unwrap</src> is True, the returned pa will fall between -90 and +90
// degrees.
Vector<Quantity> toVector(const Bool unwrap=True) const;
// convert stored Quantities to the specified units
void convert(const String& majUnit, const String& minUnit,
const String& paUnit);
protected:
Quantity _major, _minor, _pa;
private:
static Quantity _unwrap(const Quantity& pa);
};
ostream &operator<<(ostream &os, const GaussianBeam& beam);
LogIO &operator<<(LogIO &os, const GaussianBeam& beam);
Bool near(const GaussianBeam& left, const GaussianBeam& other,
const Double relWidthTol, const Quantity& absPaTol);
} //# end namespace
#endif
casacore::GaussianBeam
Definition GaussianBeam.h:66
casacore::GaussianBeam::_minor
Quantity _minor
Definition GaussianBeam.h:153
casacore::GaussianBeam::getMajor
Double getMajor(const Unit &u) const
returns the value portion of the major axis in the specified units
casacore::GaussianBeam::operator!=
Bool operator!=(const GaussianBeam &other) const
casacore::GaussianBeam::convert
void convert(const String &majUnit, const String &minUnit, const String &paUnit)
convert stored Quantities to the specified units
casacore::GaussianBeam::className
static const String & className()
returns GassianBeam.
casacore::GaussianBeam::toRecord
Record toRecord() const
casacore::GaussianBeam::setMajorMinor
void setMajorMinor(const Quantity &majAx, const Quantity &minAx)
casacore::GaussianBeam::isNull
Bool isNull() const
is this object a null beam (ie is either its major and/or minor axis zero)?
casacore::GaussianBeam::GaussianBeam
GaussianBeam(const GaussianBeam &other)
casacore::GaussianBeam::getMinor
Double getMinor(const Unit &u) const
returns the value portion of the minor axis in the specified units
casacore::GaussianBeam::GaussianBeam
GaussianBeam(const Vector< Quantity > &parms)
Construct a beam from a 3-Vector of Quantities representing the major axis, the minor axis and the po...
casacore::GaussianBeam::fromRecord
static GaussianBeam fromRecord(const Record &rec)
casacore::GaussianBeam::getMajor
const Quantity & getMajor() const
returns the major axis in the same units as it had at construction
casacore::GaussianBeam::getPA
Quantity getPA(const Bool unwrap=True) const
returns the position angle's value as it was at construction, unless unwrap is True,...
casacore::GaussianBeam::GaussianBeam
GaussianBeam(const Quantity &major, const Quantity &minor, const Quantity &pa)
Construct a beam from a set of Quantities.
casacore::GaussianBeam::getArea
Double getArea(const Unit &unit) const
returns the beam area in the specified unit, which much conform to solid angle units.
casacore::GaussianBeam::~GaussianBeam
~GaussianBeam()
casacore::GaussianBeam::_unwrap
static Quantity _unwrap(const Quantity &pa)
casacore::GaussianBeam::getPA
Double getPA(const Unit &u, const Bool unwrap=True) const
returns the value portion of the position angle in the specified units
casacore::GaussianBeam::GaussianBeam
GaussianBeam()
create a beam with all quantities zero (a null beam).
casacore::GaussianBeam::toVector
Vector< Quantity > toVector(const Bool unwrap=True) const
convert this object to a three-Vector of (major FWHM, minor FWHM, and pa).
casacore::GaussianBeam::_pa
Quantity _pa
Definition GaussianBeam.h:153
casacore::GaussianBeam::getMinor
const Quantity & getMinor() const
returns the minor axis in the same units as it had at construction
casacore::GaussianBeam::setPA
void setPA(const Quantity &pa, Bool unwrap=False)
if unwrap=True, unwrap pa so its value lies in the range -90 to 90 degrees before setting it.
casacore::GaussianBeam::NULL_BEAM
static const GaussianBeam NULL_BEAM
Definition GaussianBeam.h:69
casacore::GaussianBeam::operator==
Bool operator==(const GaussianBeam &other) const
casacore::GaussianBeam::_major
Quantity _major
Definition GaussianBeam.h:153
casacore::GaussianBeam::operator=
GaussianBeam & operator=(const GaussianBeam &other)
casacore::LogIO
Definition LogIO.h:165
casacore::String
String: the storage and methods of handling collections of characters.
Definition String.h:223
casacore::Unit
Definition Unit.h:187
casacore::Vector
Definition Vector.h:82
casacore::Record
Record()
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28
casacore::pa
LatticeExprNode pa(const LatticeExprNode &left, const LatticeExprNode &right)
This function finds 180/pi*atan2(left,right)/2.
casacore::False
const Bool False
Definition aipstype.h:42
casacore::operator<<
ostream & operator<<(ostream &os, const IComplex &)
Show on ostream.
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
casacore::Quantity
Quantum< Double > Quantity
Definition Quantum.h:39
casacore::True
const Bool True
Definition aipstype.h:41
casacore::Double
double Double
Definition aipstype.h:53
casacore::near
Bool near(const GaussianBeam &left, const GaussianBeam &other, const Double relWidthTol, const Quantity &absPaTol)