casa::CFBuffer Class Reference

#include <CFBuffer.h>

List of all members.

Public Member Functions

 CFBuffer ()
 ========================= Administrative Parts ========================== ------------------------------------------------------------------
 CFBuffer (Int maxXSup, Int maxYSup)
 ~CFBuffer ()
CountedPtr< CFBufferclone ()
void allocCells (const Cube< CountedPtr< CFCell > > &cells)
void setParams (const CFBuffer &other)
Int nChan ()
 ============================= Functional Parts ============================ ------------------------------------------------------------------
Int nW ()
Int nMuellerElements ()
IPosition shape ()
Vector< Double > getFreqList ()
Vector< Double > getWList ()
CFCellgetCFCell (const Double &freqVal, const Double &wValue, const Int &muellerElement)
CountedPtr< CFCell > & getCFCellPtr (const Double &freqVal, const Double &wValue, const Int &muellerElement)
 muellerElement: (i,j) of the Mueller Matrix
CFCelloperator() (const Int &i, const Int &j, const Int &k)
CFCellgetCFCell (const Int &i, const Int &j, const Int &k)
CountedPtr< CFCell > & getCFCellPtr (const Int &i, const Int &j, const Int &k)
Array< TT > & getCF (const Double &freqVal, const Double &wValue, const Int &muellerElement)
 =========================================================================
CountedPtr< Array< TT > > & getCFPtr (const Double &freqVal, const Double &wValue, const Int &muellerElement)
 muellerElement: (i,j) of the Mueller Matrix
Array< TT > & getCF (const Int &i, const Int &j, const Int &k)
CountedPtr< Array< TT > > & getCFPtr (const Int &i, const Int &j, const Int &k)
void getParams (CoordinateSystem &cs, Float &sampling, Int &xSupport, Int &ySupport, const Double &freqVal, const Double &wValue, const Int &muellerElement)
 Get the parameters of a the CFs indexed by values.
void getParams (CoordinateSystem &cs, Float &sampling, Int &xSupport, Int &ySupport, const Int &i, const Int &j, const Int &k)
 ------------------------------------------------------------------------- Get CF by directly indexing in the list of CFs (data vector)
void getParams (Double &freqVal, Float &sampling, Int &xSupport, Int &ySupport, const Int &iFreq, const Int &iW, const Int &iPol)
void getCoordList (Vector< Double > &freqValues, Vector< Double > &wValues, PolMapType &muellerElementsIndex, PolMapType &muellerElements, PolMapType &conjMuellerElementsIndex, PolMapType &conjMuellerElements, Double &fIncr, Double &wIncr)
Int nearestNdx (const Double &val, const Vector< Double > &valList, const Double &incr)
Int nearestFreqNdx (const Double &freqVal)
Int nearestWNdx (const Double &wVal)
Double nearest (Bool &found, const Double &val, const Vector< Double > &valList, const Double &incr)
Double nearestFreq (Bool &found, const Double &freqVal)
Double nearestWVal (Bool &found, const Double &wVal)
void makeCFBufferMap (const Vector< Double > &freqVals, const Vector< Double > &wValues, const MuellerMatrixType &muellerElements)
 -------------------------------------------------------------------------
void addCF (Array< TT > *, CoordinateSystem &, Float &, Int &, Int &, Double &, Double &, Int &)
 -------------------------------------------------------------------------
void resize (const IPosition &size)
 -------------------------------------------------------------------------
void resize (const Double &wIncr, const Double &freqIncr, const Vector< Double > &wValues, const Vector< Double > &freqValues, const PolMapType &muellerElements, const PolMapType &muellerElementsIndex, const PolMapType &conjMuellerElements, const PolMapType &conjMuellerElementsIndex)
Int noOfMuellerElements (const PolMapType &muellerElements)
RigidVector< Int, 3 > setParams (const Int &i, const Int &j, const Int &ipx, const Int &ipy, CoordinateSystem &cs, Float &sampling, Int &xSupport, Int &ySupport, const Double &freqValue, const Double &wValue, const Int &muellerElement, const String &fileName=String(), const Double &conjFreq=0.0, const Int &conjPol=-1, const String &telescopeName=String(), const Float &diameter=25.0)
 ------------------------------------------------------------------------- Set only the CF parameters.
