27 #ifndef IMAGES_IMAGEBEAMSET_H
28 #define IMAGES_IMAGEBEAMSET_H
30 #include <casacore/casa/aips.h>
31 #include <casacore/casa/Arrays/Matrix.h>
32 #include <casacore/scimath/Mathematics/GaussianBeam.h>
38 class SpectralCoordinate;
40 class CoordinateSystem;
140 {
return _beams.size() == 1; }
144 {
return _beams.size() > 1; }
148 {
return _beams.empty(); }
153 {
return _beams.shape(); }
158 {
return _beams.shape()[0]; }
163 {
return _beams.shape()[1]; }
175 {
return getBeam (chan, stokes); }
280 const Unit& majminUnit=
Unit(
"arcsec"),
const Unit& paUnit=
"deg"
304 const uInt chan,
const uInt chanWidth,
const uInt freqPrec,
305 const uInt velWidth,
const uInt velPrec
static const GaussianBeam NULL_BEAM
ImageBeamSet & operator=(const ImageBeamSet &other)
Assignment can change the shape (copy semantics).
Matrix< GaussianBeam > _beams
void summarize(LogIO &log, Bool verbose, const CoordinateSystem &csys) const
If verbose, log all beams, if not just summarize beam stats.
void rotate(const Quantity &angle, Bool unwrap=False)
Modify the beam set by rotating all beams counterclockwise through the specified angle.
Array< GaussianBeam >::const_iterator BeamIter
const IPosition & shape() const
Get the shape of the beam array.
uInt nstokes() const
Get the number of stokes in the beam array.
void setBeam(Int chan, Int stokes, const GaussianBeam &beam)
Get a beam at the given 2-dim IPosition.
const std::map< String, Quantum< Matrix< double > > > paramMatrices(const Unit &majminUnit=Unit("arcsec"), const Unit &paUnit="deg") const
get all the major axes, minor axes, and pas in quantum matrices.
IPosition getMinAreaBeamPosition() const
Get the position of the beam with the minimum area.
GaussianBeam getMedianAreaBeam() const
Get the beam in the set which has the median area.
const Quantum< Matrix< double > > getAreas() const
get all the beam areas in a single quantum matrix.
const GaussianBeam & getMaxAreaBeamForPol(IPosition &pos, uInt stokes) const
const GaussianBeam & getBeam() const
Get the single global beam.
Bool operator!=(const ImageBeamSet &other) const
void setBeams(const Matrix< GaussianBeam > &beams)
Set the beams in this beam set.
Bool equivalent(const ImageBeamSet &that) const
Beam sets are equivalent if both have no beams or if the expanded sets are equal.
ImageBeamSet(uInt nchan, uInt nstokes, const GaussianBeam &beam=GaussianBeam::NULL_BEAM)
Create an ImageBeamSet of the specified shape with all GaussianBeams initialized to beam.
Bool hasMultiBeam() const
Does this beam set contain multiple beams?
static void _beamToStream(ostream &os, const GaussianBeam &beam, const Unit &unit)
Show the beam info.
ImageBeamSet(const GaussianBeam &beam)
construct an ImageBeamSet representing a single beam which is valid for all channels and stokes
ImageBeamSet(const ImageBeamSet &other)
The copy constructor (reference semantics).
static void _chanInfoToStream(ostream &os, const SpectralCoordinate *spCoord, const uInt chan, const uInt chanWidth, const uInt freqPrec, const uInt velWidth, const uInt velPrec)
Show the spectral info.
ImageBeamSet subset(const Slicer &imageSlicer, const CoordinateSystem &csys) const
Return a subset of the beam array.
uInt nelements() const
Get the number of elements 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.
Bool operator==(const ImageBeamSet &other) const
Beam sets are equal if the shapes and all corresponding beams are equal.
GaussianBeam getMaxAreaBeam() const
Get the beam in the set which has the largest area.
static ImageBeamSet fromRecord(const Record &rec)
convert ImageBeamSet to and from record
Bool empty() const
Is the beam set empty?
const GaussianBeam & getBeam(Int chan, Int stokes) const
Get the beam at the specified location.
const GaussianBeam & getMedianAreaBeamForPol(IPosition &pos, uInt stokes) const
uInt nchan() const
Get the number of channels in the beam array.
ImageBeamSet(const Matrix< GaussianBeam > &beams)
Construct a beam set from an 2-D array of beams representing the frequency and stokes axis.
const GaussianBeam & operator()(Int chan, Int stokes) const
ImageBeamSet()
Construct an empty beam set.
const GaussianBeam & getMinAreaBeamForPol(IPosition &pos, uInt stokes) const
Get the minimal, maximal, and median area beams and positions in the beam set matrix for the given st...
Bool hasSingleBeam() const
static const String & className()
IPosition getMaxAreaBeamPosition() const
Get the position of the beam with the maximum area.
const Matrix< GaussianBeam > & getBeams() const
Get the beam array.
void _replaceBeam(const GaussianBeam &beam, const IPosition &location1, const IPosition &location2, Bool overwriteMaxMin)
common code for replacing a beam in a multi-beam set
const GaussianBeam getSmallestMinorAxisBeam() const
Get the beam that has the smallest minor axis.
void resize(uInt nchan, uInt nstokes)
Resize the beam array.
static const String _DEFAULT_AREA_UNIT
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
LatticeExprNode log(const LatticeExprNode &expr)
bool Bool
Define the standard types used by Casacore.
ostream & operator<<(ostream &os, const IComplex &)
Show on ostream.