Coverage for /home/warp/casa/atejeda/coverage/build/linux-x86_64/python/2.7/__casac__/msplot : 0%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# This file was automatically generated by SWIG (http://www.swig.org). # Version 2.0.4 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead.
from sys import version_info if version_info >= (2,6,0): def swig_import_helper(): from os.path import dirname import imp fp = None try: fp, pathname, description = imp.find_module('_msplot', [dirname(__file__)]) except ImportError: import _msplot return _msplot if fp is not None: try: _mod = imp.load_module('_msplot', fp, pathname, description) finally: fp.close() return _mod _msplot = swig_import_helper() del swig_import_helper else: import _msplot del version_info try: _swig_property = property except NameError: pass # Python < 2.2 doesn't have 'property'. def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name): if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError(name)
def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try: _object = object _newclass = 1 except AttributeError: class _object : pass _newclass = 0
class msplot(_object): """Proxy of C++ casac::msplot class""" __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, msplot, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, msplot, name) __repr__ = _swig_repr def __init__(self): """__init__(self) -> msplot""" this = _msplot.new_msplot() try: self.this.append(this) except: self.this = this __swig_destroy__ = _msplot.delete_msplot __del__ = lambda self : None; def open(self, *args, **kwargs): """ open(self, msname = string(""), dovel = False, restfreq = string(""), frame = string(""), doppler = string("")) -> bool
Summary
Set the measurement set to be plotted.
Description
Set the measurement set to be plotted. This method must be invoked before any of the other msplot ool\ functions.
Input Parameters: msname measurement set name, including path dovel whether to calculate velocity or not false restfreq a rest frequency quanta or transition name frame frequency frame for spectral axis doppler doppler mode
Example:
# Open a msplot tool with a measurment set mp.open( msname='./data/3C273XC1.ms' );
--------------------------------------------------------------------------------
""" return _msplot.msplot_open(self, *args, **kwargs)
def clearplot(self, subplot = 000): """ clearplot(self, subplot = 000) -> bool
Summary Clear the plotting window or a particular panel, or all panels.
Description
Clear the plotting window. Either clear the whole window (default) or a particular panel (specified by the subplot parameter).
Input Parameters: subplot Three (or four) digits number: first digit for nrows, second for ncols, the rest for pannel number. 000
Example:
# open a MS dataset, Plot the array on the left and uvcoverage on the # right. # Also set the X and Y axes labels, and the title, mp.open( msname='ngc5921.ms'); mp.plotoptions( subplot=121 ) mp.array() mp.plotoptions( subplot=122 ) mp.uvcoverage()
# Now clear the uvcoverage plot area and plot the uvdist instead. mp.clearplot( subplot=122 ) mp.uvdist()
# Now clear all plots mp.clearplot()
--------------------------------------------------------------------------------
""" return _msplot.msplot_clearplot(self, subplot)
def emperorsNewClose(self): """ emperorsNewClose(self) -> bool
Summary Like the Emperor's New Clothes.
Description
The mp.close() method has been a much contested method. With user's not really wanting to close things, but pretend to. So just to make all happy we have a much anticipated new close method, sure to bedazzle and shine!
Note that you may find the mp.reset function very useful for controlling the state of the msplot tool.
--------------------------------------------------------------------------------
""" return _msplot.msplot_emperorsNewClose(self)
def reset(self): """ reset(self) -> bool
Summary Reset the state of MS plot back to its default state.
Description
Reset the state of MS plot back to its default state. Calling this function will cause {f all} of the plot options to be reset to their default values, and to reset any data selection performed by the mp.setdata().
--------------------------------------------------------------------------------
""" return _msplot.msplot_reset(self)
def closeMS(self): """ closeMS(self) -> bool
Summary Close the measurement set being used.
Description
Close the measurement set being used. As a a side affect any data selections (via mp.setdata or mp.sespectral) are reset to their initial state, and the plot options (set via mp.plotoptions) are also set to their initial stat.
--------------------------------------------------------------------------------
""" return _msplot.msplot_closeMS(self)
def close(self): """ close(self) -> bool
Summary See done -- close and done do the same thing.
Description
See done
--------------------------------------------------------------------------------
""" return _msplot.msplot_close(self)
def done(self): """ done(self) -> bool
Summary Close the current MeasurementSet, and destroy the plotter -- ending all plotting.
Description
End the msplot tool
--------------------------------------------------------------------------------
""" return _msplot.msplot_done(self)
def plotoptions(self, *args, **kwargs): """ plotoptions(self, subplot = 111, plotsymbol = string(""), plotcolor = string(""), multicolor = string("none"), plotrange = string(""), timeplot = 'o', markersize = 8.0, linewidth = 1.0, overplot = False, replacetopplot = False, removeoldpanels = True, skipnrows = 1, averagenrows = 1, extendflag = string(""), connect = string("none"), showflags = False, title = string(""), xlabel = string(""), ylabel = string(""), fontsize = 14.0, windowsize = 1.0, aspectratio = 1.0) -> bool
Summary
Set the style of the plot.
Description
Set the style of the plot. This function allows the plot title, axis labels, font, plotting color, plot symbol and many, other aspects of the plot to be set by the user, giving the user much flexibility over the look of their plots.
The various aspects that can be controlled by the user are as follows: egin{itemize} \item{f Labels:} The title that appears at the top of the plot is controlled by the itle\ paramete'r. The label along the x-axis and y-axis are set using the {\it xlabel} and {\it ylabel} parameters. If no values are not provided by the user then these labels are constructed from the data selected to be plotted.
To control the font size of the labels use the {\it font} parameter. The x-axis and y-axis labels are always set to be 2pts. smaller then the title, which is set at the given font size specified.
\item{f Size Controls:} To control the size of the window, the {\it windowsize}, and {\it aspectratio} options can be set.
To control the range of points plotted use the {\it plotrange} option. This plot option accepts either time strings in the form YYYY/MM/DD/hh:mm:ss or real values.
\item{f Data Point Sytles:} There are a number of plotoptions for controlling the color and style of the points plotted.
The {\it plotsymbol} option set both the color and/or shape of the points plotted. It accepts the same syntax as that used by the {f pylab} plot function. There are six different colors used: 'k' black, 'r'ed, 'g'reen, 'b'lue, 'c'yan, 'y'ellow, wnd 'w'hite. The plotsymbols include, but are not limited to '+', 'o', '-', and '--'. For a full list see the
matplotlib documentation.
The {\it markersize} and {\it linewidth} options control how big the plot symbols/lines are.
The {\it multicolor} plot option is unique to CASA. It is used to specify whether or not different channels/correlations are plotted in different colors. The colors used can not be set by anyof the plot options. Basically, when plotting the colors are cycled through, changing whenever a different channel or correlation is encountered.
For large measurement sets it may be useful to plot only a portion of the measurment set. The {\it skipnrows} allows every nth row to be plotted rather then all of the plots.
\item{f Multiple plots:} One of the more useful abilities of the CASA plotters is the ability to plot several plot simultaneously, either side-by-side, and/or one on top of the other.
The {\it subplot} option determines the number of panels to create, each panel contains a plot of some data. Although the {\it subplot} option is a single integer, it is really treated as three separate integers: egin{itemize} \item {\it nrows}: number of rows of panels, \item {\it ncols}: number of columns of panels, and \item {\it panel}: the panel number, which panel to plot on. nd{itemize}
For example, {\it subplot=132} specifies that there are three panels side-by-side (three columns of panels), and that we are plotting on the second panel. The top, left corner panel is panel number 1, and the panel number increases to the right first, continuing on the next row when the end of a row is reached. The example section shows some examples that create a number of different panel arrangements.
Related to the multi-panel plots is the {\it removeoldpanels} option. This option when set to {\it True}, the default value, mimics the native matplot behviour, clearing any panels that lie partially or completely under a new panel being plotted. If it is set to {\it False} new panels could potentially plot overtop of old panels depending on the subplot values.
In addtions to having plots there is the ability to overplot. The {\it overplot} option when set to true will, instead of clearing the panel that is currently being plotted on, plot over what is already there. When {\it overplot} is set to true the next plot is plotted over top of what is already there, and if the {\it plotsymbol} has not been specified the {\it msplot} tool will automatically pick a different color to plot with. An example where this may be useful if plotting different spectral windows separately, but on the same plot.
Related to overplotting is the {\it replacetopplot} and {\it showflags} option. By default {\it replacetopplot} is set to {\it False}, but if it is set to {\it True} then only the last plot on a panel is replaced. This option comes in handy when a mistake has been made in the last plot. If the {\it showflags} option is set to {\it True} then the flagged data is plotted. A nice feature is the ability to plot the flagged and unflagged data on the same plot, by doing the same plot with both the {\it overplot} and {\it showflags} plot turned on. Note that flagged data is always plotted in a magenta color.
nd{itemize}
Input Parameters: subplot Three (or four) digits number: first digit for nx, second for ny, the rest for pannel number. 111 plotsymbol String specifying the colour to plot in, as well as the symbol to plot. This argument takes the same values as pylab plot command. Some of the valid symbols are: 'o', '+', ... plotcolor String specifying the colour to plot in. This can be one of the predefined pylab colour names. This over-rides the colour specified in plotsymbol. multicolor chan: means different channels in different colours, corr: means different correlations in different colours, both: means different correlations and channels in multicolour none: plot everything the same color. none plotrange Plot data within the specified range of values will be plotted. The range of values is given as a string in the form [xmin, xmax, ymin, ymax]. For most plots the xmin/max and ymin/max values are expected to be numeric values. However, for time plots, ie. where one or more of the axis is time, the xmin/max and ymin/max are expected to be strings in the from YYYY/MM/DD/hh:mm:ss. timeplot Indicate if the data is to be interpretted as time time values. Valid values are 'o'ff, 'x'-axis, 'y'-axis, 'b'oth axes. . 'o' markersize Specify the size (in pixels) of the markers being plotted. Markers are specified with the plotsymbol option. . 8.0 linewidth Occasionally lines, rather then points, are plotted. This option allows the width of the plotted lines to be specified in points (pixels). 1.0 overplot To do overplot or not. false replacetopplot true : when overplot=false, replace the top-most layer only false : overplot=false always creates a fresh stack of plots. false removeoldpanels true : mimic the native matplotlib behaviour of clearing up plots that lie partially or completely underneath a new panel. false : turn this feature off. Explicit mp.clearplot will then be required. This is provided to allow small plots to be inset into larger plot panels. true skipnrows Indicates how many points to skip when plotting, ie. it plots every nth point. 1 averagenrows Indicates how many rows to average when plotting, ie. average together every n rows. 1 extendflag A string contains flag extension code. Possible codes are: 'P' for correlation; 'C' for channel; 'B' for baseline; 'W' for spectral window; and 'T' for time. connect Indicates how to join point with lines when plotsymbol contains '-'. connect='none': points are not connected by lines. connect='row' : points are joined along time and baseline and each channel and correlation is a separate line. connect='chan': points are joined along channel. Each timestamp or baseline is a separate line. This is to be used in conjunction with 'averagenrows' or 'skipnrows' because for a large number of rows, it is inefficient. none showflags Indicates whether or not to plot flagged and unflagged data. False : plot only unflagged data True : plot only flagged data false title string for the title of the plot xlabel string for the X -label of the plot ylabel string for the Y -label of the plot fontsize font size of the labels for the plot 14.0 windowsize window size of the plot 1.0 aspectratio aspect ratio of the window size of the plot 1.0
Example:
# open a MS dataset, set the plot options. # Also set the X and Y axes labels, and the title, mp.open( msname='./data/3C273XC1.ms'); labels := ['Amplitude vs UVdist','uvdist','amplitude']; mp.plotoptions( windowsize=5,aspectratio=0.8, fontsize=14.0, xlabel='uvdist', ylabel='amplitude', title='Amplitude vs. UVdist', plotsymbol='g+' );
# Create 3 panels for plotting, and starting an iterative plot. Three # plots will be plotted for each iteration of the plot. mp.open( './data/ngc5921.ms') mp.plotoptions( subplot=311 ) mp.vischannel( column='data', what='amp', iteration='baseline' )
# Create 3 panels for plotting, but they are different sizes. # Two panels at the top, smaller with the array and uvcoverage plots. # A single wider panel at the bottom (the whole second row) containing # the uvdistance plot. The uvdistance plot, plots the corrected data # overtop of the actual data. mp.open( './data/ngc5921.ms'); mp.plotoptions( subplot=221 ); mp.array(); mp.plotoptions(subplot=222); mp.uvcoverage(); mp.plotoptions( subplot=212 ); mp.uvdist(); mp.plotoptions( overplot=1, plotcolor=3); mp.uvdist(column='corrected_data');
# Plot the flagged and unflagged data on the same plot, plotting the # visibility amplitude vs. the channel. mp.open(ngc5921PATH); mp.vischannel(); mp.plotoptions( showflags=1, overplot=1 ); mp.vischannel();
--------------------------------------------------------------------------------
""" return _msplot.msplot_plotoptions(self, *args, **kwargs)
def summary(self, selected = True): """ summary(self, selected = True) -> bool
Summary
List a short summary, description, of the data in the open measurment set.
Description
List a summary, description, of the selected data in the open measurment set.
The information that is displayed includes:
anntenna names field names scan numbers specral window list, including the number of channels for each one. correlations
Eventually the summary will include the time range and uv distance range as well.
Input Parameters: selected Determine if we print a summary of the selected (true) data or a summary of the full measurement set (false). true
Example:
# create a msplot tool and set the subset data for plotting. mp.open( msname='./data/3C273XC1.ms');
# View a summary of the whole measurement set. mp.summary( selected=false);
# View what we've selected. mp.setdata( 'spw=3~7', antenna='0~200' ); mp.summary( selected=true );
--------------------------------------------------------------------------------
""" return _msplot.msplot_summary(self, selected)
def setdata(self, *args, **kwargs): """ setdata(self, baseline = string(""), field = string(""), scan = string(""), uvrange = string(""), array = string(""), feed = string(""), spw = string(""), correlation = string(""), time = string("")) -> bool
Summary
Select a subset of the measurement set to operate on.
Description
Select a subset of the measurement set. All plots will operate on this subset of the measurement set based on the values given.
All of the {\it Index} fields expect lists of integers. All of the {\it Name} fields accept strings. Where both indices and expressions are allowed as inputs (antenna's for example), they will be combined together when selecting the data.
The expression strings contain values separated by ','. The wildcard character '*' can be used with the names. The '\>' and '\<' characters can be used to indicate values that are greater then, or less then (respectively) a particular value.
Note: that integer values in the antennaNames list will be interpreted as indices. The '~' indicates a range for values.
Spectral windows {\it names} are bit of a special case as channel information can be specified too. Spectral windows are in the folling format: (spwlist):(channellist) where the spetral window and channel list follow the expression conventions listed above. 'RR,LL,RL' '[RR LL RR]' '(XX)' where different types of polarizations are separated by a space or a comma.
Input Parameters: baseline Baseline selection expression. field Field selection string. scan Scan selection string. uvrange UV Range selection string. array Array selection string. feed Feed selection string. spw Spectral Window selection string. correlation Correlation selection string. time Time selection values are in the form: YYYY\/MM\/MM\/DD\/hh:mm:ss~YYYY\/MM\/DD\/hh:mm:ss\^step where the first or second term may be dropped, and more then one range may be specified. Ranges are separted by a ','. The step value is a real value representing the number of seconds to skip or average, depending on the value given.
Example:
# create a msplot tool and set the subset data for plotting. mp.open( msname='./data/3C273XC1.ms');
# Select all antenna's that begin with VLA or N, field 1,2 and 3, # 'RR' and 'LL' correlations, and spectral windows 3,4, and 5. mp.setdata( antennaNames='VLA:N*', fieldNames='1~3', correlations='RR, LL', spwIndex=[3,4,5] );
# Select all fields, LR correlations, uvdists greater than 125 kilolambda, # and times of June 27, 1989 at 3:31:40. mp.setdata( fieldNames'*', correlations='LR', uvDists='>125kl' times='1989/06/27/03:31:40' );
--------------------------------------------------------------------------------
""" return _msplot.msplot_setdata(self, *args, **kwargs)
def extendflag(self, *args, **kwargs): """ extendflag(self, extendcorr = string(""), extendchan = string(""), extendspw = string(""), extendant = string(""), extendtime = string("")) -> bool
Summary
Set the scope of flagging extension
Description
Set the scope of flagging extension
Input Parameters: extendcorr Indicate correlation based flagging extension. Valid values are: allhalf extendchan Indicate channel based flagging extension. Valid values are: all extendspw Indicate spectral window based flagging extension. Valid values are: all extendant Indicate antenna (baselines) based flagging extension. Valid values are: all extendtime Indicate time based flagging extension. Valid values are: all
Example:
# create a msplot tool and set the subset data for plotting. mp.open( msname='./data/3C273XC1.ms');
# TO COME mp.average( ??? )
--------------------------------------------------------------------------------
""" return _msplot.msplot_extendflag(self, *args, **kwargs)
def avedata(self, *args, **kwargs): """ avedata(self, chanavemode = string("none"), corravemode = string("none"), datacolumn = string("DATA"), averagemode = string("vector"), averagechan = string("1"), averagetime = string("0"), averageflagged = False, averagescan = False, averagebl = False, averagearray = False, averagechanid = False, averagevel = False) -> bool
Summary
Specify which data is to be averaged in the MS (or selected MS).
Description
No description here at the moment. This method is under active development and is changing frequently. Documentation will be provided when development settles down.
Input Parameters: chanavemode Indicate what if any averaging should be done on the selected channels.The channel selection and averaging is done via the spw parameter. Valid values are: none: No averaging, default value step: Plot every nth point scalarstep: incoherent average of every n points vectorstep: coherent average of every n points scalarchunk: incoherent average of blocks with n points vectorchunk: coherent average of blocks with n points none corravemode Indicate what if any averaging should be done on the selected correlations. See chanavemode for a detailed description of the valid values. Valid values are: none, step, scalarstep, vectorstep, scalarchunk, or vectorchunk none datacolumn Indicate the visibility data to be averaged. Valid values are: DATA CORRECTEDDATA MODELDATA DATA averagemode Indicate the mode for channel and/or time averaging. Valid values are: vector scalar vector averagechan Indicate the number of channels to average. The default value of 1 means no channel averaging. 1 averagetime Indicate the length of time interval to average. Valid values are double values of time in seconds. The default value 0 means no time averaging. 0 averageflagged Indicate either flagged or unflagged data to average. false averagescan Indicate whether time averaging cross scan boundaries. false averagebl Indicate whether averaging cross baseline boundaries. false averagearray Indicate whether averaging cross array boundaries. false averagechanid Indicate whether using averaged channel id or not. false averagevel Indicate whether calculating averaged velocity id or not. false
Example:
# create a msplot tool and set the subset data for plotting. mp.open( msname='./data/3C273XC1.ms');
# TO COME mp.average( ??? )
--------------------------------------------------------------------------------
""" return _msplot.msplot_avedata(self, *args, **kwargs)
def plot(self, *args, **kwargs): """ plot(self, type = string(""), column = string(""), value = string(""), iteration = std::vector< string >(1, "")) -> bool
Input Parameters: type The type of plot to do. Valid values are strings for each of the msplot function, the valid strings are: 'array' 'azimuth', 'baseline', 'elevation', 'hourangle', 'parallacticangle', 'uvcoverage', 'uvdist', 'vischannel', and 'vistime' column Column name in main table of measurment set to plot. Valid values are: data, corrected, model, residual, and weight. value String: amp, phase iteration List of strings: Antenna1, Antenna2, Feed1, Feed2, Field\_id, Scan\_number, and Time. Spectral Window/Polarization\_id( not available yet )
Example:
# create a msplot tool. mp.open( msname='./data/ngc7538.ms');
# Plot the antenna distribution. mp.plot( type='array' );
# Plot the uv distances with the corrected data column plotted # over the data column mp.plotoptions( overplot=False, plotcolor='chocolate' ); mp.plot( type='uvdist', value='phase' ); mp.plotoptions( overplot=True, plotcolor='lemonchiffon' ); mp.plot( type='uvdist', column='corrected', value='phase' );
# Do an iterative plot on baselines, on the visibility amplitude/channel # plot. We display 6 plots at a time. mp.clearplot(); mp.plotoptions( subplot=231 ); mp.plot( type='vischannel', column='data', value='amp', iteration='baseline' ); mp.iterplotnext(); mp.iterplotnext(); mp.iterplotstop();
--------------------------------------------------------------------------------
""" return _msplot.msplot_plot(self, *args, **kwargs)
def checkplot(self, *args, **kwargs): """ checkplot(self, plottype = string(""), column = string("data"), value = string("amp"), iteration = std::vector< string >(1, "")) -> bool
Input Parameters: plottype The type of plot to check. Valid values are strings for each of the msplot function, the valid strings are: 'array' 'azimuth', 'baseline', 'elevation', 'hourangle', 'parallacticangle', 'uvcoverage', 'uvdist', 'vischannel', 'visfrequency', 'vistime', and 'visvelocity', column Column name in main table of measurment set to plot. Valid values are: data, corrected, model, residual, and weight. data value String: amp, phase amp iteration List of strings: Antenna1, Antenna2, Feed1, Feed2, Field\_id, Scan\_number, and Time. Spectral Window/Polarization\_id( not available yet )
Example:
# create a msplot tool. mp.open( msname='./data/ngc7538.ms');
# select the data: spectral windows 0 and 1, channels 3 through 5 # and RL correlations mp.setdata( spwNames=['(0,1):[3-5]'], correlations=['RL'] ); mp.checkplot( plottype='uvdist', column='data', value='amp');
--------------------------------------------------------------------------------
""" return _msplot.msplot_checkplot(self, *args, **kwargs)
def plotxy(self, *args, **kwargs): """ plotxy(self, x = string("uvdist"), y = string("data"), xcolumn = string("data"), ycolumn = string("data"), xvalue = string("amp"), yvalue = string("amp"), iteration = std::vector< string >(1, "")) -> bool
Summary
A generic plotting routine for Measurement sets.
Description
Plot X versus Y for all meaningful columns in the MAIN table of a MS and derived quantities. egin{enumerate} \item X and Y may be one of the followings:\ Antenna1, Antenna2, Feed1, Feed2, Field\_id, \ ifr\_number( not available yet ), Scan\_number, \ Time, channel( not available yet ), uvdistance, \ frequency(not available yet ),u, v, w, \ weight, data, model, corrected, residual \ ( derived quantities will be listed later). \item iteration axis may be one of the followings:\ Antenna1, Antenna2, Feed1, Feed2, Field\_id, Scan\_number,\ Time, Spectral Window/Polarization\_id( not available yet ) nd{enumerate}
Input Parameters: x X-axis, a column name in measurement ests' main table. Valid values are: antenna1, antenna2, aziumth, baseline, channel, corrected, data, elevation, feed1, feed2, field\_id, frequency, hourangle, ifr\_number, model, parallactic\_angle, residual, scan\_number, time, u, uvdist, v, velocity, w, and weight. uvdist y Y-axis, a column name in the measurment sets' main table. Valid values are the same as the X-axis values. data xcolumn The column name in the measurement sets' msin table. Valid values are: data, corrected, model, and residual. data ycolumn The column name in the measurement sets' msin table. Valid values are: data, corrected, model, and residual. data xvalue String, needed if X or Y is data quantity: amp, phase, real, imag amp yvalue String, needed if X or Y is data quantity: amp, phase, real, imag amp iteration List of strings: Antenna1, Antenna2, Feed1, Feed2, Field\_id, Scan\_number, and Time. Ex: iteration over baselines : ['antenna1','antenna2'] Spectral Window/Polarization\_id( not available yet )
Example:
# create a msplot tool. mp.open( msname='./data/ngc7538.ms');
# select data. correlations are separated by a space: # correlations=['RR RL'] mp.setdata( spwNames=['(0,1):[3-5]'], correlations=['RL'] );
# Do an iterative plot over baselines, plotting uvdist vs. data for each antenna. mp.plotxy( X='uvdist', Y='', column='data', iteration=['antenna1, 'antenna2']);
--------------------------------------------------------------------------------
""" return _msplot.msplot_plotxy(self, *args, **kwargs)
def checkplotxy(self, *args, **kwargs): """ checkplotxy(self, x = string("uvdist"), y = string("data"), xcolumn = string("data"), ycolumn = string("data"), xvalue = string("amp"), yvalue = string("amp"), iteration = std::vector< string >(1, "")) -> bool
Summary
Routine for checking the sanity of a plotxy plot.
Description
Do a sanity checks of all the inputs that have been given. This includes checking the plot option values (mp.plotoptions()), data selection (mp.setdata()), and spectral selections (mp.setspectral()).
Also included in the sanity checks is a check to see how many points will be plotted. If there are millions of points to be plotted, but do not want to wait for a large plot try setting the skipnrows or averagenrows plot options.
Input Parameters: x X-axis, a column name in measurement ests' main table. Valid values are: antenna1, antenna2, aziumth, baseline, channel, corrected, data, elevation, feed1, feed2, field\_id, frequency, hourangle, ifr\_number, model, parallactic\_angle, residual, scan\_number, time, u, uvdist, v, velocity, w, and weight. uvdist y Y-axis, a column name in the measurment sets' main table. Valid values are the same as the X-axis values. data xcolumn The column name in the measurement sets' msin table. Valid values are: data, corrected, model, and residual. data ycolumn The column name in the measurement sets' msin table. Valid values are: data, corrected, model, and residual. data xvalue String, needed if X or Y is data quantity: amp, phase, real, and imag amp yvalue String, needed if X or Y is data quantity: amp, phase, real, and imag amp iteration List of strings: Antenna1, Antenna2, Feed1, Feed2, Field\_id, Scan\_number, and Time. Spectral Window/Polarization\_id( not available yet )
Example:
# create a msplot tool, do some data selections and # plot option selection and check the validty of them. mp.open( msname='./data/3C273XC1.ms'); mp.setdata( antennaNames='VLA:N*', fieldNames='1~3', correlations='RR, LL', spwIndex=[3,4,5] ); mp.plotoptions( windowsize=5,aspectratio=0.8, fontsize=14.0, xlabel='uvdist', ylabel='amplitude', title='Amplitude vs. UVdist', plotsymbol='g+' ); mp.checkplotxy( X='uvdist', Y='', column='data', iteration=['antenna1, 'antenna2']);
--------------------------------------------------------------------------------
""" return _msplot.msplot_checkplotxy(self, *args, **kwargs)
def iterplotstart(self): """ iterplotstart(self) -> bool
Summary Plot the first set of iterative plots.
Description
Begin a series of plots using subtables constructed via an iteration axes, which is set in either the mp.plot or mp.plotxy methods. Use iterplotnext() to step through. Multi-panel plots as well as overplots are supported with this function. Overplots have a restriction in that both plots must have the same axies.
Only forward step through is allowed.
Example:
# create a msplot tool, select the data with field name 3C273 for plot, # and initialize a plot of Amplitude vs UV distance for # channel 1 and stokes 1, iterating over Antenna1, and creating # two plot panels per iteration page. mp.open( msname=['./data/3C273XC1.ms']); plotoptions.nxpanels := 1; plotoptions.nypanels := 2; plotoptions.windowsize := 6; plotoptions.aspectratio := 1.2; plotoptions.fontsize := 14.0; mp.setdata( fieldNames=['3C273'] ); labels := ['Amplitude vs UVdist (iterating over Antenna1)','uvdist','amplitude']; mp.plotxy( x='SQRT(SUMSQUARE(UVW[1:2]))' y='AMPLITUDE(DATA[1,1])', iteration='ANTENNA1' ); mp.iterplotstart(); To iterate over baseline, for stokes 1, channel 1. plotopts.nxpanels := 1; plotopts.nypanels := 4; labels := ['Amplitude vs UVdist (iterating over Baseline)','uvdist','amplitude']; iteraxes := ['ANTENNA1','ANTENNA2']; mp.plotxy( x=['SQRT(SUMSQUARE(UVW[1:2]))' y='AMPLITUDE(DATA[1,1])'], iteration=iteraxes ) mp.iterplotstart();
--------------------------------------------------------------------------------
""" return _msplot.msplot_iterplotstart(self)
def iterplotnext(self): """ iterplotnext(self) -> bool
Summary Continue plotting on an iteration axes.
Description
Start/Continue plotting by stepping through the iteration axes.
Example:
# Iterate through the data, plotting the uvdist for each antenna1 # The same plot can be achieved with mp.uvdist( iteration='antenna1' ) mp.open( msname=['./data/3C273XC1.ms']); mp.plotoptions( subplot=121, windowsize=6, aspectratio=1.2, fontsize=14.0); mp.setdata( uvDists=['>25kl'] ); mp.plotxy(X='uvdist',Y='',iteration='antenna1'); mp.iterplotnext(); mp.iterplotnext(); mp.iterplotstop();
--------------------------------------------------------------------------------
""" return _msplot.msplot_iterplotnext(self)
def iterplotstop(self, rmplotter = False): """ iterplotstop(self, rmplotter = False) -> bool
Summary Stop an iterative plot.
Description
To be called at the end of the plot iterations, or in between if desired.
Input Parameters: rmplotter Indicates of the plot window should be removed (true)from the display or left (false) false
Example:
# see the example for iterplotnext()
--------------------------------------------------------------------------------
""" return _msplot.msplot_iterplotstop(self, rmplotter)
def savefig(self, *args, **kwargs): """ savefig(self, filename = string(""), dpi = -1, orientation = string(""), papertype = string(""), facecolor = string(""), edgecolor = string("")) -> bool
Summary
Save the currently plotted image.
Description
Store the contents of the plot window in a file. The file format (type) is based on the file name, ie. the file extension given determines the format the file is saved as. The accepted formats are eps, ps, png, pdf, and svg.
Internally, this function uses the matplotlib pl.savefig function.
Note that if a full path is not given that the files will be saved in the current working directory.
Input Parameters: filename Name the plot image is to be saved to. dpi Number of dots per inch (resolution) to save the image at. -1 orientation Either landscape or portrait. Supported by the postscript format only. papertype Valid values are: letter, legal, exective, ledger, a0-a10 and b0-b10. This option is supported byt the postscript format only. facecolor Color of space between the plot and the edge of the square. Valid values are the same as those accepted by the plotcolor option. edgecolor Color of the outer edge. Valid values are the same as those accepted by the plotcolor option.
Example:
# Open a msplot tool with a measurment set mp.open( msname='./data/3C273XC1.ms' ); # Plot something and save it in a pdf file. mp.plot( 'uvdist' ) mp.savefig( 'uvdist.pdf', edgecolor='black' )
--------------------------------------------------------------------------------
""" return _msplot.msplot_savefig(self, *args, **kwargs)
def markregion(self, *args, **kwargs): """ markregion(self, subplot = 111, region = initialize_vector(1, (double)0.0)) -> bool
Summary Mark a rectangular region to flag or to investigate the data in the area.
Description
Mark a rectangular region on the plot. Each call to { t markflag} allows one region to be drawn. Any number of successive calls can be made. This function marks and stores a list of marked regions. These regions can then be (un)flagged, or information about the marked data can be retrieved. To flag the data the { t (un)flagdata} function must be used and to find out information about the data the { t locatedata} function must be used.
In the case of multi-panel plots, the subplot parameter must be specified with each call. The subplot value corresponds to a row-major ordering of panels, see the subplot plot option information.
Marking the region requires two consecutive mouse clicks at the two diagonally opposite corners. A hatched rectangle will appear over the selected region. Alternative a specific region can be given to this function with the { t region} parameter.
Input Parameters: subplot Three digits number: first digit for nx, second for ny, last for pannel number. 111 region [xmin,ymin,xmax,ymax] bounding box 0.0
Example:
# mark 2 flag regions on a multi-panel plot, one in panel 1 and one # in panel 2. tp.markflags(subplot=131, region=[100,-100,50,-50]); tp.markflags(subplot=221);
--------------------------------------------------------------------------------
""" return _msplot.msplot_markregion(self, *args, **kwargs)
def flagdata(self): """ flagdata(self) -> bool
Summary Set flags for all selected regions marked using mp.markregion()
Description
Set flags for all regions marked using { t markflags()}. The plot is automatically redrawn after applying flags.
If reduction TaQL functions such as { t sum,mean} are used, flags corresponding to all accessed values will be modified. For example, with a measurement set table, flagging on the mean amplitude of stokes 1 and channels 1 to 5, given by 'MEAN(AMPLITUDE(DATA[1,1:5]))' results in flags being set for all 5 accessed channels.
For a measurement set, by default, flags are set only for accessed channels and stokes when the DATA column is used. However all channels/stokes can be flagged for the marked flag regions by setting the corresponding row flag.
Example:
# mark 2 flag regions on a multi-panel plot, one in panel 1 and one # in panel 2. Then apply the flags and write to disk. mp.markflags(subplot=221, region=[0,15,10,30]); mp.markflags(subplot=222, region=[15,30,10,30]); mp.flagdata();
--------------------------------------------------------------------------------
""" return _msplot.msplot_flagdata(self)
def unflagdata(self): """ unflagdata(self) -> bool
Summary
Unset flags in all regions marked using mp.markregion() Similar to the mp.flagdata()
Description
Unset flags for all regions marked using { t markflags()}. See the { t flagdata()} function for more information.
Example:
# mark 2 flag regions on a multi-panel plot with three rows of plots. # One region is marked on panel 1 and one region onpanel 2. Then the # marked regions are applied unflagging data and writing the changes # to disk. mp.markflags(subplot=311); mp.markflags(subplot=312); mp.unflagdata();
--------------------------------------------------------------------------------
""" return _msplot.msplot_unflagdata(self)
def clearflags(self): """ clearflags(self) -> bool
Summary Clear all flags in the table. Note: This clears *all* flags and should be used with caution.
Description
Currently, this function clears all flags from the table. This will be modified to allow for selective un-flagging of previously flagged regions (specified by indexing into a stored history of marked flag-regions).
Example:
# clear all flags from the subset of the measurement set. mp := msplot( msname=['./data/3C273XC1.ms']); mp.setdata( spwIndex=[0] ); mp.clearflags(); mp.done();
--------------------------------------------------------------------------------
""" return _msplot.msplot_clearflags(self)
def locatedata(self): """ locatedata(self) -> bool
Summary
Print info about data selected using mp.markregion().
Description
New functionality that is being added to the plotting facilities, as a result we've purposely not put any description in as we are still exploring how this function should work.
Example:
--------------------------------------------------------------------------------
""" return _msplot.msplot_locatedata(self)
def saveflagversion(self, *args, **kwargs): """ saveflagversion(self, versionname = string(""), comment = string(""), merge = string("replace")) -> bool
Summary Save current flags, applied to the current measurement set with a version name.
Description
Input Parameters: versionname Version name comment Comment for this flag table merge merge type: 'replace' existing flag version, 'and' logical AND with exisiting flag version, or 'or' logical OR with existing flag version replace
Example:
--------------------------------------------------------------------------------
""" return _msplot.msplot_saveflagversion(self, *args, **kwargs)
def restoreflagversion(self, *args, **kwargs): """ restoreflagversion(self, versionname = std::vector< string >(1, ""), merge = string("replace")) -> bool
Summary Restore flags for the current Measurement Set.
Description
Input Parameters: versionname List of flag versions to restore from. merge merge type: 'replace' existing flag version, 'and' logical AND with exisiting flag version, or 'or' logical OR with existing flag version replace
Example:
--------------------------------------------------------------------------------
""" return _msplot.msplot_restoreflagversion(self, *args, **kwargs)
def deleteflagversion(self, *args, **kwargs): """ deleteflagversion(self, versionname = std::vector< string >(1, "")) -> bool
Summary For the current measurement set delete a saved flag_version.
Description
Input Parameters: versionname Version name
Example:
--------------------------------------------------------------------------------
""" return _msplot.msplot_deleteflagversion(self, *args, **kwargs)
def getflagversionlist(self): """ getflagversionlist(self) -> bool
Summary Print out a list of saved flag_versions, for the current Measurement Set.
Description
Example:
--------------------------------------------------------------------------------
""" return _msplot.msplot_getflagversionlist(self)
msplot_swigregister = _msplot.msplot_swigregister msplot_swigregister(msplot)
# This file is compatible with both classic and new-style classes.
|