void setPointingOffset (const Vector< Double > &offset)
 RigidVector<Int, 3> setParams(const Int& inu, const Int& iw, const Int& muellerElement, const TableRecord& miscInfo);.
Vector< Double > getPointingOffset ()
void setParams (Int &nx, Int &ny, CoordinateSystem &cs, Float &sampling, Int &xSupport, Int &ySupport, const Double &freqVal, const Double &wValue, const Int &muellerElement, const String &fileName)
 Also set the size of the CF in x and y.
void setPA (Float &pa)
RigidVector< Int, 3 > getIndex (const Double &freqVal, const Double &wValue, const Int &muellerElement)
void copyParams (const CFBuffer &other)
 -------------------------------------------------------------------------
void show (const char *Mesg=NULL, ostream &os=cerr)
 -------------------------------------------------------------------------
Bool null ()
 Returns True if the internal storage is not yet initialized.
Cube< CountedPtr< CFCell > > & getStorage ()
void makePersistent (const char *dir, const char *cfName="")
void primeTheCache ()
void initMaps (const VisBuffer &vb, const Matrix< Double > &freqSelection, const Double &imRefFreq)
void initPolMaps (PolMapType &polMap, PolMapType &conjPolMap)
void getFreqNdxMaps (Vector< Vector< Int > > &freqNdx, Vector< Vector< Int > > &conjFreqNdx)
 For CUDA kernel.
Int nearestFreqNdx (const Int &spw, const Int &chan, const Bool conj=False)
void getAsStruct (CFBStruct &st)
void fill (const Int &nx, const Int &ny, const Vector< Double > &freqValues, const Vector< Double > &wValues, const PolMapType &muellerElements)
IPosition getShape ()

Static Public Member Functions

static void initCFBStruct (CFBStruct &cfbSt)

Protected Member Functions

void ASSIGNVVofI (Int **&target, Vector< Vector< Int > > &source, Bool &doAlloc)

Protected Attributes

Cube< CountedPtr< CFCell > > cfCells_p
 ============================= Protected Parts ============================ ------------------------------------------------------------------
Vector< Double > wValues_p
Vector< Double > freqValues_p
PolMapType muellerElements_p
PolMapType muellerElementsIndex_p
PolMapType conjMuellerElements_p
PolMapType conjMuellerElementsIndex_p
Double wValIncr_p
Double freqValIncr_p
MuellerMatrixType muellerMask_p
Int nPol_p
Int nChan_p
Int nW_p
Int maxXSupport_p
Int maxYSupport_p
Vector< Double > pointingOffset_p
Cube< Int > cfHitsStats
Bool freqNdxMapsReady_p
Vector< Vector< Int > > freqNdxMap_p
Vector< Vector< Int > > conjFreqNdxMap_p

Detailed Description

Definition at line 116 of file CFBuffer.h.


Constructor & Destructor Documentation

casa::CFBuffer::CFBuffer (  )  [inline]

========================= Administrative Parts ========================== ------------------------------------------------------------------

Definition at line 123 of file CFBuffer.h.

casa::CFBuffer::CFBuffer ( Int  maxXSup,
Int  maxYSup 
) [inline]

storage_p.resize(1,1,1); storage_p(0,0,0) = new Array<TT>(dataPtr); coordSys_p.resize(1,1,1); coordSys_p(0,0,0) = cs;

Definition at line 127 of file CFBuffer.h.

casa::CFBuffer::~CFBuffer (  )  [inline]

