casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CFCell.h
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //# CFCell.h: Definition of the CFCell class
00003 //# Copyright (C) 1997,1998,1999,2000,2001,2002,2003
00004 //# Associated Universities, Inc. Washington DC, USA.
00005 //#
00006 //# This library is free software; you can redistribute it and/or modify it
00007 //# under the terms of the GNU Library General Public License as published by
00008 //# the Free Software Foundation; either version 2 of the License, or (at your
00009 //# option) any later version.
00010 //#
00011 //# This library is distributed in the hope that it will be useful, but WITHOUT
00012 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00013 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00014 //# License for more details.
00015 //#
00016 //# You should have received a copy of the GNU Library General Public License
00017 //# along with this library; if not, write to the Free Software Foundation,
00018 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00019 //#
00020 //# Correspondence concerning AIPS++ should be addressed as follows:
00021 //#        Internet email: aips2-request@nrao.edu.
00022 //#        Postal address: AIPS++ Project Office
00023 //#                        National Radio Astronomy Observatory
00024 //#                        520 Edgemont Road
00025 //#                        Charlottesville, VA 22903-2475 USA
00026 //#
00027 //# $Id$
00028 #ifndef SYNTHESIS_CFCELL_H
00029 #define SYNTHESIS_CFCELL_H
00030 #include <synthesis/TransformMachines/CFDefs.h>
00031 #include <synthesis/TransformMachines/SynthesisError.h>
00032 #include <coordinates/Coordinates/CoordinateSystem.h>
00033 #include <casa/Logging/LogIO.h>
00034 #include <casa/Logging/LogSink.h>
00035 #include <casa/Logging/LogOrigin.h>
00036 #include <casa/Utilities/CountedPtr.h>
00037 #include <images/Images/ImageInterface.h>
00038 #include <synthesis/MSVis/VisBuffer.h>
00039 //
00040 // <summary> 
00041 //
00042 // A light-weight container to carray all the information required for
00043 // a single convolution function plan.
00044 //
00045 //</summary>
00046 
00047 // <prerequisite>
00048 // </prerequisite>
00049 //
00050 // <etymology> 
00051 //
00052 //  CFCell is basic in-memory representation of a single
00053 //  monochromatic, single polarization cross-product and single
00054 //  w-plane convoluion function .
00055 //
00056 //</etymology>
00057 //
00058 // <synopsis> 
00059 //
00060 // Mostly a conveniance class to pass around related information.  
00061 //
00062 //</synopsis>
00063 //
00064 // <example>
00065 // </example>
00066 //
00067 // <motivation>
00068 //
00069 // To avoid parameter-bloat to passing around a number of related objects seperately.
00070 //
00071 // </motivation>
00072 //
00073 namespace casa { //# NAMESPACE CASA - BEGIN
00074   using namespace CFDefs;
00075   using namespace std;
00076   //  template <class T>
00077   typedef Complex TT;
00078   class CFCell
00079   {
00080   public:
00081     //
00082     //========================= Administrative Parts ==========================
00083     //------------------------------------------------------------------
00084     //
00085     CFCell():cfShape_p(){};
00086 
00087     CFCell(Array<TT> &dataPtr, CoordinateSystem& cs, Float& /*samp*/)
00088     {
00089       if (storage_p.null()) storage_p = new Array<TT>(dataPtr);
00090       coordSys_p = cs;
00091       cfShape_p.assign(storage_p->shape().asVector());
00092     };
00093 
00094     ~CFCell() {};
00095 
00096     CountedPtr<Array<TT> >& getStorage() {return storage_p;}
00097     void makePersistent(const char *dir);
00098     CountedPtr<CFCell> clone();
00099     void setParams(const CFCell& other);
00100     void initCache() {shape_p=storage_p->shape(); cfShape_p.assign(shape_p.asVector());};
00101     //
00102     //============================= Functional Parts ============================
00103     //------------------------------------------------------------------
00104     //
00105     void show(const char *Mesg,ostream &os);
00106 
00107     IPosition shape_p;
00108     CountedPtr<Array<TT> > storage_p; // Nx x Ny
00109     CoordinateSystem coordSys_p;
00110     Float sampling_p;
00111     Int xSupport_p,ySupport_p;
00112     Double wValue_p, freqValue_p,freqIncr_p;
00113     //    MuellerElementType muellerElement_p;
00114     Int muellerElement_p;
00115     Quantity pa_p;
00116     Vector<Int> cfShape_p;
00117   };
00118 } //# NAMESPACE CASA - END
00119 #endif