casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
casa::PlotMSIndexer Class Reference

#include <PlotMSIndexer.h>

Inheritance diagram for casa::PlotMSIndexer:
casa::PlotMaskedPointData casa::PlotPointData casa::PlotData

List of all members.

Public Member Functions

 PlotMSIndexer ()
 A ctor that makes an empty Indexer (for plot initialization)
 PlotMSIndexer (PlotMSCacheBase *plotmscache, PMS::Axis xAxis, PMS::Axis yAxis)
 Constructor which takes parent PlotMSCache, x and y axes (non-iteration)
 PlotMSIndexer (PlotMSCacheBase *plotmscache, PMS::Axis xAxis, PMS::Axis yAxis, PMS::Axis iterAxis, Int iterValue)
 Constructor which supports iteration.
 ~PlotMSIndexer ()
 Destructor.
bool willDeleteData () const
 Implemented PlotData methods.
void setDeleteData (bool del=true)
 Sets whether this object will delete its underlying data structures upon deconstruction or not.
bool isValid () const
 ABSTRACT METHODS //.
unsigned int size () const
 Implemented PlotPointData methods.
double xAt (unsigned int i) const
 Returns the x value at the given index.
double yAt (unsigned int i) const
 Returns the y value at the given index.
void xAndYAt (unsigned int index, double &x, double &y) const
 IMPLEMENTED METHODS //.
bool minsMaxes (double &xMin, double &xMax, double &yMin, double &yMax)
 Gets the minimum and maximum values.
bool maskedAt (unsigned int index) const
 Implemented PlotMaskedPointData methods.
void xyAndMaskAt (unsigned int index, double &x, double &y, bool &mask) const
 IMPLEMENTED METHODS //.
unsigned int sizeMasked () const
 Unimplemented PlotMaskedPointData methods.
unsigned int sizeUnmasked () const
 Returns the number of unmasked points.
bool maskedMinsMaxes (double &xMin, double &xMax, double &yMin, double &yMax)
 Gets the mins/maxes for just the masked points.
bool unmaskedMinsMaxes (double &xMin, double &xMax, double &yMin, double &yMax)
 Gets the mins/maxes for just the unmasked points.
unsigned int numBins () const
 PlotBinnedData methods.
unsigned int binAt (unsigned int i) const
bool isBinned () const
void setUpIndexing ()
 Set up indexing for the plot.
void setGlobalMinMax (Bool globalX=False, Bool globalY=False)
 Set global min/max flag.
Vector< uIntnPoints ()
 Report per-chunk point counters.
Vector< uIntnCumulative ()
Bool indexerReady () const
 Return if the indexer is ready (setUpPlot has been run)
Record getPointMetaData (Int i)
 Locate datum nearest to specified x,y.
Record locateInfo (const Vector< PlotRegion > &regions, Bool showUnflagged, Bool showFlagged, Bool selectAll=true)
PlotLogMessagelocateRange (const Vector< PlotRegion > &regions, Bool showUnflagged, Bool showFlagged)
PlotLogMessageflagRange (const PlotMSFlagging &flagging, const Vector< PlotRegion > &regions, Bool flag=True)
void reportMeta (Double x, Double y, Bool masked, stringstream &ss)
 Report meta info for current value of currChunk_/irel_.
void flagInCache (const PlotMSFlagging &flagging, Bool flag)
 Set flags in the cache.
String iterLabel ()
 Iteration label.
bool maskedMinsMaxesRaw (double &xMin, double &xMax, double &yMin, double &yMax)
 Access to raw min/max data (no auto-global)
bool unmaskedMinsMaxesRaw (double &xMin, double &xMax, double &yMin, double &yMax)
Int getIndex0000 (Int ch, Int irel)
 Directly implemented index calculators (generic index methods point to one of these depending upon axis choice)
Int getIndex1000 (Int ch, Int irel)
Int getIndex0100 (Int ch, Int irel)
Int getIndex0010 (Int ch, Int irel)
Int getIndex0110 (Int ch, Int irel)
Int getIndex1010 (Int ch, Int irel)
Int getIndex1110 (Int ch, Int irel)
Int getIndex0001 (Int ch, Int irel)
bool colorize (bool doColorize, PMS::Axis colorizeAxis)

Static Public Attributes

static const String CLASS_NAME
 Convenient access to class name.