cerr << "############### " << "~CFBuffer() called" << endl; LogIO log_l(LogOrigin("CFBuffer","~CFBuffer[R&D]")); log_l << "CF Hits stats gathered: " << cfHitsStats << endl;

Definition at line 137 of file CFBuffer.h.


Member Function Documentation

void casa::CFBuffer::addCF ( Array< TT > *  ,
CoordinateSystem &  ,
Float &  ,
Int &  ,
Int &  ,
Double &  ,
Double &  ,
Int &   
) [inline]

-------------------------------------------------------------------------

Add a Convolution Function with associated parameters.

Definition at line 273 of file CFBuffer.h.

void casa::CFBuffer::allocCells ( const Cube< CountedPtr< CFCell > > &  cells  ) 
void casa::CFBuffer::ASSIGNVVofI ( Int **&  target,
Vector< Vector< Int > > &  source,
Bool &  doAlloc 
) [protected]
CountedPtr<CFBuffer> casa::CFBuffer::clone (  ) 
void casa::CFBuffer::copyParams ( const CFBuffer other  )  [inline]

-------------------------------------------------------------------------

Copy just the parameters from other to this.

coordSys_p = other.coordSys_p; sampling_p.assign(other.sampling_p); xSupport_p.assign(other.xSupport_p); ySupport_p.assign(other.ySupport_p);

Definition at line 327 of file CFBuffer.h.

References cfCells_p, maxXSupport_p, and maxYSupport_p.

void casa::CFBuffer::fill ( const Int &  nx,
const Int &  ny,
const Vector< Double > &  freqValues,
const Vector< Double > &  wValues,
const PolMapType &  muellerElements 
)
void casa::CFBuffer::getAsStruct ( CFBStruct st  ) 
Array<TT>& casa::CFBuffer::getCF ( const Int &  i,
const Int &  j,
const Int &  k 
) [inline]

Definition at line 188 of file CFBuffer.h.

References getCFCell(), and casa::CFCell::storage_p.

Array<TT>& casa::CFBuffer::getCF ( const Double &  freqVal,
const Double &  wValue,
const Int &  muellerElement 
) [inline]

=========================================================================

Definition at line 179 of file CFBuffer.h.

References getCFCell(), and casa::CFCell::storage_p.

CFCell& casa::CFBuffer::getCFCell ( const Int &  i,
const Int &  j,
const Int &  k 
)
CFCell& casa::CFBuffer::getCFCell ( const Double &  freqVal,
const Double &  wValue,
const Int &  muellerElement 
)

Referenced by getCF().

CountedPtr<CFCell >& casa::CFBuffer::getCFCellPtr ( const Int &  i,
const Int &  j,
const Int &  k 
)
CountedPtr<CFCell>& casa::CFBuffer::getCFCellPtr ( const Double &  freqVal,
const Double &  wValue,
const Int &  muellerElement 
)

muellerElement: (i,j) of the Mueller Matrix

Referenced by getCFPtr().

CountedPtr<Array<TT> >& casa::CFBuffer::getCFPtr ( const Int &  i,
const Int &  j,
const Int &  k 
) [inline]

Definition at line 191 of file CFBuffer.h.

References getCFCellPtr().

CountedPtr<Array<TT> >& casa::CFBuffer::getCFPtr ( const Double &  freqVal,
const Double &  wValue,
const Int &  muellerElement 
) [inline]

muellerElement: (i,j) of the Mueller Matrix

Definition at line 184 of file CFBuffer.h.

References getCFCellPtr().

void casa::CFBuffer::getCoordList ( Vector< Double > &  freqValues,
Vector< Double > &  wValues,
PolMapType &  muellerElementsIndex,
PolMapType &  muellerElements,
PolMapType &  conjMuellerElementsIndex,
PolMapType &  conjMuellerElements,
Double &  fIncr,
Double &  wIncr 
) [inline]
Vector<Double> casa::CFBuffer::getFreqList (  )  [inline]

Definition at line 165 of file CFBuffer.h.

