29 #ifndef TRIALDISPLAY_MSASRASTER_H
30 #define TRIALDISPLAY_MSASRASTER_H
207 return std::vector<int>( );
282 if(oldUIBase !=
uiBase()) {
297 bool flag(
WorldCanvas *wc,
double blc_x,
double blc_y,
double trc_x,
double trc_y );
436 return a1*(
nAnt_+2) - a1*(a1+1)/2 + a2-a1;
564 return remainder(v-180., 360.);
1282 return (strt<=pos && pos<fin);
void createDisplaySlice_()
retrieve (2D) slice data casacore::Matrix, and corresponding mask/flag matrices, to send to the displ...
casacore::Bool inLoopRange(casacore::Int ax, casacore::Int pos)
Is the given position in the 'loop range' on the given axis?
A Vector of integers, for indexing into Array<T> objects.
DParameterChoice * itsEditEntireMS
defines the button for undoing all edits.
casacore::Vector< casacore::Int > scan_
indexed as time_ is, above.
casacore::Vector< casacore::uInt > flags_
defines the button for saving all edits.
virtual void notifyUnregister(WorldCanvasHolder &wch, casacore::Bool ignoreRefresh=false)
ignoreRefresh tells the DD not to refresh just to clean up DMs
casacore::Array< casacore::Float > vis_
The visibility hypercube.
casacore::Bool saveEdits_()
Save all edits permanently to the MS.
Class providing active behaviour for 2d CachingDisplayDatas.
bool freqAxis(Axis) const
represent channels with their frequency?
Assistance class for auto-caching of DisplayData objects.
casacore::Double time
An MSpos_ holds information about a given position of interest within the main casacore::MS visibilit...
virtual casacore::Bool setActiveZIndex_(casacore::Int zindex)
This routine is called to inform the DD of the current canvas's animator index.
static const VisComp AMPRMS
casacore::Vector< casacore::Int > field_
only first msShape_TIME) are valid.
static const VisComp IMAGINARY
casacore::Int sT_
This really should be a return value from v_(); placed here for 'efficiency'.
Class for displaying data within an casacore::MS as a raster (gridded) image.
Class which stores WorldCanvas refresh event information.
DParameterChoice * itsYAxis
void setp(casacore::Int p)
casacore::Vector< casacore::Int > ant2len_
DParameterButton * itsUndoAll
defines the button for undoing one edit.
casacore::Vector< casacore::Int > a1A_
casacore::Vector< casacore::String > polName_
size_t nelements() const
How many elements does this array have? Product of all axis lengths.
static const VisComp REAL
std::complex< Float > Complex
casacore::Vector< casacore::Int > a1L_
void constructParameters_()
Construct and destroy the user option DisplayParameters.
MSAsRasterDM(WorldCanvas *wc, AttributeBuffer *wchAttrs, AttributeBuffer *ddAttrs, CachingDisplayData *dd)
Constructor.
casacore::Bool appliesTo(Axis ax, casacore::Int pos)
Does edit apply to given position on given axis?
void resetFreq_()
Reset casacore::Block of relevant Spectral window IDs, and return correponding Vectors of channel fre...
casacore::Int c(casacore::Int ch)
Axis dispX_
display canvas.
DParameterChoice * itsVisType
changes to these options require data extraction:
Colormap flagCM_
A private internal colormap for showing colors for various conditions (flagged, no data...
casacore::Bool dispFlagsInClr_
will overlay the main data array to show flags in color.
std::vector< int > displayAxes() const
static const VisDev INVALID_VD
casacore::Vector< casacore::Int > nPolsIn_
(and the size of the next two vectors).
casacore::IPosition dPos_
DParameterChoice * itsParamSpectralUnit
Units of display for Channels.
static casacore::Float imag(const casacore::Complex &val)
virtual void setDefaultOptions()
set all options to default values (unused so far; incomplete support in base classes...incomplete here as well).
casacore::Block< casacore::Int > pos_
permutation of (TIME, BASELN, CHAN, POL, SP_W), corresponding to the axis to display or control on X...
virtual casacore::uInt nelements(const WorldCanvasHolder &) const
Return the number of display elements (ie.
casacore::Float dev_(casacore::Int t)
Return the visibility deviation for the time slot t.
casacore::Vector< casacore::Int > a2L_
void reSortVis_()
Shuffle vis_ into new baseline order, per user request for sort change.
DParameterRange< casacore::Int > * itsSL0Pos
Which slice to display, for the other two axes.
virtual void purgeCache(const WorldCanvasHolder &wch)
Empty cache of all DMs for a given WCH.
virtual void purgeCache()
Empty cache completely.
DisplayDataType
WorldCanvasHolder - what type of DisplayData is this, need to know for drawing order.
DParameterChoice * itsBslnSort
Baseline sort (antenna1-antenna2 vs.
Buffer for storing Attributes.
std::list< void * > flagEdits_
void sett(casacore::Int t)
static const Axis TIME
The visibility hypercube (vis_) has 5 axes, in this order.
DParameterRange< casacore::Float > * itsDataMin
Sent to scale handler for scaling data to color within these limits.
DParameterRange< casacore::Float > * itsDataMax
VisComp visCompNum_(const casacore::String &visCompName) const
WorldAxesDD itsAxisLabeller
This labels the axes.
static const casacore::Float NODATA
void resize(size_t n, Bool forceSmaller=False, Bool copyElements=True)
Resizes the Block.
casacore::Int nAnt_
not draw until this is set true (in selectVS_).
DParameterRange< casacore::Int > * itsNAvg
how many values to use (ideally) in moving averages.
virtual casacore::Bool labelAxes(const WCRefreshEvent &ev)
Handle axis labelling.
void setc(casacore::Int c)
MSAsRaster & operator=(const MSAsRaster &)
casacore::Matrix< casacore::Float > disp_
visibility deviations are being displayed.
size_t nelements() const
The number of elements contained in this Block<T>.
casacore::Vector< casacore::String > fieldName_
ABSTRACT TOOL CLASSES A PlotTool is a higher level event handler for a PlotCanvas The idea is to take common tasks which may require multiple events and put them in one place PlotTools also provide additional functionality in that they can be active and blocking non blocking The PlotCanvas will only send events to active and will not send events to later tools or event handlers if the latest tool was blocking In this way a single tool can be used to handle ALL user interaction via the GUI at one time
static casacore::Float real(const casacore::Complex &val)
Helper functions.
virtual void setUIBase(casacore::Int uibase)
casacore::Block< casacore::Bool > flagAll_
void resetMinMax_()
Reset data scaling DParameters to newly-computed data ranges.
virtual casacore::Bool drawIntoList(Display::RefreshReason reason, WorldCanvasHolder &wcHolder)
The base CachingDM takes care of using any cached drawlist.
casacore::Float dataRngMax_
casacore::Float vAlt_(casacore::Float v)
Phase deviations are calculated both for the original phases (in [-180,180]), and for the phases 180 ...
casacore::Bool dispValid_
represents, by Axis.
std::string errorMessage() const
casacore::Matrix< casacore::Float > dispDev_
NOT_LOADED value?
static const VisType NTYPES
const casacore::IPosition dataShape() const
void postEditsToDisp_()
Assure that the display matrices are up-to-date with the flagging edits list, to provide visual feedb...
casacore::Matrix< casacore::Float > dispFlags_
good data from flagged/missing data.
casacore::Int bsln_(casacore::Int a1, casacore::Int a2) const
Return baseline index (for the ant1-ant2 sort only) from antenna numbers.
casacore::Vector< casacore::Int > a2A_
VisDev dispDevType_
(if necessary) the state of flag edits?
casacore::ImageStatistics< casacore::Float >::stat_list stats_t
bool adjustAvgRange(VisDev newstate, casacore::Record &outrec, bool force=false)
casacore::Int spw_(casacore::Int spwid)
Translate actual spectral window ID into the 'spw' index (zero-based pixel coordinate) along the spec...
void computeVisShape_(casacore::Block< casacore::Int > &visShp, casacore::Block< casacore::Int > &visShpA)
Compute vis_ array dimensions which fit into allowed memory.
casacore::Matrix< casacore::Int > bslL_
casacore::String msName_
--—primary user input data----------------------------------------—
static casacore::Int ind_(const casacore::String &name, const casacore::Vector< casacore::String > &names)
Generic string-to-index converter...
virtual casacore::String showValue(const casacore::Vector< casacore::Double > &world)
casacore::Format the data value at the given world position.
DParameterChoice * itsFlagColor
position being viewed as much as possible when casacore::MS selection is changed–e.g., to remain on the same time (if it is still in the selected casacore::MS), even though its time-slot index (slice position) may have changed.
void setFlag_(casacore::IPosition &slot, casacore::Bool flag)
DParameterChoice * itsVisComp
Which real visibiliy component to display: Real, Imag, Amp, Phase.
casacore::Block< casacore::Int > visStart_
casacore::Matrix< casacore::Double > chanFreq_
static const casacore::Float NOT_LOADED
to stand for 'no data in the selected casacore::MS at this position in the visibility cube'...
FlagEdit_(MSAsRaster *m)
edit applies to the row's time and baseline – tested elsewhere), then the visibilities in the casacor...
casacore::String avgPos(const casacore::String &dim, int v)
Constructs position information for non-deviation display state averaging...
casacore::Bool unflag
Note that all[axis] will imply start[axis]==0 && shape[axis]==msShape_[axis], but not vice-versa...
virtual casacore::Bool conformsToCS(const WorldCanvas &wc)
Determine whether DD is compatible with the WC[H]'s current world coordinates.
casacore::Vector< casacore::String > visCompName_
const MSAsRaster * m
IMO, a nested struct/class should have visibility (and access permission(?)) into the nesting class...
casacore::Vector< casacore::Double > time_
The A and L versions are for antenna and length sorts, respectively; they are copied into a1_...
casacore::Int sPol
at least some of the pols and channels implied by the chunk's data description ID?
DParameterChoice * itsXAxis
Which axes will be on X, Y, Animator.
casacore::Bool draw_(Display::RefreshReason reason, WorldCanvasHolder &wch, WorldCanvas &wc)
Actually do the drawing.
DParameterButton * itsUndoOne
casacore::Vector< casacore::Int > polId_
within msShape_[POL] and its index within the casacore::MS table's visibility data cell...
casacore::Bool isCSmaster(const DisplayData *dd) const
Is the specified DisplayData the one in charge of WC state? (During DD::sizeControl() execution...
virtual AttributeBuffer optionsAsAttributes()
Return the current options of this DisplayData as a 'restrictions' AttributeBuffer (only options that...
virtual WorldCanvas * worldCanvas()
Return the WorldCanvas recorded in this CachingDisplayMethod.
casacore::Bool msselValid_
casacore::Double a1mult_()
Subsidiary routine for above, determines (in effect) how many decimal places are needed for an antenn...
void set(const casacore::Block< casacore::Int > &pos)
Translation methods (for times, baselines, channels, spectral windows, and polarizations).
static const VisComp AMPLITUDE
MSAsRaster(const MSAsRaster &other)
casacore::Bool appliesTo(casacore::IPosition pos)
Does edit apply to given hypercube position (relative to entire casacore::MS)? (pos must be NAXES in ...
casacore::MeasurementSet * itsMS
-—current state of main internal data: what is already computed-—
MSAsRasterDM & operator=(const MSAsRasterDM &)
casacore::Int b(casacore::Int a1, casacore::Int a2)
casacore::Float devRngMax_
casacore::Bool entireAnt_
choice box for applying edits to entire antenna.
virtual casacore::Bool zIndexHint(casacore::Int &preferredZIndex) const
Return the animator position setting preferred if this DD about to be registered on a new DisplayPane...
casacore::Bool visValid_
gridded casacore::MS visibilities (for t, bsl, chan, pol, spw, in that order).
casacore::String visMbLabel_()
A small routine to return the label for the "Visibility Memory" slider widget.
DParameterRange< casacore::Int > * itsSL1Pos
void setDefaultMSAROptions_()
set/restore default option values on this level only.
MSpos_(const MSAsRaster *msar)
time-slot indices).
static const casacore::Float NEWFLAG
casacore::uInt dataDim() const
casacore::Vector< casacore::Int > a1_
numbers (symmetric, 0 along diagonal).
casacore::Bool undoEdits_(casacore::String extent="all", casacore::Bool feedback=false)
Undo unsaved edits.
casacore::Bool visDataChg_
in effect when dispDev_ was last computed.
casacore::Int maxframes_(const casacore::Block< casacore::Int > &frames, casacore::Int &strtfrm, casacore::Int nfrms)
Return the maximum number of the given (sorted) animation frames that can be displayed from a window ...
casacore::Bool flagsInClr_
casacore::Bool dispNotLoaded_
called?
static const VisComp PHRMS
static const casacore::Int INVALID
=================== casacore::Data ======================= (mostly) ========
casacore::ROMSColumns * msCols_
(should be set true (permanently) during construction, or this object will be useless, and do nothing).
A DisplayData to setup a World coordinate plot.
bool flag(WorldCanvas *wc, double blc_x, double blc_y, double trc_x, double trc_y)
added to allow flagging control from mouse tools...
virtual CachingDisplayMethod * newDisplayMethod(WorldCanvas *worldCanvas, AttributeBuffer *wchAttributes, AttributeBuffer *ddAttributes, CachingDisplayData *dd)
return a new MSAsRasterDM for the given WorldCanvas.
Base class for auto-caching DisplayData objects.
virtual void setUIBase(casacore::Int uibase)
DD 'Absolute Pixel Coordinates', e.g.
casacore::Vector< casacore::Int > nChan_
casacore::Vector< casacore::Int > a2_
static const VisComp PHDIFF
static const VisType CORRECTED
A class to provide easy read-only access to MeasurementSet columns.
casacore::Bool inSureRange(Axis ax, casacore::Int pos)
Is the given position within the range above, on the given axis?
casacore::Matrix< casacore::Int > bslA_
static const VisType OBSERVED
Class describing the most basic event information in the display classes.
casacore::Block< casacore::Int > shape
MSAsRasterDM()
Default and copy constructors, and the assignment operator, are mon-functional and should not be used...
void getSureRange(Axis ax, casacore::Int &strt, casacore::Int &fin)
Return the range (half-open interval) over which the edit definitely applies*, on the given axis...
WCPowerScaleHandler itsPowerScaleHandler
Saved state from the last call to dev_().
void findRanges_()
find the ranges of the casacore::MS selection (VisSet) for the 5 hypercube axes
virtual ~MSAsRaster()
Destructor.
casacore::Block< casacore::Int > spwId_
casacore::Float devRngMin_
Used (only) for scaling data values to colors; they are too expensive to compute except during extrac...
static const VisComp AMPDIFF
casacore::Bool operator==(FlagEdit_ &other)
casacore::Int dispDevNAvg_
represents.
A hierarchical collection of named fields of various types.
bool Bool
Define the standard types used by Casacore.
void a1a2_(casacore::Double &a1, casacore::Double &a2, casacore::Double bsl, casacore::Int abase=0) const
A corresponding inverse, this handles non-integer 'baseline indices'.
Rastered data - should go first.
DParameterButton * itsSaveEdits
choice box for using entire casacore::MS (vs.
casacore::Matrix< casacore::Double > bLen_
sorted by antenna1-antenna2.
casacore::Vector< casacore::Int > lsvTime_
virtual void notifyRegister(WorldCanvasHolder *wch)
Needed to enable or destroy drawlists and colormaps on corresp.
casacore::Block< casacore::Int > dispPos_
virtual ~MSAsRasterDM()
Destructor.
casacore::Block< casacore::Int > visShapeA_
static const VisComp NCOMPNAMES
casacore::Bool applies2(Axis ax, casacore::Int pos)
Same as above, but for use (only) where inLoopRange(ax, pos) is already known to be true...
virtual casacore::Int uiBase() const
DD 'Absolute Pixel Coordinates', e.g.
MSAsRasterDM(const MSAsRasterDM &other)
DParameterChoice * itsEntireAnt
no checkbox-type DParameter yet).
MSpos_(const MSAsRaster *msar, const casacore::Block< casacore::Int > &pos)
Construct MSpos_ according to 5-element casacore::Block corresponding to a position within the intern...
Implementation of DisplayParameter to store choice parameters.
void extract_()
Extract the hypercube buffer of visibilities for the requested casacore::MS selection and axis settin...
virtual casacore::Record getOptions(bool scrub=false) const
Retrieve the current options.
casacore::Int operator[](Axis ax)
void computeTimeBoxcars_()
compute the lsTime_ and leTime_ vectors, which define the 'local neighborhoods' around each given tim...
virtual Display::DisplayDataType classType()
Return the type of this DisplayData.
A Table intended to hold astronomical data (a set of Measurements).
casacore::Block< casacore::Int > visShape_
virtual casacore::Bool setOptions(casacore::Record &rec, casacore::Record &recOut)
Apply option values stored in rec to the DisplayData.
void setBslSort_()
Set the baseline index translation Arrays a1_, a2_ and bsl_ by copying as appropriate according to th...
DisplayData * parentDisplayData()
Return the parent DisplayData.
static const casacore::Int NCOLORS
casacore::Bool zIndexConformed_
casacore::Float v_(casacore::Int t)
Return a single visibility point from vis_ or disp_, as a function of time slot only.
casacore::Vector< casacore::Int > lsTime_
(<void*> rather than <FlagEdit_*> just to avoid the extra templates)
DParameterRange< casacore::Int > * itsVisMb
User option DisplayParameters specific to MSAsRaster.
casacore::Int nframes_(const casacore::Block< casacore::Int > &frames, casacore::Int strtfrm, casacore::Int nfrms, casacore::Int &margin)
Return how many of the given (sorted) animation frames can be displayed from a given window (strtfrm...
casacore::uInt dispNEdits_
draw flags in color?
casacore::String dataType() const
Pure virtual function from DisplayData...
VisibilityIterator * wvi_p
casacore::Bool appChunk
The following are set by appliesToChunk(spw, nChan, pol0, nPol) at the beginning of each chunk...
DParameterChoice * itsZAxis
casacore::Bool goodData_
Initializing input to dev_(t) and its subsidiary routine v_(t).
casacore::Block< casacore::Int > msShapeA_
= {nTime, nBsln, nChan, nPol, nSpw}.
static const VisType INVALID_VT
virtual casacore::uInt nelements() const
return the size of the animation axis.
virtual casacore::Bool canLabelAxes() const
DisplayCoordinateSystem setCS_()
update/set the (2d–canvas) coordinate system from the current MS selection and display axes...
virtual void handleEvent(DisplayEvent &ev)
handle flagging region selection events, via new-style (1/02) interface.
Axis axisNum_(const casacore::String &axisName) const
...applied to 3 of the 'enums' used internally.
RefreshReason
Callback reasons for PCRefreshEvent and WCRefreshEvent.
casacore::Block< casacore::Int > msShape_
of the set of antennas appearing in mssel_ main data rows.
Describes a method of generating a table of colors.
casacore::Vector< casacore::Int > leTime_
Base class for all Casacore library errors.
virtual casacore::String showPosition(const casacore::Vector< casacore::Double > &world, const casacore::Bool &displayAxesOnly=false)
casacore::Format the position of the cursor.
A holder to interface between DisplayDatas and a WorldCanvas.
casacore::MS * mssel_
which will then be used instead of the DATA column).
Implementation of drawing in world coordinates on top of a PixelCanvas.
casacore::Bool flag_(casacore::IPosition &slot)
Return or set a flag within the bitmapped flags_ vector, as if it were a 5-axis casacore::Array<casac...
void initMSAR_(const viewer::DisplayDataOptions &ddo)
Initialization common to all useful constructors.
static const VisComp INVALID_VC
GUI choice box (itsVisComp).
casacore::Vector< casacore::Int > spwIds_
static const VisComp NCOMPS
casacore::Bool dispDevValid_
data displays.
casacore::Int nDAvg_
visComp_ and visDev_.
MSAsRaster()
Default and copy constructors, and the assignment operator, are non-functional and should not be used...
casacore::Vector< casacore::Int > axisOn_
-—derived from above: what is now requested--------------------—
casacore::Int p0(casacore::Int pid)
static const Axis INVALID_AXIS
casacore::Int AxisLoc
Each axis can placed on the canvas display (X or Y), the animator (Z), or on one of 2 auxiliary slide...
casacore::Block< casacore::Int > start
VisType curVisType_
BASELN axis, and then only when computeVisShape_() determines that the entire msShapeA_[BASELN] will ...
static const VisType RESIDUAL
casacore::Int c(casacore::Int sid, casacore::Int ch)
void getLoopRange(casacore::Int ax, casacore::Int &strt, casacore::Int &fin)
Retrieve ranges for loops.
String: the storage and methods of handling collections of characters.
casacore::Block< casacore::Bool > all
All 3 of these Blocks are indexed by Axis, and have NAXES elements.
casacore::Bool useVis_
Beginning and (1 beyond) ending time index defining the 'boxcar' or local neighborhood over which ave...
void createDevSlice_()
Create dispDev_ casacore::Matrix for displaying deviations.
casacore::Int activeZIndex_
Indicates the 'current' animation frame, i.e.
casacore::Vector< casacore::Int > pidBase_
static const casacore::Float OLDFLAG
static const VisDev NORMAL
static const casacore::Float NO_DATA
static const casacore::Float INSUF_DATA
Very similar, but used only in the disp_ array, for data which is not loaded into memory (vis_) at pr...
void computeBaselineSorts_()
Called from findRanges_(), computes translation matrices between antenna1,antenna2 and baseline index...
casacore::Matrix< casacore::Bool > dispMask_
from the casacore::MS (only); not for new, unsaved flags.
VisibilityIterator iterates through one or more writable MeasurementSets.
casacore::Block< void * > freq_
The user can select the spectral windows to view.
(Minimal) DisplayMethod for MSAsRaster.
casacore::Vector< casacore::Int > fieldIds_
void sets(casacore::Int s)
casacore::Int t(casacore::Double tm)
casacore::MS values to hypercube indices.
casacore::Matrix< casacore::Int > bsl_
casacore::Bool antSort_
axis when baselines are sorted by length (antSort==false).
casacore::Vector< casacore::Int > levTime_
static const VisType MODEL
void setb(casacore::Int b)
virtual const casacore::String & name() const
In case it helps; the method should probably be called only before we've had a chance to cache anythi...
void addEdit_(WorldCanvas *wc, casacore::Int xStart, casacore::Int xShape, casacore::Int yStart, casacore::Int yShape)
Add the edit request that just came in (from the mouse, via handleEvent) to the flagEdits_ casacore::...
VisType visTypeNum_(const casacore::String &visTypeName) const
virtual void purgeCache()
Empty cache completely.
DParameterChoice * itsAxisLabelling
Axis Labelling? (Yes/No).
DParameterChoice * itsUnflag
casacore::Int s(casacore::Int sid)
casacore::Vector< casacore::String > visTypeName_
casacore::Float dataRngMin_
Linear, logarithmic and exponential scaling of data for the WorldCanvas.
static const AxisLoc NLOCS
casacore::Vector< casacore::Int > len2ant_
casacore::Int nPolIds_
(*freq_[spw])[chan] holds the CHAN_FREQ for the given spw index and channel (in Hz).
static const VisComp PHASE
static const casacore::Float NOTLOADED
Also similar.
casacore::Bool postDataRng_
do not reflect current state of vis_.
void selectVS_(const viewer::DisplayDataOptions &ddo=viewer::DisplayDataOptions())
prepare the selection casacore::MS and its VisSet.
casacore::Int b(casacore::Int fd)
VisType visType_
Zero-based (although the user sees 1-based values).
virtual const casacore::Unit dataUnit() const
get the casacore::Unit for displayed data values (visibilities)
casacore::Bool csConformed_
casacore::Bool appliesToChunk(casacore::Int pol0, casacore::Int nPol, casacore::Int spw, casacore::Int nChan)
Does the edit apply to the current casacore::MS iteration chunk?
casacore::Int ts
MSAsRaster tables which it set up in findRanges_: nAnt_, time_, spwId_, freq_, polId_, etc.
void computeDevRange_()
Calculate deviations throughout range of vis_.
casacore::Int p(casacore::Int pid, casacore::Int pnm)
casacore::Vector< casacore::String > axisName_
--—more constants and statics -------------------------------------—