27 #ifndef PLOTMSINDEXER_H_
28 #define PLOTMSINDEXER_H_
40 #include <unordered_map>
46 class PlotMSCacheBase;
66 PMS::DataColumn xData, PMS::Axis yAxis, PMS::DataColumn yData,
72 PMS::DataColumn xData, PMS::Axis yAxis, PMS::DataColumn yData,
91 unsigned int size()
const;
92 virtual double xAt(
unsigned int i)
const;
93 virtual double yAt(
unsigned int i)
const;
94 virtual void xAndYAt(
unsigned int index,
double& x,
double& y)
const;
95 bool minsMaxes(
double& xMin,
double& xMax,
double& yMin,
double& yMax);
100 bool maskedAt(
unsigned int index)
const;
101 virtual void xyAndMaskAt(
unsigned int index,
double& x,
double& y,
bool&
mask)
const;
108 bool maskedMinsMaxes(
double& xMin,
double& xMax,
double& yMin,
double& yMax);
115 unsigned int binAt(
unsigned int i)
const;
175 bool colorize(
bool doColorize, PMS::Axis colorizeAxis);
337 using RaDecMap = std::map<DirectionAxisParams,RaDecData>;
351 PMS::DataColumn xData, PMS::Axis yAxis, PMS::DataColumn yData,
353 bool timeconnect,
int index);
359 double xAt(
unsigned int i)
const;
360 double yAt(
unsigned int i)
const;
361 void xAndYAt(
unsigned int index,
double& x,
double& y)
const;
364 double& x,
double& y,
368 return *(
xRa_[chnk]->data()+irel);
371 return *(
yRa_[chnk]->data()+irel);
374 return *(
xDec_[chnk]->data()+irel);
377 return *(
yDec_[chnk]->data()+irel);
402 PMS::DataColumn xData, PMS::Axis yAxis, PMS::DataColumn yData,
404 bool timeconnect,
int index,
bool makeRaDecIndexer=
false);
casacore::Bool iterate_
Iteration.
casacore::Record locateInfo(const casacore::Vector< PlotRegion > ®ions, casacore::Bool showUnflagged, casacore::Bool showFlagged, casacore::Bool selectAll=true)
virtual void xyAndMaskAt(unsigned int index, double &x, double &y, bool &mask) const
IMPLEMENTED METHODS //.
casacore::Vector< casacore::Int > nperchan_
const bool yAxisIsRaOrDec_
CacheMemPtr getYFromCache_
bool maskedAt(unsigned int index) const
Implemented PlotMaskedPointData methods.
casacore::Int sizeMasked_
static const casacore::String CLASS_NAME
Convenient access to class name.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
casacore::Int getIndex1110(casacore::Int ch, casacore::Int irel)
casacore::String iterValue()
PMS::Axis currentX_
Current setup/state.
casacore::Double xmin_
Nominal axes limits.
PMS::DataColumn currentYdata_
static const int MSG_DEBUG
Miscellaneous debugging messages.
static const int MSG_ERROR
virtual double yAt(unsigned int i) const
Returns the y value at the given index.
PMS::Axis itsColorizeAxis_
casacore::Vector< casacore::Int > nperant_
static const int MSG_INFO
Static //.
casacore::Vector< casacore::Int > icorrmax_
Indexing parameters.
casacore::String itsXConnect_
Reindex and bin when connecting points.
casacore::Vector< casacore::Int > iantmax_
bool setConnect(casacore::String xconnect, bool timeconnect)
casacore::String iterLabel()
Iteration label.
CacheMemPtr getColFromCache_
casacore::Double refTime()
Report the reference time for this cache (in seconds)
unsigned int sizeUnmasked() const
Returns the number of unmasked points.
casacore::Int getIndex0110(casacore::Int ch, casacore::Int irel)
casacore::Vector< casacore::uInt > nCumulative_
The cumulative running total of points.
IndexerMethPtr ColIndexer_
bool itsColorize_
Colorization.
bool willDeleteData() const
Implemented PlotData methods.
void setGlobalMinMax(casacore::Bool globalX=false, casacore::Bool globalY=false)
Set global min/max flag.
PlotMSCacheBase * getCache()
PlotLogMessage * locateRange(const casacore::Vector< PlotRegion > ®ions, casacore::Bool showUnflagged, casacore::Bool showFlagged)
PlotMSRaDecIndexer()
Empty Indexer.
void setDeleteData(bool del=true)
Sets whether this object will delete its underlying data structures upon deconstruction or not...
unsigned int connectBinAt(unsigned int i) const
PlotMSIndexer()
A ctor that makes an empty Indexer (for plot initialization)
casacore::Double getRaY(casacore::Int chnk, casacore::Int irel) const
void setReady(bool isReady=true)
void setIndexer(IndexerMethPtr &indexmethod, PMS::Axis axis)
index for iteraxis
void log(const casacore::String &method, const casacore::String &message, int eventType)
Logs the given message from the given method name as the given event type (see PlotLogger).
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
void setChunk(casacore::uInt i, bool ignoreReindex=false) const
Set currChunk_ according to a supplied index.
casacore::Vector< casacore::uInt > nSegPoints_
casacore::Int(PlotMSIndexer::* IndexerMethPtr)(casacore::Int, casacore::Int)
void computeRanges()
Computes the X and Y limits for the currently set axes.
bool maskedMinsMaxes(double &xMin, double &xMax, double &yMin, double &yMax)
Gets the mins/maxes for just the masked points.
void logDebug(const casacore::String &method, const casacore::String &message)
std::map< DirectionAxisParams, RaDecData > RaDecMap
static const casacore::String CLASS_NAME
Convenient access to class name.
void setMethod(CacheMemPtr &getmethod, PMS::Axis axis, PMS::DataColumn data)
get method for x and y axes depends on column
casacore::Bool globalYMinMax_
void logWarn(const casacore::String &method, const casacore::String &message)
casacore::Vector< casacore::Int > idatamax_
Referenced counted pointer for constant data.
CacheMemPtr getXFromCache_
Pointers to methods for axis flexibility.
std::map< casacore::uInt, bool > freqsDecrease_
map<chunk, decrease> : frequencies decrease with channel in chunk (for reverseConnect) ...
void logInfo(const casacore::String &method, const casacore::String &message)
Convenience methods that call log() with the given method name and the appropriate event type...
unsigned int binAt(unsigned int i) const
bool unmaskedMinsMaxesRaw(double &xMin, double &xMax, double &yMin, double &yMax)
~PlotMSRaDecIndexer()
Destructor.
casacore::Int getIndex1000(casacore::Int ch, casacore::Int irel)
Specifies flagging parameters (including possibly flag extension) for an MS.
void reportMeta(casacore::Double x, casacore::Double y, casacore::Bool masked, std::stringstream &ss)
Report meta info for current value of currChunk_/irel_.
PlotMSCacheBase * plotmscache_
Private data.
virtual void xAndYAt(unsigned int index, double &x, double &y) const
IMPLEMENTED METHODS //.
casacore::Vector< casacore::uInt > cacheChunk_
void xAndYAt(unsigned int index, double &x, double &y) const
IMPLEMENTED METHODS //.
bool isGlobalYRange() const
casacore::Double getDecX(casacore::Int chnk, casacore::Int irel) const
void adjustYRangeForOverlay(double &yMin, double &yMax)
Adjust the Y range for overlays to make room at top of plot.
unsigned int size() const
Implemented PlotPointData methods.
casacore::Vector< casacore::uInt > nCumulPoints_
casacore::Int getIndex0000(casacore::Int ch, casacore::Int irel)
Directly implemented index calculators (generic index methods point to one of these depending upon ax...
casacore::Int getIndex0100(casacore::Int ch, casacore::Int irel)
void reindexForConnect()
Reindex for connecting points.
casacore::Vector< casacore::uInt > nPoints_
The number of points per chunk.
void logError(const casacore::String &method, const casacore::String &message)
const bool xAxisIsRaOrDec_
bool maskedMinsMaxesRaw(double &xMin, double &xMax, double &yMin, double &yMax)
Access to raw min/max data (no auto-global)
casacore::Double getDecY(casacore::Int chnk, casacore::Int irel) const
A hierarchical collection of named fields of various types.
bool Bool
Define the standard types used by Casacore.
casacore::Record getPointMetaData(casacore::Int i)
Locate datum nearest to specified x,y.
static bool axisIsUV(Axis axis)
for loading conjugates and setting axis ranges
virtual ~PlotMSIndexer()
Destructor.
PMS::DataColumn currentXdata_
casacore::Double(PlotMSCacheBase::* CacheMemPtr)(casacore::Int, casacore::Int)
casacore::Vector< casacore::uInt > cacheOffset_
void(PlotMSIndexer::* CollapseMethPtr)(casacore::Int, casacore::Array< casacore::Bool > &)
casacore::Int nSegment_
Segment point-counting Vectors.
static PlotMSIndexer * initIndexer(PlotMSCacheBase *plotmscache, PMS::Axis xAxis, PMS::DataColumn xData, PMS::Axis yAxis, PMS::DataColumn yData, PMS::Axis iterAxis, casacore::Int iterValue, casacore::String xconnect, bool timeconnect, int index, bool makeRaDecIndexer=false)
bool isGlobalXRange() const
A drop-in replacement for Block<T*>.
casacore::Int getIndex0010(casacore::Int ch, casacore::Int irel)
casacore::CountedPtr< PlotMSIndexer > PlotMSIndexerPtr
casacore::Bool indexerReady() const
Return if the indexer is ready (setUpPlot has been run)
casacore::Vector< casacore::Int > ichanmax_
unsigned int sizeMasked() const
Unimplemented PlotMaskedPointData methods.
void flagInCache(const PlotMSFlagging &flagging, casacore::Bool flag)
Set flags in the cache.
PlotLogMessage * flagRange(const PlotMSFlagging &flagging, const casacore::Vector< PlotRegion > ®ions, casacore::Bool flag=true)
bool colorize(bool doColorize, PMS::Axis colorizeAxis)
set colorize and whether binned data has coloraxis; connected points are binned too ...
bool unmaskedMinsMaxes(double &xMin, double &xMax, double &yMin, double &yMax)
Gets the mins/maxes for just the unmasked points.
casacore::Int getIndex0001(casacore::Int ch, casacore::Int irel)
casacore::Double computeBaselineLength(casacore::Int ant1, casacore::Int ant2)
Compute baseline's length in meters between ant1 and ant2.
casacore::Int sizeUnMasked_
bool isValid() const
ABSTRACT METHODS //.
static const RaDecData EMPTY_DATA
static const int MSG_WARN
casacore::String fileLabel()
bool plotConjugates() const
Returns whether to plot conjugate data (e.g.
casacore::Vector< casacore::Int > ibslnmax_
double yAt(unsigned int i) const
Returns the y value at the given index.
unsigned int numBins() const
PlotBinnedData methods.
String: the storage and methods of handling collections of characters.
virtual double xAt(unsigned int i) const
Returns the x value at the given index.
Superclass for all messages going through the PlotLogger.
casacore::Int nChunk() const
void setCollapser(CollapseMethPtr& collmethod, PMS::Axis axis);
virtual bool reverseConnect(unsigned int index) const
Returns whether data is plotted in reverse order (right to left), needed when connecting points...
casacore::Int currChunk_
CollapseMethPtr collapseXMask_, collapseYMask_;.
casacore::Vector< casacore::uInt > nPoints()
Report per-chunk point counters.
casacore::Data that adds masking functionality on top of normal point data.
void xyAndMaskAt(unsigned int index, double &x, double &y, bool &mask) const
IMPLEMENTED METHODS //.
double xAt(unsigned int i) const
Overridden PlotPointData methods.
bool minsMaxes(double &xMin, double &xMax, double &yMin, double &yMax)
Gets the minimum and maximum values.
casacore::Bool globalXMinMax_
casacore::Double getRaX(casacore::Int chnk, casacore::Int irel) const
casacore::Vector< casacore::uInt > nCumulative()
casacore::Int getIndex1010(casacore::Int ch, casacore::Int irel)
casacore::Vector< casacore::Int > nperbsln_
void setUpIndexing()
Set up indexing for the plot.
casacore::Vector< casacore::Int > ichanbslnmax_