Private Member Functions

 PlotMSIndexer (const PlotMSIndexer &mc)
 Forbid copy for now.
void setMethod (CacheMemPtr &getmethod, PMS::Axis axis)
void setIndexer (IndexerMethPtr &indexmethod, PMS::Axis axis)
Int nChunk () const
 void setCollapser(CollapseMethPtr& collmethod, PMS::Axis axis);
Double refTime ()
 Report the reference time for this cache (in seconds)
void setChunk (uInt i) const
 Set currChunk_ according to a supplied index.
void computeRanges ()
 Computes the X and Y limits for the currently set axes.
void logInfo (const String &method, const String &message)
 Convenience methods that call log() with the given method name and the appropriate event type.
void logDebug (const String &method, const String &message)
void logWarn (const String &method, const String &message)
void logError (const String &method, const String &message)
void log (const String &method, const String &message, int eventType)
 Logs the given message from the given method name as the given event type (see PlotLogger).

Private Attributes

PlotMSCacheBaseplotmscache_
 Private data.
CacheMemPtr getXFromCache_
 Pointers to methods for axis flexibility.
CacheMemPtr getYFromCache_
CacheMemPtr getColFromCache_
IndexerMethPtr XIndexer_
IndexerMethPtr YIndexer_
IndexerMethPtr ColIndexer_
Int currChunk_
 CollapseMethPtr collapseXMask_, collapseYMask_;.
Int irel_
uInt lasti_
Vector< uIntnPoints_
 The number of points per chunk.
Vector< uIntnCumulative_
 The cumulative running total of points.
Int nSegment_
 Segment point-counting Vectors.
Int currSeg_
Vector< uIntnSegPoints_
Vector< uIntnCumulPoints_
Vector< uIntcacheChunk_
Vector< uIntcacheOffset_
PMS::Axis currentX_
 Current setup/state.
PMS::Axis currentY_
bool indexerReady_
Vector< Inticorrmax_
 Indexing parameters.
Vector< Intichanmax_
Vector< Intibslnmax_
Vector< Intidatamax_
Vector< Intnperchan_
Vector< Intnperbsln_
Vector< Intnperant_
Vector< Intichanbslnmax_
Vector< Intiantmax_
Double xmin_
 Nominal axes limits.
Double ymin_
Double xflmin_
Double yflmin_
Double xmax_
Double ymax_
Double xflmax_
Double yflmax_
Int sizeMasked_
Int sizeUnMasked_
Bool globalXMinMax_
Bool globalYMinMax_
Bool iterate_
 Iteration.
PMS::Axis iterAxis_
Int iterValue_
bool itsColorize_
 Colorization.
PMS::Axis itsColorizeAxis_
PlotMSIndexerself
 Cope with const-ness in the get methods.

Detailed Description

Definition at line 48 of file PlotMSIndexer.h.


Constructor & Destructor Documentation

A ctor that makes an empty Indexer (for plot initialization)

casa::PlotMSIndexer::PlotMSIndexer ( PlotMSCacheBase plotmscache,
PMS::Axis  xAxis,
PMS::Axis  yAxis 
)

Constructor which takes parent PlotMSCache, x and y axes (non-iteration)

casa::PlotMSIndexer::PlotMSIndexer ( PlotMSCacheBase plotmscache,
PMS::Axis  xAxis,
PMS::Axis  yAxis,
PMS::Axis  iterAxis,
Int  iterValue 
)

Constructor which supports iteration.

Destructor.

Forbid copy for now.


Member Function Documentation

unsigned int casa::PlotMSIndexer::binAt ( unsigned int  i) const
bool casa::PlotMSIndexer::colorize ( bool  doColorize,
PMS::Axis  colorizeAxis 
)

Computes the X and Y limits for the currently set axes.

In the future we may want to cache ALL ranges for all loaded values to avoid recomputation.

void casa::PlotMSIndexer::flagInCache ( const PlotMSFlagging flagging,
Bool  flag 
)

Set flags in the cache.

PlotLogMessage* casa::PlotMSIndexer::flagRange ( const PlotMSFlagging flagging,
const Vector< PlotRegion > &  regions,
Bool  flag = True 
)
Int casa::PlotMSIndexer::getIndex0000 ( Int  ch,
Int  irel 
) [inline]

Directly implemented index calculators (generic index methods point to one of these depending upon axis choice)

Definition at line 146 of file PlotMSIndexer.h.

