28 #ifndef SYNTHESIS_TRANSFORM2_CFBUFFER_H
29 #define SYNTHESIS_TRANSFORM2_CFBUFFER_H
103 using namespace casa::vi;
107 using namespace CFDefs;
115 **conjMuellerElementsIndex, **conjMuellerElements,
116 **conjFreqNdxMap, **freqNdxMap;
121 {
return &(CFBStorage[i + (
shape[1]-1)*j + (
shape[1]-1)*(
shape[2]-1)*k]);}
132 CFBuffer(): wValues_p(), maxXSupport_p(-1), maxYSupport_p(-1), pointingOffset_p(), cfHitsStats(),
133 freqNdxMapsReady_p(false), freqNdxMap_p(), conjFreqNdxMap_p(), cfCacheDirName_p(), maxCFSize_p(-1)
137 wValues_p(), maxXSupport_p(maxXSup), maxYSupport_p(maxYSup), pointingOffset_p(), cfHitsStats(),
138 freqNdxMapsReady_p(false), freqNdxMap_p(), conjFreqNdxMap_p(), cfCacheDirName_p()
155 void setParams(
const CFBuffer& other);
190 {
return *(getCFCell(freqVal, wValue, muellerElement).storage_p);}
195 {
return getCFCellPtr(freqVal, wValue, muellerElement)->storage_p;}
198 {
return *(getCFCell(i,j,k).storage_p);}
201 {
return getCFCellPtr(i,j,k)->storage_p;}
221 cs = cfCells_p(i,j,k)->coordSys_p;
222 sampling = cfCells_p(i,j,k)->sampling_p;
223 xSupport = cfCells_p(i,j,k)->xSupport_p;
224 ySupport = cfCells_p(i,j,k)->ySupport_p;
225 bandName = cfCells_p(i,j,k)->bandName_p;
231 sampling = cfCells_p(iFreq,iW,iPol)->sampling_p;
232 xSupport = cfCells_p(iFreq,iW,iPol)->xSupport_p;
233 ySupport = cfCells_p(iFreq,iW,iPol)->ySupport_p;
234 freqVal = freqValues_p(iFreq);
242 freqValues.
assign(freqValues_p);wValues.
assign(wValues_p);
243 muellerElements.
assign(muellerElements_p); muellerElementsIndex.
assign(muellerElementsIndex_p);
244 conjMuellerElements.
assign(conjMuellerElements_p); conjMuellerElementsIndex.
assign(conjMuellerElementsIndex_p);
245 fIncr = freqValIncr_p; wIncr = wValIncr_p;
255 return max(0,
min((
int)(
sqrt(wValIncr_p*
abs(wVal))),(
int)wValues_p.nelements())-1);
265 {
return nearest(found, freqVal, freqValues_p, freqValIncr_p);}
268 {
return nearest(found, wVal, wValues_p, wValIncr_p);}
330 {pointingOffset_p.assign(offset);};
364 void show(
const char *Mesg=NULL,ostream &os=cerr);
371 void makePersistent(
const char *dir,
const char *cfName=
"");
373 void primeTheCache();
384 if (nChan_p == 1)
return 0;
385 if (
conj)
return conjFreqNdxMap_p[spw][chan];
386 else return freqNdxMap_p[spw][chan];
411 bool finitePointingOffsets();
A Vector of integers, for indexing into Array<T> objects.
casacore::Vector< casacore::Vector< casacore::Double > > getPointingOffset()
casacore::Double * freqValues
void addCF(casacore::Array< TT > *, casacore::CoordinateSystem &, casacore::Float &, casacore::Int &, casacore::Int &, casacore::Double &, casacore::Double &, casacore::Int &)
casacore::Int nearestFreqNdx(const casacore::Int &spw, const casacore::Int &chan, const casacore::Bool conj=false)
void getCoordList(casacore::Vector< casacore::Double > &freqValues, casacore::Vector< casacore::Double > &wValues, PolMapType &muellerElementsIndex, PolMapType &muellerElements, PolMapType &conjMuellerElementsIndex, PolMapType &conjMuellerElements, casacore::Double &fIncr, casacore::Double &wIncr)
casacore::Int maxYSupport_p
std::complex< Float > Complex
casacore::Double nearestFreq(casacore::Bool &found, const casacore::Double &freqVal)
casacore::String cfCacheDirName_p
A 3-D Specialization of the Array class.
casacore::Double conjFreq(const casacore::Double &freq, const casacore::Double &refFreq)
void copyParams(const CFBuffer &other)
static void initCFBStruct(CFBStruct &cfbSt)
casacore::Int ** muellerElements
casacore::Array< TT > & getCF(const casacore::Int &i, const casacore::Int &j, const casacore::Int &k)
casacore::Vector< casacore::Vector< casacore::Double > > pointingOffset_p
void show(const variant &v)
void setPointingOffset(const casacore::Vector< casacore::Vector< casacore::Double > > &offset)
casacore::RigidVector<casacore::Int, 3> setParams(const casacore::Int& inu, const casacore::Int& iw...
casacore::Vector< casacore::Vector< casacore::Int > > freqNdxMap_p
Fast Vector classes with fixed (templated) length.
CFBuffer(casacore::Int maxXSup, casacore::Int maxYSup)
void setDir(const casacore::String &Dir)
casacore::Int nChan()
============================= casacore::Functional Parts ============================ ...
casacore::Array< TT > & getCF(const casacore::Double &freqVal, const casacore::Double &wValue, const casacore::Int &muellerElement)
=========================================================================
casacore::IPosition getShape()
casacore::Vector< casacore::Double > wValues_p
LatticeExprNode pa(const LatticeExprNode &left, const LatticeExprNode &right)
This function finds 180/pi*atan2(left,right)/2.
Referenced counted pointer for constant data.
void getParams(casacore::CoordinateSystem &cs, casacore::Float &sampling, casacore::Int &xSupport, casacore::Int &ySupport, casacore::String &bandName, const casacore::Int &i, const casacore::Int &j, const casacore::Int &k)
Get CF by directly indexing in the list of CFs (data vector)
casacore::CountedPtr< casacore::Array< TT > > & getCFPtr(const casacore::Double &freqVal, const casacore::Double &wValue, const casacore::Int &muellerElement)
muellerElement: (i,j) of the Mueller Matrix
CFCell & operator()(const casacore::Int &i, const casacore::Int &j, const casacore::Int &k)
virtual void assign(const Array< T > &other)
Assign the other array (which must be of dimension one) to this vector.
casacore::Bool freqNdxMapsReady_p
CFBuffer()
========================= Administrative Parts ==========================
const casacore::String & getCFCacheDir()
LatticeExprNode abs(const LatticeExprNode &expr)
Numerical 1-argument functions which result in a real number regardless of input expression type...
casacore::Int maxXSupport_p
casacore::Int ** muellerElementsIndex
casacore::Cube< casacore::CountedPtr< CFCell > > & getStorage()
casacore::Double wValIncr_p
LatticeExprNode sqrt(const LatticeExprNode &expr)
bool Bool
Define the standard types used by Casacore.
casacore::Double * wValues
casacore::Bool clone(const casacore::String &imageName, const casacore::String &newImageName)
casacore::Int ** conjMuellerElements
casacore::Int nMuellerElements()
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
A hierarchical collection of named fields of various types.
casacore::Complex TT
template <class t>="">
casacore::Bool null()
Returns true if the internal storage is not yet initialized.
VisBuffer2s encapsulate one chunk of visibility data for processing.
Base class for all Casacore library errors.
void getParams(casacore::Double &freqVal, casacore::Float &sampling, casacore::Int &xSupport, casacore::Int &ySupport, const casacore::Int &iFreq, const casacore::Int &iW, const casacore::Int &iPol)
casacore::IPosition shape()
casacore::Vector< casacore::Double > getWList()
casacore::Vector< casacore::Double > getFreqList()
template <class t>="">
String: the storage and methods of handling collections of characters.
MuellerMatrixType muellerMask_p
PolMapType muellerElementsIndex_p
casacore::Int nearestWNdx(const casacore::Double &wVal)
void resize(const casacore::IPosition &size)
casacore::Double nearestWVal(casacore::Bool &found, const casacore::Double &wVal)
casacore::CountedPtr< casacore::Array< TT > > & getCFPtr(const casacore::Int &i, const casacore::Int &j, const casacore::Int &k)
CFCStruct * getCFB(int i, int j, int k)
casacore::Int ** conjMuellerElementsIndex
Interconvert pixel and world coordinates.
casacore::Cube< casacore::CountedPtr< CFCell > > cfCells_p
============================= Protected Parts ============================
casacore::Cube< casacore::Int > cfHitsStats
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.