casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
ImagePrimaryBeamCorrector.h
Go to the documentation of this file.
00001 //# tSubImage.cc: Test program for class SubImage
00002 //# Copyright (C) 1998,1999,2000,2001,2003
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This program is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU General Public License as published by the Free
00007 //# Software Foundation; either version 2 of the License, or (at your option)
00008 //# any later version.
00009 //#
00010 //# This program is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
00013 //# more details.
00014 //#
00015 //# You should have received a copy of the GNU General Public License along
00016 //# with this program; if not, write to the Free Software Foundation, Inc.,
00017 //# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id: tSubImage.cc 20567 2009-04-09 23:12:39Z gervandiepen $
00027 
00028 #ifndef IMAGEANALYSIS_IMAGEPRIMARYBEAMCORRECTOR_H
00029 #define IMAGEANALYSIS_IMAGEPRIMARYBEAMCORRECTOR_H
00030 
00031 #include <imageanalysis/ImageAnalysis/ImageTask.h>
00032 #include <memory>
00033 
00034 #include <casa/namespace.h>
00035 
00036 #include <memory>
00037 
00038 namespace casa {
00039 
00040 class ImagePrimaryBeamCorrector : public ImageTask {
00041         // <summary>
00042         // Top level interface for primary beam correction.
00043         // </summary>
00044 
00045         // <reviewed reviewer="" date="" tests="" demos="">
00046         // </reviewed>
00047 
00048         // <prerequisite>
00049         // </prerequisite>
00050 
00051         // <etymology>
00052         // Collapses image.
00053         // </etymology>
00054 
00055         // <synopsis>
00056         // High level interface for primary beam correction.
00057         // </synopsis>
00058 
00059         // <example>
00060         // <srcblock>
00061         // ImagePrimaryBeamCorrector corrector(...);
00062         // corrector.correct();
00063         // </srcblock>
00064         // </example>
00065 
00066 public:
00067 
00068         enum Mode {
00069                 MULTIPLY,
00070                 DIVIDE
00071         };
00072 
00073         // if <src>outname</src> is empty, no image will be written
00074         // if <src>overwrite</src> is True, if image already exists it will be removed
00075         // if <src>overwrite</src> is False, if image already exists exception will be thrown
00076         // Only one of <src>regionPtr</src> or <src>region<src> should be specified.
00077         // <group>
00078 
00079         ImagePrimaryBeamCorrector(
00080                 const ImageInterface<Float> * const &image,
00081                 const ImageInterface<Float> * const &pbImage,
00082                 const Record * const &regionPtr,
00083                 const String& region, const String& box,
00084                 const String& chanInp, const String& stokes,
00085                 const String& maskInp,
00086                 const String& outname, const Bool overwrite,
00087                 const Float cutoff, const Bool useCutoff, const Mode mode
00088         );
00089 
00090         ImagePrimaryBeamCorrector(
00091                 const ImageInterface<Float> * const &image,
00092                 const Array<Float>& pbArray,
00093                 const Record * const &regionPtr,
00094                 const String& region, const String& box,
00095                 const String& chanInp, const String& stokes,
00096                 const String& maskInp,
00097                 const String& outname, const Bool overwrite,
00098                 const Float cutoff, const Bool useCutoff, const Mode mode
00099         );
00100 
00101         // </group>
00102 
00103         // destructor
00104         ~ImagePrimaryBeamCorrector();
00105 
00106         // perform the correction. If <src>wantReturn</src> is True, return a pointer to the
00107         // collapsed image. The returned pointer is created via new(); it is the caller's
00108         // responsibility to delete the returned pointer. If <src>wantReturn</src> is False,
00109         // a NULL pointer is returned and pointer deletion is performed internally.
00110         ImageInterface<Float>* correct(const Bool wantReturn) const;
00111 
00112         String getClass() const;
00113 
00114 protected:
00115 
00116         vector<Coordinate::Type> _getNecessaryCoordinates() const;
00117 
00118         CasacRegionManager::StokesControl _getStokesControl() const;
00119 
00120 
00121 private:
00122         std::auto_ptr<ImageInterface<Float> > _pbImage;
00123 
00124         Float _cutoff;
00125         Mode _mode;
00126         Bool _useCutoff;
00127         const static String _class;
00128 
00129         ImagePrimaryBeamCorrector();
00130 
00131         void _checkPBSanity();
00132 };
00133 
00134 }
00135 
00136 #endif