00001 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2003 00002 //# Associated Universities, Inc. Washington DC, USA. 00003 //# 00004 //# This library is free software; you can redistribute it and/or modify it 00005 //# under the terms of the GNU Library General Public License as published by 00006 //# the Free Software Foundation; either version 2 of the License, or (at your 00007 //# option) any later version. 00008 //# 00009 //# This library is distributed in the hope that it will be useful, but WITHOUT 00010 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 //# License for more details. 00013 //# 00014 //# You should have received a copy of the GNU Library General Public License 00015 //# along with this library; if not, write to the Free Software Foundation, 00016 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00017 //# 00018 //# Correspondence concerning AIPS++ should be addressed as follows: 00019 //# Internet email: aips2-request@nrao.edu. 00020 //# Postal address: AIPS++ Project Office 00021 //# National Radio Astronomy Observatory 00022 //# 520 Edgemont Road 00023 //# Charlottesville, VA 22903-2475 USA 00024 //# 00025 00026 #ifndef IMAGEANALYSIS_CASACasaImageBeamSet 00027 #define IMAGEANALYSIS_CASACasaImageBeamSet 00028 00029 #include <images/Images/ImageBeamSet.h> 00030 00031 namespace casa { 00032 00033 // <summary> 00034 // Represents a set of restoring beams associated with an image. Implements getCommonBeam() 00035 // </summary> 00036 00037 // <use visibility=export> 00038 00039 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos=""> 00040 // </reviewed> 00041 00042 // <prerequisite> 00043 // </prerequisite> 00044 00045 // <etymology> 00046 // A Set of Beams associated with an Image. 00047 // </etymology> 00048 00049 // <synopsis> 00050 // </synopsis> 00051 // 00052 // <example> 00053 00054 // </example> 00055 00056 00057 // <motivation> 00058 // Restoring beams are used many places in image analysis tasks. 00059 // </motivation> 00060 00061 // <todo> 00062 // </todo> 00063 00064 class CasaImageBeamSet : public ImageBeamSet { 00065 public: 00066 00067 // Construct an empty beam set. 00068 CasaImageBeamSet(); 00069 00070 // Construct a beam set from an 2-D array of beams representing 00071 // the frequency and stokes axis. 00072 // Axis length 1 means it is valid for all channels cq. stokes. 00073 // If the image has 0 spectral channels or stokes, the corresponding 00074 // length of the axis in the provided matrix should be 1. 00075 CasaImageBeamSet( 00076 const Matrix<GaussianBeam>& beams 00077 ); 00078 00079 // construct an CasaImageBeamSet representing a single beam which is valid for 00080 // all channels and stokes 00081 CasaImageBeamSet(const GaussianBeam& beam); 00082 00083 // Create an CasaImageBeamSet of the specified shape with all 00084 // GaussianBeams initialized to <src>beam</src>. 00085 CasaImageBeamSet(uInt nchan, uInt nstokes, const GaussianBeam& beam=GaussianBeam::NULL_BEAM); 00086 00087 // The copy constructor (reference semantics). 00088 CasaImageBeamSet(const CasaImageBeamSet& other); 00089 CasaImageBeamSet(const ImageBeamSet& other); 00090 00091 ~CasaImageBeamSet(); 00092 00093 // Assignment can change the shape (copy semantics). 00094 CasaImageBeamSet& operator=(const CasaImageBeamSet& other); 00095 00096 static const String& className(); 00097 00098 // Get a beam to which all other beams in the set can be convolved. 00099 // If all other beams can be convolved to the maximum area beam in the set, that beam will be returned. 00100 // If not, this is guaranteed to be the minimum area beam to which 00101 // 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 00102 // largest area. Otherwise, the returned beam may or may not be the smallest possible beam to which all the beams in the set 00103 // can be convolved. 00104 GaussianBeam getCommonBeam() const; 00105 00106 private: 00107 00108 static void _transformEllipseByScaling( 00109 Double& transformedMajor, Double& transformedMinor, 00110 Double& transformedPa, Double major, Double minor, 00111 Double pa, Double xScaleFactor, Double yScaleFactor 00112 ); 00113 }; 00114 00115 ostream &operator<<(ostream &os, const CasaImageBeamSet& beamSet); 00116 00117 } 00118 00119 #endif 00120