References freqValues_p.

void casa::CFBuffer::getFreqNdxMaps ( Vector< Vector< Int > > &  freqNdx,
Vector< Vector< Int > > &  conjFreqNdx 
)

For CUDA kernel.

RigidVector<Int,3> casa::CFBuffer::getIndex ( const Double &  freqVal,
const Double &  wValue,
const Int &  muellerElement 
)
void casa::CFBuffer::getParams ( Double &  freqVal,
Float &  sampling,
Int &  xSupport,
Int &  ySupport,
const Int &  iFreq,
const Int &  iW,
const Int &  iPol 
) [inline]

Definition at line 217 of file CFBuffer.h.

References cfCells_p, and freqValues_p.

void casa::CFBuffer::getParams ( CoordinateSystem &  cs,
Float &  sampling,
Int &  xSupport,
Int &  ySupport,
const Int &  i,
const Int &  j,
const Int &  k 
) [inline]

------------------------------------------------------------------------- Get CF by directly indexing in the list of CFs (data vector)

Definition at line 208 of file CFBuffer.h.

References cfCells_p.

void casa::CFBuffer::getParams ( CoordinateSystem &  cs,
Float &  sampling,
Int &  xSupport,
Int &  ySupport,
const Double &  freqVal,
const Double &  wValue,
const Int &  muellerElement 
)

Get the parameters of a the CFs indexed by values.

The version which returns also the Coordinate System associated with the CFs are slow (CoordinateSystem::operator=() is surprisingly expensive!). So do not use this in tight loops. If it is required, use the version without the co-ordinate system below.

Vector<Double> casa::CFBuffer::getPointingOffset (  )  [inline]

Definition at line 311 of file CFBuffer.h.

References pointingOffset_p.

IPosition casa::CFBuffer::getShape (  )  [inline]

Definition at line 381 of file CFBuffer.h.

References cfCells_p.

Cube<CountedPtr<CFCell> >& casa::CFBuffer::getStorage (  )  [inline]

Definition at line 346 of file CFBuffer.h.

References cfCells_p.

Vector<Double> casa::CFBuffer::getWList (  )  [inline]

Definition at line 166 of file CFBuffer.h.

References wValues_p.

static void casa::CFBuffer::initCFBStruct ( CFBStruct cfbSt  )  [inline, static]
void casa::CFBuffer::initMaps ( const VisBuffer vb,
const Matrix< Double > &  freqSelection,
const Double &  imRefFreq 
)
void casa::CFBuffer::initPolMaps ( PolMapType &  polMap,
PolMapType &  conjPolMap 
)
void casa::CFBuffer::makeCFBufferMap ( const Vector< Double > &  freqVals,
const Vector< Double > &  wValues,
const MuellerMatrixType &  muellerElements 
)

-------------------------------------------------------------------------

Generate a map for the given frequency and Mueller element list to the index in the internal list of CFs. This can be used in tight loops to get get direct access to the required CF.

void casa::CFBuffer::makePersistent ( const char *  dir,
const char *  cfName = "" 
)
Int casa::CFBuffer::nChan (  )  [inline]

============================= Functional Parts ============================ ------------------------------------------------------------------

CFBuffer& operator=(const CFBuffer& other);

Get the single convolution function as an Array<T> for the supplied value of the frequency and the muellerElement. Mueller element is essentially the polarization product, but can be any of the of 16 elements of the outer product.

-------------------------------------------------------------------------

Definition at line 160 of file CFBuffer.h.

References nChan_p.

Double casa::CFBuffer::nearest ( Bool &  found,
const Double &  val,
const Vector< Double > &  valList,
const Double &  incr 
)

Referenced by nearestFreq(), and nearestWVal().

Double casa::CFBuffer::nearestFreq ( Bool &  found,
const Double &  freqVal 
) [inline]

Definition at line 254 of file CFBuffer.h.