Int casa::PlotMSIndexer::getIndex0001 ( Int  ch,
Int  irel 
) [inline]

Definition at line 153 of file PlotMSIndexer.h.

References iantmax_, and nperant_.

Int casa::PlotMSIndexer::getIndex0010 ( Int  ch,
Int  irel 
) [inline]

Definition at line 149 of file PlotMSIndexer.h.

References ibslnmax_, and nperbsln_.

Int casa::PlotMSIndexer::getIndex0100 ( Int  ch,
Int  irel 
) [inline]

Definition at line 148 of file PlotMSIndexer.h.

References ichanmax_, and nperchan_.

Int casa::PlotMSIndexer::getIndex0110 ( Int  ch,
Int  irel 
) [inline]

Definition at line 150 of file PlotMSIndexer.h.

References ichanbslnmax_, and nperchan_.

Int casa::PlotMSIndexer::getIndex1000 ( Int  ch,
Int  irel 
) [inline]

Definition at line 147 of file PlotMSIndexer.h.

References icorrmax_.

Int casa::PlotMSIndexer::getIndex1010 ( Int  ch,
Int  irel 
) [inline]

Definition at line 151 of file PlotMSIndexer.h.

References nperbsln_, and nperchan_.

Int casa::PlotMSIndexer::getIndex1110 ( Int  ch,
Int  irel 
) [inline]

Definition at line 152 of file PlotMSIndexer.h.

References idatamax_.

Locate datum nearest to specified x,y.

Return if the indexer is ready (setUpPlot has been run)

Definition at line 117 of file PlotMSIndexer.h.

References indexerReady_.

bool casa::PlotMSIndexer::isValid ( ) const [inline, virtual]

ABSTRACT METHODS //.

Returns whether the contained data is valid or not.

Implements casa::PlotData.

Definition at line 71 of file PlotMSIndexer.h.

Iteration label.

Record casa::PlotMSIndexer::locateInfo ( const Vector< PlotRegion > &  regions,
Bool  showUnflagged,
Bool  showFlagged,
Bool  selectAll = true 
)
PlotLogMessage* casa::PlotMSIndexer::locateRange ( const Vector< PlotRegion > &  regions,
Bool  showUnflagged,
Bool  showFlagged 
)
void casa::PlotMSIndexer::log ( const String method,
const String message,
int  eventType 
) [private]

Logs the given message from the given method name as the given event type (see PlotLogger).

Referenced by logDebug(), logError(), logInfo(), and logWarn().

void casa::PlotMSIndexer::logDebug ( const String method,
const String message 
) [inline, private]

Definition at line 201 of file PlotMSIndexer.h.

References log(), and casa::PlotLogger::MSG_DEBUG.

void casa::PlotMSIndexer::logError ( const String method,
const String message 
) [inline, private]

Definition at line 205 of file PlotMSIndexer.h.

References log(), and casa::PlotLogger::MSG_ERROR.

void casa::PlotMSIndexer::logInfo ( const String method,
const String message 
) [inline, private]

Convenience methods that call log() with the given method name and the appropriate event type.

Definition at line 199 of file PlotMSIndexer.h.

References log(), and casa::PlotLogger::MSG_INFO.

void casa::PlotMSIndexer::logWarn ( const String method,
const String message 
) [inline, private]

Definition at line 203 of file PlotMSIndexer.h.

References log(), and casa::PlotLogger::MSG_WARN.

bool casa::PlotMSIndexer::maskedAt ( unsigned int  index) const [virtual]

Implemented PlotMaskedPointData methods.

Implements casa::PlotMaskedPointData.

bool casa::PlotMSIndexer::maskedMinsMaxes ( double &  xMin,
double &  xMax,
double &  yMin,
double &  yMax 
) [virtual]

Gets the mins/maxes for just the masked points.

Implements casa::PlotMaskedPointData.

bool casa::PlotMSIndexer::maskedMinsMaxesRaw ( double &  xMin,
double &  xMax,
double &  yMin,
double &  yMax 
)

Access to raw min/max data (no auto-global)

bool casa::PlotMSIndexer::minsMaxes ( double &  xMin,
double &  xMax,
double &  yMin,
double &  yMax 
) [virtual]

Gets the minimum and maximum values.

Returns false for error.

Implements casa::PlotPointData.

Int casa::PlotMSIndexer::nChunk ( ) const [inline, private]

