casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CFCell.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //# CFCell.h: Definition of the CFCell class
3 //# Copyright (C) 1997,1998,1999,2000,2001,2002,2003
4 //# Associated Universities, Inc. Washington DC, USA.
5 //#
6 //# This library is free software; you can redistribute it and/or modify it
7 //# under the terms of the GNU Library General Public License as published by
8 //# the Free Software Foundation; either version 2 of the License, or (at your
9 //# option) any later version.
10 //#
11 //# This library is distributed in the hope that it will be useful, but WITHOUT
12 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 //# License for more details.
15 //#
16 //# You should have received a copy of the GNU Library General Public License
17 //# along with this library; if not, write to the Free Software Foundation,
18 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19 //#
20 //# Correspondence concerning AIPS++ should be addressed as follows:
21 //# Internet email: aips2-request@nrao.edu.
22 //# Postal address: AIPS++ Project Office
23 //# National Radio Astronomy Observatory
24 //# 520 Edgemont Road
25 //# Charlottesville, VA 22903-2475 USA
26 //#
27 //# $Id$
28 #ifndef SYNTHESIS_CFCELL_H
29 #define SYNTHESIS_CFCELL_H
33 #include <casa/Logging/LogIO.h>
34 #include <casa/Logging/LogSink.h>
35 #include <casa/Logging/LogOrigin.h>
38 #include <msvis/MSVis/VisBuffer.h>
39 //
40 // <summary>
41 //
42 // A light-weight container to carray all the information required for
43 // a single convolution function plan.
44 //
45 //</summary>
46 
47 // <prerequisite>
48 // </prerequisite>
49 //
50 // <etymology>
51 //
52 // CFCell is basic in-memory representation of a single
53 // monochromatic, single polarization cross-product and single
54 // w-plane convoluion function .
55 //
56 //</etymology>
57 //
58 // <synopsis>
59 //
60 // Mostly a conveniance class to pass around related information.
61 //
62 //</synopsis>
63 //
64 // <example>
65 // </example>
66 //
67 // <motivation>
68 //
69 // To avoid parameter-bloat to passing around a number of related objects seperately.
70 //
71 // </motivation>
72 //
73 
74 namespace casa { //# NAMESPACE CASA - BEGIN
76 
77  struct CFCStruct{
87  };
88 
89  using namespace CFDefs;
90  using namespace std;
91  // template <class T>
92  class CFCell
93  {
94  void initCFCStruct(CFCStruct& cfcSt)
95  {
96  cfcSt.CFCStorage=NULL;
97  cfcSt.xSupport = cfcSt.ySupport=0;
98  cfcSt.sampling=0.0;
99  cfcSt.shape[0]=cfcSt.shape[1]=0;
100  }
101 
102  public:
103  //
104  //========================= Administrative Parts ==========================
105  //------------------------------------------------------------------
106  //
107  CFCell():cfShape_p(),isRotationallySymmetric_p(false){};
108 
110  isRotationallySymmetric_p(false)
111  {
112  if (storage_p.null()) storage_p = new casacore::Array<TT>(dataPtr);
113  coordSys_p = cs;
114  cfShape_p.assign(storage_p->shape().asVector());
115  };
116 
118  {
119  if (!storage_p.null())
120  {
121  //cerr << "############### " << "~CFCell() called " << storage_p->shape() << endl;
122  storage_p->resize();
123  }
124  };
125 
126  void getAsStruct(CFCStruct& cfst)
127  {
128  casacore::Bool dummy;
129  cfst.CFCStorage = getStorage()->getStorage(dummy);
130  cfst.coordSys = coordSys_p;
131  cfst.shape[0]=cfShape_p[0];
132  cfst.shape[1]=cfShape_p[1];
133  cfst.sampling=sampling_p;
134  cfst.xSupport=xSupport_p;
135  cfst.ySupport=ySupport_p;
136  cfst.wValue=wValue_p;
137  cfst.wIncr=wIncr_p;
138  cfst.freqValue=freqValue_p;
139  cfst.freqIncr=freqIncr_p;
140  cfst.muellerElement=muellerElement_p;
141  cfst.conjFreq = conjFreq_p;
142  cfst.conjPoln = conjPoln_p;
143  cfst.diameter=diameter_p;
144  cfst.fileName = fileName_p;
145  cfst.telescopeName=telescopeName_p;
146  cfst.bandName = bandName_p;
147  cfst.isRotationallySymmetric=isRotationallySymmetric_p;
148  }
150  void setStorage(casacore::Array<TT>& val) {getStorage()->assign(val); cfShape_p=val.shape().asVector();};
151  void clear();
152  void makePersistent(const char *dir, const char *cfName="");
154  void setParams(const CFCell& other);
155  void initCache(const casacore::Bool& releaseSpace=false) {shape_p=getShape(); cfShape_p.assign(shape_p.asVector());casacore::IPosition tt=shape_p;tt=0;tt[0]=tt[1]=0;if (releaseSpace) storage_p->resize(tt);};
156  casacore::IPosition getShape() {return storage_p->shape();}
157  //
158  //============================= casacore::Functional Parts ============================
159  //------------------------------------------------------------------
160  //
161  void show(const char *Mesg,ostream &os);
162 
167  casacore::Int xSupport_p,ySupport_p, conjPoln_p;
168  casacore::Double wValue_p, wIncr_p, freqValue_p,freqIncr_p, conjFreq_p;
169  // MuellerElementType muellerElement_p;
173  casacore::String fileName_p,telescopeName_p, bandName_p;
175  };
176 } //# NAMESPACE CASA - END
177 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
void setStorage(casacore::Array< TT > &val)
Definition: CFCell.h:150
int Int
Definition: aipstype.h:50
CFCell()
========================= Administrative Parts ==========================
Definition: CFCell.h:107
casacore::CoordinateSystem coordSys_p
Definition: CFCell.h:165
casacore::Float sampling_p
Definition: CFCell.h:166
casacore::Vector< casacore::Int > cfShape_p
Definition: CFCell.h:172
casacore::Int muellerElement
Definition: CFCell.h:84
casacore::String bandName
Definition: CFCell.h:85
casacore::Int conjPoln
Definition: CFCell.h:84
CFCell(casacore::Array< TT > &dataPtr, casacore::CoordinateSystem &cs, casacore::Float &)
Definition: CFCell.h:109
casacore::Int shape[2]
Definition: CFCell.h:80
bool isRotationallySymmetric
Definition: CFCell.h:86
casacore::Double conjFreq
Definition: CFCell.h:83
casacore::Double freqIncr
Definition: CFCell.h:83
casacore::Float sampling
Definition: CFCell.h:81
bool isRotationallySymmetric_p
Definition: CFCell.h:174
casacore::Quantity pa_p
Definition: CFCell.h:171
casacore::Int ySupport
Definition: CFCell.h:82
void show(const variant &v)
TT * CFCStorage
Definition: CFCell.h:79
void getAsStruct(CFCStruct &cfst)
Definition: CFCell.h:126
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
double Double
Definition: aipstype.h:55
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Double freqValue
Definition: CFCell.h:83
casacore::String telescopeName_p
Definition: CFCell.h:173
casacore::Bool clone(const casacore::String &imageName, const casacore::String &newImageName)
float Float
Definition: aipstype.h:54
casacore::CountedPtr< casacore::Array< TT > > storage_p
Definition: CFCell.h:164
void initCFCStruct(CFCStruct &cfcSt)
Definition: CFCell.h:94
casacore::Complex TT
template &lt;class t&gt;=&quot;&quot;&gt;
Definition: CFCell.h:75
casacore::String telescopeName
Definition: CFCell.h:85
casacore::Int ySupport_p
Definition: CFCell.h:167
void initCache(const casacore::Bool &releaseSpace=false)
Definition: CFCell.h:155
casacore::Float diameter
Definition: CFCell.h:81
casacore::Int xSupport
Definition: CFCell.h:82
casacore::Double wValue
Definition: CFCell.h:83
casacore::Double wIncr
Definition: CFCell.h:83
casacore::String fileName
Definition: CFCell.h:85
template &lt;class t&gt;=&quot;&quot;&gt;
Definition: CFCell.h:92
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void resize(uInt newSize, Bool copy=True)
Old values are copied on resize if copy==True.
casacore::IPosition getShape()
Definition: CFCell.h:156
casacore::CountedPtr< casacore::Array< TT > > & getStorage()
Definition: CFCell.h:149
casacore::Double wValue_p
Definition: CFCell.h:168
Vector< Int > asVector() const
casacore::IPosition shape_p
Definition: CFCell.h:163
Interconvert pixel and world coordinates.
casacore::Int muellerElement_p
MuellerElementType muellerElement_p;.
Definition: CFCell.h:170
const IPosition & shape() const
The length of each axis.
Definition: ArrayBase.h:121
casacore::CoordinateSystem coordSys
Definition: CFCell.h:78