References freqValIncr_p, freqValues_p, and nearest().

Int casa::CFBuffer::nearestFreqNdx ( const Int &  spw,
const Int &  chan,
const Bool  conj = False 
) [inline]

Definition at line 356 of file CFBuffer.h.

References std::conj(), conjFreqNdxMap_p, and freqNdxMap_p.

Int casa::CFBuffer::nearestFreqNdx ( const Double &  freqVal  ) 
Int casa::CFBuffer::nearestNdx ( const Double &  val,
const Vector< Double > &  valList,
const Double &  incr 
)
Int casa::CFBuffer::nearestWNdx ( const Double &  wVal  )  [inline]

return SynthesisUtils::nint(sqrt(wValIncr_p*abs(wVal)));

Int ndx=(int)(sqrt(wValIncr_p*abs(wVal))); if ((uInt)ndx >= wValues_p.nelements()) cerr << endl << endl << ndx << " " << wVal << " " << wValIncr_p << endl << endl; return min(ndx,wValues_p.nelements()-1);

Definition at line 242 of file CFBuffer.h.

References casacore::abs(), casacore::max(), casacore::min(), casacore::sqrt(), wValIncr_p, and wValues_p.

Double casa::CFBuffer::nearestWVal ( Bool &  found,
const Double &  wVal 
) [inline]

Definition at line 257 of file CFBuffer.h.

References nearest(), wValIncr_p, and wValues_p.

Int casa::CFBuffer::nMuellerElements (  )  [inline]

Definition at line 162 of file CFBuffer.h.

References nPol_p.

Int casa::CFBuffer::noOfMuellerElements ( const PolMapType &  muellerElements  ) 
Bool casa::CFBuffer::null (  )  [inline]

Returns True if the internal storage is not yet initialized.

Definition at line 344 of file CFBuffer.h.

References cfCells_p.

Int casa::CFBuffer::nW (  )  [inline]

Definition at line 161 of file CFBuffer.h.

References nW_p.

CFCell& casa::CFBuffer::operator() ( const Int &  i,
const Int &  j,
const Int &  k 
) [inline]

Definition at line 173 of file CFBuffer.h.

References cfCells_p.

void casa::CFBuffer::primeTheCache (  ) 
void casa::CFBuffer::resize ( const Double &  wIncr,
const Double &  freqIncr,
const Vector< Double > &  wValues,
const Vector< Double > &  freqValues,
const PolMapType &  muellerElements,
const PolMapType &  muellerElementsIndex,
const PolMapType &  conjMuellerElements,
const PolMapType &  conjMuellerElementsIndex 
)
void casa::CFBuffer::resize ( const IPosition &  size  )  [inline]

-------------------------------------------------------------------------

Definition at line 285 of file CFBuffer.h.

References cfCells_p.

void casa::CFBuffer::setPA ( Float &  pa  ) 
void casa::CFBuffer::setParams ( Int &  nx,
Int &  ny,
CoordinateSystem &  cs,
Float &  sampling,
Int &  xSupport,
Int &  ySupport,
const Double &  freqVal,
const Double &  wValue,
const Int &  muellerElement,
const String &  fileName 
)

Also set the size of the CF in x and y.

RigidVector<Int, 3> casa::CFBuffer::setParams ( const Int &  i,
const Int &  j,
const Int &  ipx,
const Int &  ipy,
CoordinateSystem &  cs,
Float &  sampling,
Int &  xSupport,
Int &  ySupport,
const Double &  freqValue,
const Double &  wValue,
const Int &  muellerElement,
const String &  fileName = String(),
const Double &  conjFreq = 0.0,
const Int &  conjPol = -1,
const String &  telescopeName = String(),
const Float &  diameter = 25.0 
)

------------------------------------------------------------------------- Set only the CF parameters.

Return to index of the CF that was set.

void casa::CFBuffer::setParams ( const CFBuffer other  ) 
void casa::CFBuffer::setPointingOffset ( const Vector< Double > &  offset  )  [inline]