void setCollapser(CollapseMethPtr& collmethod, PMS::Axis axis);

Generate collapsed versions of the plmask Report the number of chunks

Definition at line 184 of file PlotMSIndexer.h.

References casa::PlotMSCacheBase::nChunk(), and plotmscache_.

Definition at line 114 of file PlotMSIndexer.h.

References nCumulative_.

Report per-chunk point counters.

Definition at line 113 of file PlotMSIndexer.h.

References nPoints_.

unsigned int casa::PlotMSIndexer::numBins ( ) const

PlotBinnedData methods.

Double casa::PlotMSIndexer::refTime ( ) [inline, private]

Report the reference time for this cache (in seconds)

Definition at line 187 of file PlotMSIndexer.h.

References plotmscache_, and casa::PlotMSCacheBase::refTime().

void casa::PlotMSIndexer::reportMeta ( Double  x,
Double  y,
Bool  masked,
stringstream &  ss 
)

Report meta info for current value of currChunk_/irel_.

void casa::PlotMSIndexer::setChunk ( uInt  i) const [private]

Set currChunk_ according to a supplied index.

void casa::PlotMSIndexer::setDeleteData ( bool  del = true) [inline, virtual]

Sets whether this object will delete its underlying data structures upon deconstruction or not.

Implements casa::PlotData.

Definition at line 70 of file PlotMSIndexer.h.

void casa::PlotMSIndexer::setGlobalMinMax ( Bool  globalX = False,
Bool  globalY = False 
) [inline]

Set global min/max flag.

Definition at line 109 of file PlotMSIndexer.h.

References globalXMinMax_, and globalYMinMax_.

void casa::PlotMSIndexer::setIndexer ( IndexerMethPtr indexmethod,
PMS::Axis  axis 
) [private]
void casa::PlotMSIndexer::setMethod ( CacheMemPtr getmethod,
PMS::Axis  axis 
) [private]

Set up indexing for the plot.

unsigned int casa::PlotMSIndexer::size ( ) const [virtual]

Implemented PlotPointData methods.

Implements casa::PlotPointData.

unsigned int casa::PlotMSIndexer::sizeMasked ( ) const [inline, virtual]

Unimplemented PlotMaskedPointData methods.

Implements casa::PlotMaskedPointData.

Definition at line 92 of file PlotMSIndexer.h.

References sizeMasked_.

unsigned int casa::PlotMSIndexer::sizeUnmasked ( ) const [inline, virtual]

Returns the number of unmasked points.

Implements casa::PlotMaskedPointData.

Definition at line 93 of file PlotMSIndexer.h.

References sizeUnMasked_.

bool casa::PlotMSIndexer::unmaskedMinsMaxes ( double &  xMin,
double &  xMax,
double &  yMin,
double &  yMax 
) [virtual]

Gets the mins/maxes for just the unmasked points.

Implements casa::PlotMaskedPointData.

bool casa::PlotMSIndexer::unmaskedMinsMaxesRaw ( double &  xMin,
double &  xMax,
double &  yMin,
double &  yMax 
)
bool casa::PlotMSIndexer::willDeleteData ( ) const [inline, virtual]

Implemented PlotData methods.

Implements casa::PlotData.

Definition at line 69 of file PlotMSIndexer.h.

void casa::PlotMSIndexer::xAndYAt ( unsigned int  index,
double &  x,
double &  y 
) const [virtual]

IMPLEMENTED METHODS //.

Gets the x and y values at the given index. Default implementation just calls xAt and yAt, but in subclasses where performance could be gained, this method should be overridden. Implementations for plots that use PlotPointData should use this method by default in case there are performance gains.

Reimplemented from casa::PlotPointData.

double casa::PlotMSIndexer::xAt ( unsigned int  i) const [virtual]

Returns the x value at the given index.

Implements casa::PlotPointData.

void casa::PlotMSIndexer::xyAndMaskAt ( unsigned int  index,
double &  x,
double &  y,
bool &  mask 
) const [virtual]

IMPLEMENTED METHODS //.

Gets the x and y values and the mask at the given index. See PlotPointData::xAndYAt().

Reimplemented from casa::PlotMaskedPointData.

double casa::PlotMSIndexer::yAt ( unsigned int  i) const [virtual]

Returns the y value at the given index.

Implements casa::PlotPointData.


Member Data Documentation

