28 #ifndef SYNTHESIS_CFBUFFER_H
29 #define SYNTHESIS_CFBUFFER_H
94 using namespace casa::CFDefs;
108 **conjMuellerElementsIndex, **conjMuellerElements,
109 **conjFreqNdxMap, **freqNdxMap;
114 {
return &(CFBStorage[i + (
shape[1]-1)*j + (
shape[1]-1)*(
shape[2]-1)*k]);}
125 CFBuffer(): wValues_p(), maxXSupport_p(-1), maxYSupport_p(-1), pointingOffset_p(), cfHitsStats(),
126 freqNdxMapsReady_p(false), freqNdxMap_p(), conjFreqNdxMap_p(), cfCacheDirName_p()
130 wValues_p(), maxXSupport_p(maxXSup), maxYSupport_p(maxYSup), pointingOffset_p(), cfHitsStats(),
131 freqNdxMapsReady_p(false), freqNdxMap_p(), conjFreqNdxMap_p(), cfCacheDirName_p()
148 void setParams(
const CFBuffer& other);
183 {
return *(getCFCell(freqVal, wValue, muellerElement).storage_p);}
188 {
return getCFCellPtr(freqVal, wValue, muellerElement)->storage_p;}
191 {
return *(getCFCell(i,j,k).storage_p);}
194 {
return getCFCellPtr(i,j,k)->storage_p;}
214 cs = cfCells_p(i,j,k)->coordSys_p;
215 sampling = cfCells_p(i,j,k)->sampling_p;
216 xSupport = cfCells_p(i,j,k)->xSupport_p;
217 ySupport = cfCells_p(i,j,k)->ySupport_p;
223 sampling = cfCells_p(iFreq,iW,iPol)->sampling_p;
224 xSupport = cfCells_p(iFreq,iW,iPol)->xSupport_p;
225 ySupport = cfCells_p(iFreq,iW,iPol)->ySupport_p;
226 freqVal = freqValues_p(iFreq);
234 freqValues.
assign(freqValues_p);wValues.
assign(wValues_p);
235 muellerElements.
assign(muellerElements_p); muellerElementsIndex.
assign(muellerElementsIndex_p);
236 conjMuellerElements.
assign(conjMuellerElements_p); conjMuellerElementsIndex.
assign(conjMuellerElementsIndex_p);
237 fIncr = freqValIncr_p; wIncr = wValIncr_p;
247 return max(0,
min((
int)(
sqrt(wValIncr_p*
abs(wVal))),(
int)wValues_p.nelements())-1);
257 {
return nearest(found, freqVal, freqValues_p, freqValIncr_p);}
260 {
return nearest(found, wVal, wValues_p, wValIncr_p);}
321 {pointingOffset_p.assign(offset);};
354 void show(
const char *Mesg=NULL,ostream &os=cerr);
361 void makePersistent(
const char *dir,
const char *cfName=
"");
363 void primeTheCache();
373 if (
conj)
return conjFreqNdxMap_p[spw][chan];
374 else return freqNdxMap_p[spw][chan];
A Vector of integers, for indexing into Array<T> objects.
casacore::Int ** muellerElementsIndex
casacore::Vector< casacore::Double > getPointingOffset()
casacore::String cfCacheDirName_p
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::Vector< casacore::Double > getWList()
casacore::CountedPtr< casacore::Array< TT > > & getCFPtr(const casacore::Int &i, const casacore::Int &j, const casacore::Int &k)
casacore::Double nearestFreq(casacore::Bool &found, const casacore::Double &freqVal)
MuellerMatrixType muellerMask_p
std::complex< Float > Complex
static void initCFBStruct(CFBStruct &cfbSt)
void addCF(casacore::Array< TT > *, casacore::CoordinateSystem &, casacore::Float &, casacore::Int &, casacore::Int &, casacore::Double &, casacore::Double &, casacore::Int &)
casacore::Array< TT > & getCF(const casacore::Int &i, const casacore::Int &j, const casacore::Int &k)
casacore::Vector< casacore::Double > wValues_p
void getParams(casacore::CoordinateSystem &cs, casacore::Float &sampling, casacore::Int &xSupport, casacore::Int &ySupport, const casacore::Int &i, const casacore::Int &j, const casacore::Int &k)
Get CF by directly indexing in the list of CFs (data vector)
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 nearestFreqNdx(const casacore::Int &spw, const casacore::Int &chan, const casacore::Bool conj=false)
casacore::Double * wValues
A 3-D Specialization of the Array class.
casacore::Bool null()
Returns true if the internal storage is not yet initialized.
casacore::Double conjFreq(const casacore::Double &freq, const casacore::Double &refFreq)
casacore::Bool freqNdxMapsReady_p
casacore::Vector< casacore::Double > getFreqList()
void show(const variant &v)
LatticeExprNode conj(const LatticeExprNode &expr)
Fast Vector classes with fixed (templated) length.
CFBuffer(casacore::Int maxXSup, casacore::Int maxYSup)
CFCell & operator()(const casacore::Int &i, const casacore::Int &j, const casacore::Int &k)
casacore::Cube< casacore::CountedPtr< CFCell > > & getStorage()
casacore::Int maxXSupport_p
casacore::Array< TT > & getCF(const casacore::Double &freqVal, const casacore::Double &wValue, const casacore::Int &muellerElement)
=========================================================================
LatticeExprNode pa(const LatticeExprNode &left, const LatticeExprNode &right)
This function finds 180/pi*atan2(left,right)/2.
Referenced counted pointer for constant data.
casacore::Double wValIncr_p
virtual void assign(const Array< T > &other)
Assign the other array (which must be of dimension one) to this vector.
casacore::Int ** conjMuellerElementsIndex
CFCStruct * getCFB(int i, int j, int k)
const casacore::String & getCFCacheDir()
casacore::Double * freqValues
LatticeExprNode abs(const LatticeExprNode &expr)
Numerical 1-argument functions which result in a real number regardless of input expression type...
casacore::Cube< casacore::Int > cfHitsStats
casacore::Cube< casacore::CountedPtr< CFCell > > cfCells_p
============================= Protected Parts ============================
casacore::Int ** conjMuellerElements
casacore::IPosition getShape()
LatticeExprNode sqrt(const LatticeExprNode &expr)
bool Bool
Define the standard types used by Casacore.
casacore::Bool clone(const casacore::String &imageName, const casacore::String &newImageName)
casacore::Vector< casacore::Vector< casacore::Int > > freqNdxMap_p
casacore::IPosition shape()
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
CFBuffer()
========================= Administrative Parts ==========================
A hierarchical collection of named fields of various types.
casacore::Complex TT
template <class t>="">
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
casacore::Int ** muellerElements
void resize(const casacore::IPosition &size)
Base class for all Casacore library errors.
void copyParams(const CFBuffer &other)
casacore::Double nearestWVal(casacore::Bool &found, const casacore::Double &wVal)
casacore::Int nMuellerElements()
template <class t>="">
String: the storage and methods of handling collections of characters.
PolMapType muellerElementsIndex_p
VisBuffers encapsulate one chunk of visibility data for processing.
casacore::Int nearestWNdx(const casacore::Double &wVal)
casacore::Int nChan()
============================= casacore::Functional Parts ============================ ...
casacore::Int maxYSupport_p
void setPointingOffset(const casacore::Vector< casacore::Double > &offset)
casacore::RigidVector<casacore::Int, 3> setParams(const casacore::Int& inu, const casacore::Int& iw...
Interconvert pixel and world coordinates.
casacore::Vector< casacore::Double > pointingOffset_p
void setDir(const casacore::String &Dir)
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.