ImageRegridderBase.h

Go to the documentation of this file.
00001 //# Copyright (C) 1998,1999,2000,2001,2003
00002 //# Associated Universities, Inc. Washington DC, USA.
00003 //#
00004 //# This program is free software; you can redistribute it and/or modify it
00005 //# under the terms of the GNU General Public License as published by the Free
00006 //# Software Foundation; either version 2 of the License, or (at your option)
00007 //# any later version.
00008 //#
00009 //# This program 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 General Public License for
00012 //# more details.
00013 //#
00014 //# You should have received a copy of the GNU General Public License along
00015 //# with this program; if not, write to the Free Software Foundation, Inc.,
00016 //# 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_IMAGEREGRIDDERBASE_H
00027 #define IMAGEANALYSIS_IMAGEREGRIDDERBASE_H
00028 
00029 #include <imageanalysis/ImageAnalysis/ImageTask.h>
00030 //#include <casa/Arrays/IPosition.h>
00031 #include <scimath/Mathematics/Interpolate2D.h>
00032 #include <casa/namespace.h>
00033 
00034 namespace casa {
00035 
00036 template <class T> class ImageRegridderBase : public ImageTask<T> {
00037         // <summary>
00038         // Data store of ImageRegridder and ComplexImageRegridder
00039         // </summary>
00040 
00041         // <reviewed reviewer="" date="" tests="" demos="">
00042         // </reviewed>
00043 
00044         // <prerequisite>
00045         // </prerequisite>
00046 
00047         // <etymology>
00048         // Data for image regridder.
00049         // </etymology>
00050 
00051         // <synopsis>
00052         // </synopsis>
00053 
00054         template<typename U> friend class ImageRegridderBase;
00055 
00056 public:
00057 
00058         ImageRegridderBase() = delete;
00059 
00060         // destructor
00061         virtual ~ImageRegridderBase();
00062 
00063         // regrid the spectral axis in velocity space rather than frequency space?
00064         void setSpecAsVelocity(Bool v) { _specAsVelocity = v; }
00065 
00066         // Set interpolation method.
00067         void setMethod(const String& method) { _method = Interpolate2D::stringToMethod(method); }
00068         void setMethod(Interpolate2D::Method method) { _method = method; }
00069 
00070         void setDoRefChange(Bool d) { _doRefChange = d; }
00071 
00072         void setReplicate(Bool r) { _replicate = r; }
00073 
00074         // throws exception if 3*decimate > length of an axis that will be regridded
00075         void setDecimate(Int d);
00076 
00077         void setForceRegrid(Bool f) { _forceRegrid = f; }
00078 
00079         void setShape(const IPosition s) { _shape = s; }
00080 
00081         virtual SPIIT regrid() const = 0;
00082 
00083         template <class U> void setConfiguration(const ImageRegridderBase<U>& that);
00084 
00085 protected:
00086 
00087         ImageRegridderBase(
00088                 const SPCIIT image, const Record *const regionRec,
00089                 const String& maskInp, const String& outname, Bool overwrite,
00090                 const CoordinateSystem& csys, const IPosition& axes,
00091                 const IPosition& shape
00092         );
00093 
00094         Interpolate2D::Method _getMethod() const { return _method; }
00095 
00096         Bool _getDoRefChange() const { return _doRefChange; }
00097 
00098         Bool _getReplicate() const { return _replicate; }
00099 
00100         Int _getDecimate() const { return _decimate;}
00101 
00102         Bool _getForceRegrid() const { return _forceRegrid; }
00103 
00104         inline CasacRegionManager::StokesControl _getStokesControl() const {
00105                 return CasacRegionManager::USE_ALL_STOKES;
00106         }
00107 
00108         inline vector<Coordinate::Type> _getNecessaryCoordinates() const {
00109                 return vector<Coordinate::Type>(0);
00110         }
00111 
00112         Bool _getSpecAsVelocity() const { return _specAsVelocity; }
00113 
00114         IPosition _getShape() const {return _shape;}
00115 
00116         const CoordinateSystem& _getTemplateCoords() const { return _csysTo; }
00117 
00118         IPosition _getAxes() const { return _axes; }
00119 
00120         IPosition _getKludgedShape() const { return _kludgedShape; }
00121 
00122         vector<String> _getOutputStokes() const { return _outputStokes; }
00123 
00124         uInt _getNReplicatedChans() const { return _nReplicatedChans; }
00125 
00126         Bool _regriddingDirectionAxes() const;
00127 
00128 private:
00129         const CoordinateSystem _csysTo;
00130         IPosition _axes, _shape, _kludgedShape;
00131         Bool _specAsVelocity, _doRefChange, _replicate, _forceRegrid;
00132         Int _decimate;
00133         Interpolate2D::Method _method;
00134         vector<String> _outputStokes;
00135         uInt _nReplicatedChans;
00136 
00137         void _finishConstruction();
00138 
00139 };
00140 }
00141 
00142 #ifndef AIPS_NO_TEMPLATE_SRC
00143 #include <imageanalysis/ImageAnalysis/ImageRegridderBase.tcc>
00144 #endif //# AIPS_NO_TEMPLATE_SRC
00145 
00146 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1