RigidVector<Int, 3> setParams(const Int& inu, const Int& iw, const Int& muellerElement, const TableRecord& miscInfo);.

Definition at line 309 of file CFBuffer.h.

References pointingOffset_p.

IPosition casa::CFBuffer::shape (  )  [inline]

Definition at line 163 of file CFBuffer.h.

References nChan_p, nPol_p, and nW_p.

void casa::CFBuffer::show ( const char *  Mesg = NULL,
ostream &  os = cerr 
)

-------------------------------------------------------------------------

Write the description of the storage on the supplied ostream. Used mostly for debugging, but might be useful for user feedback/logging.


Member Data Documentation

Cube<CountedPtr<CFCell> > casa::CFBuffer::cfCells_p [protected]

============================= Protected Parts ============================ ------------------------------------------------------------------

The storage buffer for the pixel values in CFCell is Array<T> rather than Matrix<T> to accomodate rotationally symmetric CFs (like the Prolate Spheroidal) which can be held as a Vector of values.

Definition at line 393 of file CFBuffer.h.

Referenced by copyParams(), getParams(), getShape(), getStorage(), null(), operator()(), and resize().

Cube<Int> casa::CFBuffer::cfHitsStats [protected]

Definition at line 401 of file CFBuffer.h.

Vector<Vector<Int> > casa::CFBuffer::conjFreqNdxMap_p [protected]

Definition at line 403 of file CFBuffer.h.

Referenced by nearestFreqNdx().

PolMapType casa::CFBuffer::conjMuellerElements_p [protected]

Definition at line 395 of file CFBuffer.h.

Referenced by getCoordList().

Definition at line 395 of file CFBuffer.h.

Referenced by getCoordList().

Vector<Vector<Int> > casa::CFBuffer::freqNdxMap_p [protected]

Definition at line 403 of file CFBuffer.h.

Referenced by nearestFreqNdx().

Definition at line 402 of file CFBuffer.h.

Double casa::CFBuffer::freqValIncr_p [protected]

Definition at line 396 of file CFBuffer.h.

Referenced by getCoordList(), and nearestFreq().

Vector<Double> casa::CFBuffer::freqValues_p [protected]

Definition at line 394 of file CFBuffer.h.

Referenced by getCoordList(), getFreqList(), getParams(), and nearestFreq().

Definition at line 399 of file CFBuffer.h.

Referenced by copyParams().

Definition at line 399 of file CFBuffer.h.

Referenced by copyParams().

PolMapType casa::CFBuffer::muellerElements_p [protected]

Definition at line 395 of file CFBuffer.h.

Referenced by getCoordList().

Definition at line 395 of file CFBuffer.h.

Referenced by getCoordList().

MuellerMatrixType casa::CFBuffer::muellerMask_p [protected]

Definition at line 397 of file CFBuffer.h.

Int casa::CFBuffer::nChan_p [protected]

Definition at line 399 of file CFBuffer.h.

Referenced by nChan(), and shape().

Int casa::CFBuffer::nPol_p [protected]

Definition at line 399 of file CFBuffer.h.

Referenced by nMuellerElements(), and shape().

Int casa::CFBuffer::nW_p [protected]

Definition at line 399 of file CFBuffer.h.

Referenced by nW(), and shape().

Vector<Double> casa::CFBuffer::pointingOffset_p [protected]

Definition at line 400 of file CFBuffer.h.

Referenced by getPointingOffset(), and setPointingOffset().

Double casa::CFBuffer::wValIncr_p [protected]

Definition at line 396 of file CFBuffer.h.

Referenced by getCoordList(), nearestWNdx(), and nearestWVal().

Vector<Double> casa::CFBuffer::wValues_p [protected]

Definition at line 394 of file CFBuffer.h.

Referenced by getCoordList(), getWList(), nearestWNdx(), and nearestWVal().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1