Definition at line 236 of file PlotMSIndexer.h.

Definition at line 236 of file PlotMSIndexer.h.

Convenient access to class name.

Definition at line 53 of file PlotMSIndexer.h.

Definition at line 220 of file PlotMSIndexer.h.

CollapseMethPtr collapseXMask_, collapseYMask_;.

The in-focus chunk and relative index offset

Definition at line 224 of file PlotMSIndexer.h.

PMS::Axis casa::PlotMSIndexer::currentX_ [private]

Current setup/state.

Definition at line 239 of file PlotMSIndexer.h.

PMS::Axis casa::PlotMSIndexer::currentY_ [private]

Definition at line 239 of file PlotMSIndexer.h.

Int casa::PlotMSIndexer::currSeg_ [mutable, private]

Definition at line 235 of file PlotMSIndexer.h.

Definition at line 219 of file PlotMSIndexer.h.

Pointers to methods for axis flexibility.

Definition at line 219 of file PlotMSIndexer.h.

Definition at line 219 of file PlotMSIndexer.h.

Definition at line 251 of file PlotMSIndexer.h.

Referenced by setGlobalMinMax().

Definition at line 251 of file PlotMSIndexer.h.

Referenced by setGlobalMinMax().

Definition at line 246 of file PlotMSIndexer.h.

Referenced by getIndex0001().

Definition at line 243 of file PlotMSIndexer.h.

Referenced by getIndex0010().

Definition at line 245 of file PlotMSIndexer.h.

Referenced by getIndex0110().

Definition at line 243 of file PlotMSIndexer.h.

Referenced by getIndex0100().

Indexing parameters.

Definition at line 243 of file PlotMSIndexer.h.

Referenced by getIndex1000().

Definition at line 243 of file PlotMSIndexer.h.

Referenced by getIndex1110().

Definition at line 240 of file PlotMSIndexer.h.

Referenced by indexerReady().

Int casa::PlotMSIndexer::irel_ [mutable, private]

Definition at line 224 of file PlotMSIndexer.h.

Iteration.

Definition at line 255 of file PlotMSIndexer.h.

PMS::Axis casa::PlotMSIndexer::iterAxis_ [private]

Definition at line 256 of file PlotMSIndexer.h.

Definition at line 257 of file PlotMSIndexer.h.

Colorization.

Definition at line 262 of file PlotMSIndexer.h.

Definition at line 263 of file PlotMSIndexer.h.

uInt casa::PlotMSIndexer::lasti_ [mutable, private]

Definition at line 225 of file PlotMSIndexer.h.

The cumulative running total of points.

Definition at line 231 of file PlotMSIndexer.h.

Referenced by nCumulative().

Definition at line 236 of file PlotMSIndexer.h.

Definition at line 244 of file PlotMSIndexer.h.

Referenced by getIndex0001().

Definition at line 244 of file PlotMSIndexer.h.

Referenced by getIndex0010(), and getIndex1010().

Definition at line 244 of file PlotMSIndexer.h.

Referenced by getIndex0100(), getIndex0110(), and getIndex1010().

The number of points per chunk.

Definition at line 228 of file PlotMSIndexer.h.

Referenced by nPoints().

Segment point-counting Vectors.

Definition at line 234 of file PlotMSIndexer.h.

Definition at line 236 of file PlotMSIndexer.h.

Private data.

Parent plotms.

Definition at line 216 of file PlotMSIndexer.h.

Referenced by nChunk(), and refTime().

Cope with const-ness in the get methods.

Definition at line 267 of file PlotMSIndexer.h.

Definition at line 250 of file PlotMSIndexer.h.

Referenced by sizeMasked().

Definition at line 250 of file PlotMSIndexer.h.

Referenced by sizeUnmasked().

Definition at line 249 of file PlotMSIndexer.h.

Definition at line 249 of file PlotMSIndexer.h.

Definition at line 220 of file PlotMSIndexer.h.

Definition at line 249 of file PlotMSIndexer.h.

Nominal axes limits.

Definition at line 249 of file PlotMSIndexer.h.

Definition at line 249 of file PlotMSIndexer.h.

Definition at line 249 of file PlotMSIndexer.h.

Definition at line 220 of file PlotMSIndexer.h.

Definition at line 249 of file PlotMSIndexer.h.

Definition at line 249 of file PlotMSIndexer.h.


The documentation for this class was generated from the following file: