CFCell.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
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 <msvis/MSVis/VisBuffer.h>
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074 namespace casa {
00075 typedef Complex TT;
00076
00077 struct CFCStruct{
00078 CoordinateSystem coordSys;
00079 TT * CFCStorage;
00080 Int shape[2];
00081 Float sampling,diameter;
00082 Int xSupport, ySupport;
00083 Double wValue, wIncr, freqValue,freqIncr, conjFreq;
00084 Int muellerElement, conjPoln;
00085 String fileName, telescopeName;
00086 };
00087
00088 using namespace CFDefs;
00089 using namespace std;
00090
00091 class CFCell
00092 {
00093 void initCFCStruct(CFCStruct& cfcSt)
00094 {
00095 cfcSt.CFCStorage=NULL;
00096 cfcSt.xSupport = cfcSt.ySupport=0;
00097 cfcSt.sampling=0.0;
00098 cfcSt.shape[0]=cfcSt.shape[1]=0;
00099 }
00100
00101 public:
00102
00103
00104
00105
00106 CFCell():cfShape_p(){};
00107
00108 CFCell(Array<TT> &dataPtr, CoordinateSystem& cs, Float& )
00109 {
00110 if (storage_p.null()) storage_p = new Array<TT>(dataPtr);
00111 coordSys_p = cs;
00112 cfShape_p.assign(storage_p->shape().asVector());
00113 };
00114
00115 ~CFCell()
00116 {
00117 if (!storage_p.null())
00118 {
00119
00120 storage_p->resize();
00121 }
00122 };
00123
00124 void getAsStruct(CFCStruct& cfst)
00125 {
00126 Bool dummy;
00127 cfst.CFCStorage = getStorage()->getStorage(dummy);
00128 cfst.coordSys = coordSys_p;
00129 cfst.shape[0]=cfShape_p[0];
00130 cfst.shape[1]=cfShape_p[1];
00131 cfst.sampling=sampling_p;
00132 cfst.xSupport=xSupport_p;
00133 cfst.ySupport=ySupport_p;
00134 cfst.wValue=wValue_p;
00135 cfst.wIncr=wIncr_p;
00136 cfst.freqValue=freqValue_p;
00137 cfst.freqIncr=freqIncr_p;
00138 cfst.muellerElement=muellerElement_p;
00139 cfst.conjFreq = conjFreq_p;
00140 cfst.conjPoln = conjPoln_p;
00141 cfst.diameter=diameter_p;
00142 cfst.fileName = fileName_p;
00143 cfst.telescopeName=telescopeName_p;
00144 }
00145 CountedPtr<Array<TT> >& getStorage() {return storage_p;}
00146 void makePersistent(const char *dir, const char *cfName="");
00147 CountedPtr<CFCell> clone();
00148 void setParams(const CFCell& other);
00149 void initCache(const Bool& releaseSpace=False) {shape_p=getShape(); cfShape_p.assign(shape_p.asVector());IPosition tt=shape_p;tt=0;tt[0]=tt[1]=0;if (releaseSpace) storage_p->resize(tt);};
00150 IPosition getShape() {return storage_p->shape();}
00151
00152
00153
00154
00155 void show(const char *Mesg,ostream &os);
00156
00157 IPosition shape_p;
00158 CountedPtr<Array<TT> > storage_p;
00159 CoordinateSystem coordSys_p;
00160 Float sampling_p, diameter_p;
00161 Int xSupport_p,ySupport_p, conjPoln_p;
00162 Double wValue_p, wIncr_p, freqValue_p,freqIncr_p, conjFreq_p;
00163
00164 Int muellerElement_p;
00165 Quantity pa_p;
00166 Vector<Int> cfShape_p;
00167 String fileName_p,telescopeName_p;
00168 };
00169 }
00170 #endif