casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
plotms_cli.py
Go to the documentation of this file.
00001 #
00002 # This file was generated using xslt from its XML file
00003 #
00004 # Copyright 2008, Associated Universities Inc., Washington DC
00005 #
00006 import sys
00007 import os
00008 #from casac import *
00009 import casac
00010 import string
00011 import time
00012 import inspect
00013 import gc
00014 import numpy
00015 from odict import odict
00016 from taskmanager import tm
00017 from task_plotms import plotms
00018 class plotms_cli_:
00019     __name__ = "plotms"
00020     __async__ = {}
00021     rkey = None
00022     i_am_a_casapy_task = None
00023     # The existence of the i_am_a_casapy_task attribute allows help()
00024     # (and other) to treat casapy tasks as a special case.
00025 
00026     def __init__(self) :
00027        self.__bases__ = (plotms_cli_,)
00028        self.__doc__ = self.__call__.__doc__
00029 
00030        self.parameters={'vis':None, 'xaxis':None, 'xdatacolumn':None, 'yaxis':None, 'ydatacolumn':None, 'selectdata':None, 'field':None, 'spw':None, 'timerange':None, 'uvrange':None, 'antenna':None, 'scan':None, 'correlation':None, 'array':None, 'observation':None, 'msselect':None, 'averagedata':None, 'avgchannel':None, 'avgtime':None, 'avgscan':None, 'avgfield':None, 'avgbaseline':None, 'avgantenna':None, 'avgspw':None, 'scalar':None, 'transform':None, 'freqframe':None, 'restfreq':None, 'veldef':None, 'shift':None, 'extendflag':None, 'extcorr':None, 'extchannel':None, 'iteraxis':None, 'xselfscale':None, 'yselfscale':None, 'customsymbol':None, 'symbolshape':None, 'symbolsize':None, 'symbolcolor':None, 'symbolfill':None, 'symboloutline':None, 'coloraxis':None, 'customflaggedsymbol':None, 'flaggedsymbolshape':None, 'flaggedsymbolsize':None, 'flaggedsymbolcolor':None, 'flaggedsymbolfill':None, 'flaggedsymboloutline':None, 'plotrange':None, 'title':None, 'xlabel':None, 'ylabel':None, 'showmajorgrid':None, 'majorwidth':None, 'majorstyle':None, 'majorcolor':None, 'showminorgrid':None, 'minorwidth':None, 'minorstyle':None, 'minorcolor':None, 'plotfile':None, 'expformat':None, 'highres':None, 'interactive':None, 'overwrite':None,  'async':None}
00031 
00032 
00033     def result(self, key=None):
00034             #### here we will scan the task-ids in __async__
00035             #### and add any that have completed...
00036             if key is not None and self.__async__.has_key(key) and self.__async__[key] is not None:
00037                ret = tm.retrieve(self.__async__[key])
00038                if ret['state'] == "done" :
00039                   self.__async__[key] = None
00040                elif ret['state'] == 'crashed' :
00041                   self.__async__[key] = None
00042                return ret
00043             return None
00044 
00045 
00046     def __call__(self, vis=None, xaxis=None, xdatacolumn=None, yaxis=None, ydatacolumn=None, selectdata=None, field=None, spw=None, timerange=None, uvrange=None, antenna=None, scan=None, correlation=None, array=None, observation=None, msselect=None, averagedata=None, avgchannel=None, avgtime=None, avgscan=None, avgfield=None, avgbaseline=None, avgantenna=None, avgspw=None, scalar=None, transform=None, freqframe=None, restfreq=None, veldef=None, shift=None, extendflag=None, extcorr=None, extchannel=None, iteraxis=None, xselfscale=None, yselfscale=None, customsymbol=None, symbolshape=None, symbolsize=None, symbolcolor=None, symbolfill=None, symboloutline=None, coloraxis=None, customflaggedsymbol=None, flaggedsymbolshape=None, flaggedsymbolsize=None, flaggedsymbolcolor=None, flaggedsymbolfill=None, flaggedsymboloutline=None, plotrange=None, title=None, xlabel=None, ylabel=None, showmajorgrid=None, majorwidth=None, majorstyle=None, majorcolor=None, showminorgrid=None, minorwidth=None, minorstyle=None, minorcolor=None, plotfile=None, expformat=None, highres=None, interactive=None, overwrite=None,  async=None):
00047 
00048         """A plotter/interactive flagger for visibility data.
00049 
00050             Task for plotting and interacting with visibility data.  A variety
00051         of axes choices (including data column) along with MS selection and
00052         averaging options are provided for data selection.  Flag extension
00053         parameters are also available for flagging operations in the plotter.
00054         
00055             All of the provided parameters can also be set using the GUI once
00056         the application has been launched.  Additional and more specific
00057         operations are available through the GUI and/or through the plotms
00058         tool (pm).
00059         
00060 
00061     Keyword arguments:
00062     vis -- input visibility dataset
00063            default: ''
00064     xaxis, yaxis -- what to plot on the two axes
00065                     default: '' (defaults are xaxis='time',
00066                                  yaxis='amp' on first execution;
00067                                  thereafter the most recent
00068                                  settings are used)
00069               valid options (=indicates valid synonyms): 
00070                MS Ids and other meta info:
00071                  'scan'   (number)
00072                  'field'  (index)
00073                  'time',  
00074                  'interval'='timeint'='timeinterval'='time_interval'
00075                  'spw'    (index)
00076                  'chan'='channel'    (index)  
00077                  'freq'='frequency'  (GHz)
00078                  'vel'='velocity'   (km/s)
00079                  'corr'='correlation'  (index)
00080                  'ant1'='antenna1'   (index)
00081                  'ant2'='antenna2'   (index)
00082                  'baseline'  (a baseline index) 
00083                  'row'  (absoute row Id from the MS)
00084                Visibility values, flags:
00085                  'amp'='amplitude'
00086                  'phase'  (deg)
00087                  'real'  
00088                  'imag'='imaginary'
00089                  'wt'='weight'
00090                  'flag'
00091                  'flagrow'
00092                Observational geometry:
00093                  'uvdist'  (meters)
00094                  'uvwave'='uvdistl'='uvdist_l'  (wavelengths, per channel)
00095                  'u'  (meters)
00096                  'v'  (meters)
00097                  'w'  (meters)
00098                  'uwave'  ('u' in wavelengths, per channel)
00099                  'vwave'  ('v' in wavelengths, per channel)
00100                  'wwave'  ('w' in wavelengths, per channel)
00101                  'azimuth'  (at array reference; degrees)
00102                  'elevation'  (at array reference; degrees)
00103                  'hourang'='hourangle'  (at array reference; hours)
00104                  'parang'='parangle'='parallacticangle'  (at array reference; degrees)
00105                Antenna-based (only works vs. data Ids):
00106                  'ant'='antenna'
00107                  'ant-azimuth' 
00108                  'ant-elevation'
00109                  'ant-parang'='ant-parangle'
00110 
00111       >>> xaxis, yaxis expandable parameters
00112         xdatacolumn, 
00113         ydatacolumn  -- which data column to use for Visibility values:
00114                         default: '' ('data' on first execuation;
00115                                      thereafter the most recent
00116                                      setting is used)
00117                         valid options:  'data'      (observed)
00118                                         'corrected'='corr'
00119                                         'model'
00120                                         'residual'  (corrected - model)
00121     
00122     selectdata -- data selection parameters flag
00123                   default: True  (reveals data selection parameters
00124                                   described below)
00125                   Consult listobs output for data selection values,
00126                   and see help par.selectdata for more detailed 
00127                   information on syntax; also, visit
00128                   http://casa.nrao.edu/other_doc.shtml and click
00129                   on "Measurement Set selection syntax" for more
00130                   tips on using data selection parameters in CASA)
00131 
00132       >>> selectdata expandable parameters:
00133 
00134       field -- Select field using field id(s) or field name(s).
00135               default: ''=all fields
00136               If field string is a non-negative integer, it is assumed a
00137                 field index,  otherwise, it is assumed a field name
00138               field='0~2'; field ids 0,1,2
00139               field='0,4,5~7'; field ids 0,4,5,6,7
00140               field='3C286,3C295'; field named 3C286 and 3C295
00141               field = '3,4C*'; field id 3, all names starting with 4C
00142       spw -- Select spectral window/channels
00143                type 'help par.selection' for more examples.
00144              spw='0~2,4'; spectral windows 0,1,2,4 (all channels)
00145              spw='<2';  spectral windows less than 2 (i.e. 0,1)
00146              spw='0:5~61'; spw 0, channels 5 to 61, INCLUSIVE
00147              spw='*:5~61'; all spw with channels 5 to 61
00148              spw='0,10,3:3~45'; spw 0,10 all channels, spw 3, channels 3 to 45.
00149              spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each.
00150              spw='0:0~10;15~60'; spectral window 0 with channels 0-10,15-60
00151                        NOTE ';' to separate channel selections
00152 
00153       timerange  -- Select data based on time range:
00154               default = '' (all); examples,
00155               timerange = 'YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss'
00156               Note: if YYYY/MM/DD is missing date defaults to first day in data set
00157               timerange='09:14:0~09:54:0' picks 40 min on first day
00158               timerange= '25:00:00~27:30:00' picks 1 hr to 3 hr 30min on NEXT day
00159               timerange='09:44:00' pick data within one integration of time
00160               timerange='>10:24:00' data after this time
00161       uvrange -- Select data within uvrange (default units meters)
00162               default: '' (all); example:
00163               uvrange='0~1000klambda'; uvrange from 0-1000 kilo-lambda
00164               uvrange='>4klambda';uvranges greater than 4 kilo lambda
00165 
00166       antenna -- Select data based on antenna/baseline
00167               default: '' (all, including auto-correlations, if present)
00168               If antenna string is a non-negative integer, it is assumed an
00169                 antenna index, otherwise, it is assumed as an antenna name
00170               antenna='5&6'; baseline between antenna index 5 and index 6.
00171               antenna='!ea02'; exclude EVLA antenna 2.
00172               antenna='ea13;!ea22'; EVLA antenna 13, excluding antenna 22.
00173               antenna='VA05&VA06'; baseline between VLA antenna 5 and 6.
00174               antenna='5&6;7&8'; baselines with indices 5-6 and 7-8
00175               antenna='5'; all baselines with antenna index 5
00176               antenna='05'; all baselines with antenna number 05 (VLA old name)
00177               antenna='5,6,10'; all baselines with antennas 5,6,10 index numbers
00178               NB: For explicit selections, use a single ampersand (&) to
00179               select only cross-correlations among the specified antennas, 
00180               double ampersands (&&) to select cross- and
00181               auto-correlations among the specified antennas, and
00182               triple ampersands (&&&) to select only
00183               auto-correlations.  E.g.:
00184               antenna='*&'; selects all cross-correlation baseline
00185                             (excludes all auto-correlations)
00186               antenna='*&&&'; selects all auto-correlation baselines
00187                               (excludes all cross-correlations)
00188               antenna='1&&1,2,3'; selects baselines 1-1 (auto), 1-2,1-3 (cross)
00189               antenna='VA05&&&'; selects the VA05 autocorrelation
00190               See the link noted above for more information.
00191       scan -- Scan numbers or ranges.
00192               default: ''  (all scans)
00193               scan='1,2,6,43'; scans 1, 2, 6, and 43
00194               scan='3~14'; scans 3 through 14, inclusive
00195       correlation -- Select by correlation
00196                      default: ''  (all correlations)
00197                      options: 'RR','RL','LR','LL','XX','XY','YX','YY',
00198                                or any comma-separated combination; use
00199                                basis (R/L or X/Y) appropriate to the MS)
00200       array -- Select the array id
00201                default: ''  (all array ids)
00202       observation Select by observation ID(s).
00203                   default: ''-->all;
00204                   example: observation='0' (select obsID 0)
00205       msselect -- Optional TaQL data selection
00206 
00207     averagedata -- data averaing parameters flag
00208                    default: True   (reveals expandable parameters
00209                                     described below)
00210       >>> averagedata expandable parameters
00211         avgchannel -- average over channel?  either blank for none, or a value
00212                       in channels.
00213                       default: '' (no channel averaging).
00214         avgtime -- average over time?  either blank for none, or a value in
00215                    seconds.
00216                    default: '' (no time averaging).
00217         avgscan -- average over scans?  only valid if time averaging is turned
00218                    on.
00219                    default: False.
00220         avgfield -- average over fields?  only valid if time averaging is
00221                     turned on.
00222                     default: False.
00223         avgbaseline -- average over selected baselines; mutually 
00224                        exclusive with avgantenna.
00225                        default: False.  (no averaging over baseline)
00226         avgantenna -- form per-antenna averages; mutually exclusive with
00227                       avgbaseline.
00228                       default: False.   (no per-antenna averaging)
00229         avgspw -- average over selected spectral windows?
00230                   default: False.  (no average of spectral windows)
00231         scalar -- scalar averaging?
00232                   default: False  (i.e., do vector averaging)
00233     
00234     transform -- apply various transformations on data for plotting
00235                  default: False.
00236       >>> transform expandable parameters
00237         freqframe -- the coordinate frame in which to render frequency and velocity axes
00238                  default: ''  (unspecified: will use frame in which data were taken)
00239                  options: TOPO, GEO, BARY, LSRK, LSRD
00240         restfreq -- the rest frequency to use in velocity conversions (MHz)
00241                  default: '' (use spw central frequency and show relative velocity)
00242                  example: '22235.08MHz'
00243         veldef -- the velocity definition to use
00244                  default: 'RADIO'
00245                  options: 'RADIO','OPT','TRUE'
00246         shift -- adjust phase according to a phase center shift [dx,dy] (arcsec)
00247                  default: [0,0]  (no shift)
00248 
00249     extendflag -- have flagging extend to other data points?
00250                   default: False.
00251       >>> extendflag expandable parameters
00252         extcorr -- extend flags based on correlation? 
00253                    default: False.
00254         extchannel -- extend flags based on channel?
00255 
00256     iteraxis -- axis upon which iterate plots (one plot per page, for now)
00257                 default: '' (no iteration)
00258                 options: 'scan','field','spw','baseline','antenna',''
00259       >>> iteraxis expandable parameters
00260         xselfscale -- If true, self-scale each iterated plot on the x axis
00261         yselfscale -- If true, self-scale each iterated plot on the y axis
00262                       default: false, which will scale all plots globally
00263 
00264     customsymbol -- If true, use a custom symbol for drawing unflagged points
00265                     default: True
00266       >>> customsymbol expandable parameters
00267         symbolshape -- If true, use a custom shape to draw unflagged symbols
00268                        default: 'autoscaling' (ignores symbolsize)
00269                        options: 'autoscaling', 'circle', 'square', 'diamond', 'pixel', 'nosymbol'
00270         symbolsize -- size of the unflagged symbols in pixels
00271                       default: 2
00272         symbolcolor -- color to use for unflagged symbols; can be a RGB hex code or a color name
00273                        default: '0000ff'
00274                        example: 'purple'
00275         symbolfill -- type of fill to use for unflagged symbols
00276                       default: 'fill'
00277                       options: 'fill', 'mesh1', 'mesh2', 'mesh3', 'nofill'
00278         symboloutline -- If true, outline unflagged symbols in black
00279 
00280     coloraxis -- axis upon which to colorize the plotted points
00281                 options (= indicates synonyms):
00282                     'scan',  'field',  'spw',  'antenna1'='ant1',  'antenna2'='ant2',
00283                     'baseline',  'channel'='chan',  'corr'='correlation'
00284                 default: ''  (use a single color for all points)
00285 
00286     customflaggedsymbol -- If true, use a custom symbol for drawing flagged points
00287                            default: False
00288       >>> customflaggedsymbol expandable parameters
00289         symbolshape -- If true, use a custom shape to draw flagged symbols
00290                        default: 'nosymbol'
00291                        options: 'autoscaling', 'circle', 'square', 'diamond', 'pixel', 'nosymbol'
00292         symbolsize -- size of the flagged symbols in pixels
00293                       default: 2
00294         symbolcolor -- color to use for flagged symbols; can be a RGB hex code or a color name
00295                        default: '0000ff'
00296                        example: 'purple'
00297         symbolfill -- type of fill to use for flagged symbols
00298                       default: 'fill'
00299                       options: 'fill', 'mesh1', 'mesh2', 'mesh3', 'nofill'
00300         symboloutline -- If true, outline flagged symbols in black
00301 
00302     plotrange -- manual plot axis ranges: [xmin,xmax,ymin,ymax]
00303                  Does not affect data selection.
00304                  default: []; both axes will be autoscaled according
00305                  to the ranges found in the selected data
00306                  If xmin=xmax (or ymin=ymax) then that axis will
00307                  be autoscaled, e.g.:
00308                  [0,0,-2.0,14.0]; autoscale the xaxis, and use 
00309                                   ymin=-2.0, ymax=14.0
00310 
00311     title  -- title along top of plot (called "canvas" in some places)
00312     
00313     xlabel -- text to label horizontal axis, with formatting using '%%' 
00314     ylabel -- text to label horizontal axis, with formatting using '%%' 
00315     
00316     showmajorgrid  -- show major grid lines (horiz and vert.)
00317                   default: False.
00318       >>>  major grid expandable parameters
00319         majorwidth  -- line width in pixels of major grid lines
00320         majorstyle  -- major grid line style: solid dash dot none
00321         majorcolor  -- color in hex code of major grid lines
00322 
00323     showminorgrid  -- show minor grid lines (horiz and vert.)
00324                   default: False.
00325       >>>  minor grid expandable parameters
00326         minorwidth  --  line width in pixels of minor grid lines
00327         minorstyle  --  minor grid line style: solid dash dot none
00328         minorcolor  --  color in hex code of minor grid lines
00329 
00330     plotfile -- name of plot file to save automatically
00331                 default: ''  (i.e., draw an interactive plot in the gui)
00332       >>> plotfile expandable parameters
00333         expformat -- export format type; if 'txt' is used an ASCII dump of the plotted points is generated (also available in the export tab)
00334                      default:  ''   (plotfile extension will be used)
00335                      options: 'jpg', 'png', 'ps', 'pdf', 'txt'
00336         highres -- use high resolution? Always true for jpg and png.
00337                    default: false
00338         interactive  -- interactive mode? (pop up confirmation window)
00339                         default: false (e.g., for automated scripts to prevent blocking).
00340         overwrite -- Overwrite plot file if it already exists?
00341                      default: false
00342 
00343 
00344 
00345         """
00346         if not hasattr(self, "__globals__") or self.__globals__ == None :
00347            self.__globals__=sys._getframe(len(inspect.stack())-1).f_globals
00348         #casac = self.__globals__['casac']
00349         casalog = self.__globals__['casalog']
00350         #casalog = casac.casac.logsink()
00351         self.__globals__['__last_task'] = 'plotms'
00352         self.__globals__['taskname'] = 'plotms'
00353         ###
00354         self.__globals__['update_params'](func=self.__globals__['taskname'],printtext=False,ipython_globals=self.__globals__)
00355         ###
00356         ###
00357         #Handle globals or user over-ride of arguments
00358         #
00359         function_signature_defaults=dict(zip(self.__call__.func_code.co_varnames,self.__call__.func_defaults))
00360         useLocalDefaults = False
00361 
00362         for item in function_signature_defaults.iteritems():
00363                 key,val = item
00364                 keyVal = eval(key)
00365                 if (keyVal == None):
00366                         #user hasn't set it - use global/default
00367                         pass
00368                 else:
00369                         #user has set it - use over-ride
00370                         if (key != 'self') :
00371                            useLocalDefaults = True
00372 
00373         myparams = {}
00374         if useLocalDefaults :
00375            for item in function_signature_defaults.iteritems():
00376                key,val = item
00377                keyVal = eval(key)
00378                exec('myparams[key] = keyVal')
00379                self.parameters[key] = keyVal
00380                if (keyVal == None):
00381                    exec('myparams[key] = '+ key + ' = self.itsdefault(key)')
00382                    keyVal = eval(key)
00383                    if(type(keyVal) == dict) :
00384                       if len(keyVal) > 0 :
00385                          exec('myparams[key] = ' + key + ' = keyVal[len(keyVal)-1][\'value\']')
00386                       else :
00387                          exec('myparams[key] = ' + key + ' = {}')
00388 
00389         else :
00390             async = self.parameters['async']
00391             myparams['vis'] = vis = self.parameters['vis']
00392             myparams['xaxis'] = xaxis = self.parameters['xaxis']
00393             myparams['xdatacolumn'] = xdatacolumn = self.parameters['xdatacolumn']
00394             myparams['yaxis'] = yaxis = self.parameters['yaxis']
00395             myparams['ydatacolumn'] = ydatacolumn = self.parameters['ydatacolumn']
00396             myparams['selectdata'] = selectdata = self.parameters['selectdata']
00397             myparams['field'] = field = self.parameters['field']
00398             myparams['spw'] = spw = self.parameters['spw']
00399             myparams['timerange'] = timerange = self.parameters['timerange']
00400             myparams['uvrange'] = uvrange = self.parameters['uvrange']
00401             myparams['antenna'] = antenna = self.parameters['antenna']
00402             myparams['scan'] = scan = self.parameters['scan']
00403             myparams['correlation'] = correlation = self.parameters['correlation']
00404             myparams['array'] = array = self.parameters['array']
00405             myparams['observation'] = observation = self.parameters['observation']
00406             myparams['msselect'] = msselect = self.parameters['msselect']
00407             myparams['averagedata'] = averagedata = self.parameters['averagedata']
00408             myparams['avgchannel'] = avgchannel = self.parameters['avgchannel']
00409             myparams['avgtime'] = avgtime = self.parameters['avgtime']
00410             myparams['avgscan'] = avgscan = self.parameters['avgscan']
00411             myparams['avgfield'] = avgfield = self.parameters['avgfield']
00412             myparams['avgbaseline'] = avgbaseline = self.parameters['avgbaseline']
00413             myparams['avgantenna'] = avgantenna = self.parameters['avgantenna']
00414             myparams['avgspw'] = avgspw = self.parameters['avgspw']
00415             myparams['scalar'] = scalar = self.parameters['scalar']
00416             myparams['transform'] = transform = self.parameters['transform']
00417             myparams['freqframe'] = freqframe = self.parameters['freqframe']
00418             myparams['restfreq'] = restfreq = self.parameters['restfreq']
00419             myparams['veldef'] = veldef = self.parameters['veldef']
00420             myparams['shift'] = shift = self.parameters['shift']
00421             myparams['extendflag'] = extendflag = self.parameters['extendflag']
00422             myparams['extcorr'] = extcorr = self.parameters['extcorr']
00423             myparams['extchannel'] = extchannel = self.parameters['extchannel']
00424             myparams['iteraxis'] = iteraxis = self.parameters['iteraxis']
00425             myparams['xselfscale'] = xselfscale = self.parameters['xselfscale']
00426             myparams['yselfscale'] = yselfscale = self.parameters['yselfscale']
00427             myparams['customsymbol'] = customsymbol = self.parameters['customsymbol']
00428             myparams['symbolshape'] = symbolshape = self.parameters['symbolshape']
00429             myparams['symbolsize'] = symbolsize = self.parameters['symbolsize']
00430             myparams['symbolcolor'] = symbolcolor = self.parameters['symbolcolor']
00431             myparams['symbolfill'] = symbolfill = self.parameters['symbolfill']
00432             myparams['symboloutline'] = symboloutline = self.parameters['symboloutline']
00433             myparams['coloraxis'] = coloraxis = self.parameters['coloraxis']
00434             myparams['customflaggedsymbol'] = customflaggedsymbol = self.parameters['customflaggedsymbol']
00435             myparams['flaggedsymbolshape'] = flaggedsymbolshape = self.parameters['flaggedsymbolshape']
00436             myparams['flaggedsymbolsize'] = flaggedsymbolsize = self.parameters['flaggedsymbolsize']
00437             myparams['flaggedsymbolcolor'] = flaggedsymbolcolor = self.parameters['flaggedsymbolcolor']
00438             myparams['flaggedsymbolfill'] = flaggedsymbolfill = self.parameters['flaggedsymbolfill']
00439             myparams['flaggedsymboloutline'] = flaggedsymboloutline = self.parameters['flaggedsymboloutline']
00440             myparams['plotrange'] = plotrange = self.parameters['plotrange']
00441             myparams['title'] = title = self.parameters['title']
00442             myparams['xlabel'] = xlabel = self.parameters['xlabel']
00443             myparams['ylabel'] = ylabel = self.parameters['ylabel']
00444             myparams['showmajorgrid'] = showmajorgrid = self.parameters['showmajorgrid']
00445             myparams['majorwidth'] = majorwidth = self.parameters['majorwidth']
00446             myparams['majorstyle'] = majorstyle = self.parameters['majorstyle']
00447             myparams['majorcolor'] = majorcolor = self.parameters['majorcolor']
00448             myparams['showminorgrid'] = showminorgrid = self.parameters['showminorgrid']
00449             myparams['minorwidth'] = minorwidth = self.parameters['minorwidth']
00450             myparams['minorstyle'] = minorstyle = self.parameters['minorstyle']
00451             myparams['minorcolor'] = minorcolor = self.parameters['minorcolor']
00452             myparams['plotfile'] = plotfile = self.parameters['plotfile']
00453             myparams['expformat'] = expformat = self.parameters['expformat']
00454             myparams['highres'] = highres = self.parameters['highres']
00455             myparams['interactive'] = interactive = self.parameters['interactive']
00456             myparams['overwrite'] = overwrite = self.parameters['overwrite']
00457 
00458         if type(shift)==float: shift=[shift]
00459         if type(plotrange)==float: plotrange=[plotrange]
00460 
00461         result = None
00462 
00463 #
00464 #    The following is work around to avoid a bug with current python translation
00465 #
00466         mytmp = {}
00467 
00468         mytmp['vis'] = vis
00469         mytmp['xaxis'] = xaxis
00470         mytmp['xdatacolumn'] = xdatacolumn
00471         mytmp['yaxis'] = yaxis
00472         mytmp['ydatacolumn'] = ydatacolumn
00473         mytmp['selectdata'] = selectdata
00474         mytmp['field'] = field
00475         mytmp['spw'] = spw
00476         mytmp['timerange'] = timerange
00477         mytmp['uvrange'] = uvrange
00478         mytmp['antenna'] = antenna
00479         mytmp['scan'] = scan
00480         mytmp['correlation'] = correlation
00481         mytmp['array'] = array
00482         mytmp['observation'] = observation
00483         mytmp['msselect'] = msselect
00484         mytmp['averagedata'] = averagedata
00485         mytmp['avgchannel'] = avgchannel
00486         mytmp['avgtime'] = avgtime
00487         mytmp['avgscan'] = avgscan
00488         mytmp['avgfield'] = avgfield
00489         mytmp['avgbaseline'] = avgbaseline
00490         mytmp['avgantenna'] = avgantenna
00491         mytmp['avgspw'] = avgspw
00492         mytmp['scalar'] = scalar
00493         mytmp['transform'] = transform
00494         mytmp['freqframe'] = freqframe
00495         mytmp['restfreq'] = restfreq
00496         mytmp['veldef'] = veldef
00497         mytmp['shift'] = shift
00498         mytmp['extendflag'] = extendflag
00499         mytmp['extcorr'] = extcorr
00500         mytmp['extchannel'] = extchannel
00501         mytmp['iteraxis'] = iteraxis
00502         mytmp['xselfscale'] = xselfscale
00503         mytmp['yselfscale'] = yselfscale
00504         mytmp['customsymbol'] = customsymbol
00505         mytmp['symbolshape'] = symbolshape
00506         mytmp['symbolsize'] = symbolsize
00507         mytmp['symbolcolor'] = symbolcolor
00508         mytmp['symbolfill'] = symbolfill
00509         mytmp['symboloutline'] = symboloutline
00510         mytmp['coloraxis'] = coloraxis
00511         mytmp['customflaggedsymbol'] = customflaggedsymbol
00512         mytmp['flaggedsymbolshape'] = flaggedsymbolshape
00513         mytmp['flaggedsymbolsize'] = flaggedsymbolsize
00514         mytmp['flaggedsymbolcolor'] = flaggedsymbolcolor
00515         mytmp['flaggedsymbolfill'] = flaggedsymbolfill
00516         mytmp['flaggedsymboloutline'] = flaggedsymboloutline
00517         mytmp['plotrange'] = plotrange
00518         mytmp['title'] = title
00519         mytmp['xlabel'] = xlabel
00520         mytmp['ylabel'] = ylabel
00521         mytmp['showmajorgrid'] = showmajorgrid
00522         mytmp['majorwidth'] = majorwidth
00523         mytmp['majorstyle'] = majorstyle
00524         mytmp['majorcolor'] = majorcolor
00525         mytmp['showminorgrid'] = showminorgrid
00526         mytmp['minorwidth'] = minorwidth
00527         mytmp['minorstyle'] = minorstyle
00528         mytmp['minorcolor'] = minorcolor
00529         mytmp['plotfile'] = plotfile
00530         mytmp['expformat'] = expformat
00531         mytmp['highres'] = highres
00532         mytmp['interactive'] = interactive
00533         mytmp['overwrite'] = overwrite
00534         #
00535         # This task is never suppose to use the task manager to run async
00536         #
00537         async=False
00538         pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/'
00539         trec = casac.casac.utils().torecord(pathname+'plotms.xml')
00540 
00541         casalog.origin('plotms')
00542         try :
00543           #if not trec.has_key('plotms') or not casac.casac.utils().verify(mytmp, trec['plotms']) :
00544             #return False
00545 
00546           casac.casac.utils().verify(mytmp, trec['plotms'], True)
00547           scriptstr=['']
00548           saveinputs = self.__globals__['saveinputs']
00549           saveinputs('plotms', 'plotms.last', myparams, self.__globals__,scriptstr=scriptstr)
00550           if async :
00551             count = 0
00552             keybase =  time.strftime("%y%m%d.%H%M%S")
00553             key = keybase + "_" + str(count)
00554             while self.__async__.has_key(key) :
00555                count += 1
00556                key = keybase + "_" + str(count)
00557             result = tm.execute('plotms', vis, xaxis, xdatacolumn, yaxis, ydatacolumn, selectdata, field, spw, timerange, uvrange, antenna, scan, correlation, array, observation, msselect, averagedata, avgchannel, avgtime, avgscan, avgfield, avgbaseline, avgantenna, avgspw, scalar, transform, freqframe, restfreq, veldef, shift, extendflag, extcorr, extchannel, iteraxis, xselfscale, yselfscale, customsymbol, symbolshape, symbolsize, symbolcolor, symbolfill, symboloutline, coloraxis, customflaggedsymbol, flaggedsymbolshape, flaggedsymbolsize, flaggedsymbolcolor, flaggedsymbolfill, flaggedsymboloutline, plotrange, title, xlabel, ylabel, showmajorgrid, majorwidth, majorstyle, majorcolor, showminorgrid, minorwidth, minorstyle, minorcolor, plotfile, expformat, highres, interactive, overwrite)
00558             print "Use: "
00559             print "      tm.retrieve(return_value) # to retrieve the status"
00560             print 
00561             self.rkey = key
00562             self.__async__[key] = result
00563           else :
00564               tname = 'plotms'
00565               spaces = ' '*(18-len(tname))
00566               casalog.post('\n##########################################'+
00567                            '\n##### Begin Task: ' + tname + spaces + ' #####')
00568               casalog.post(scriptstr[1][1:]+'\n', 'INFO')
00569               result = plotms(vis, xaxis, xdatacolumn, yaxis, ydatacolumn, selectdata, field, spw, timerange, uvrange, antenna, scan, correlation, array, observation, msselect, averagedata, avgchannel, avgtime, avgscan, avgfield, avgbaseline, avgantenna, avgspw, scalar, transform, freqframe, restfreq, veldef, shift, extendflag, extcorr, extchannel, iteraxis, xselfscale, yselfscale, customsymbol, symbolshape, symbolsize, symbolcolor, symbolfill, symboloutline, coloraxis, customflaggedsymbol, flaggedsymbolshape, flaggedsymbolsize, flaggedsymbolcolor, flaggedsymbolfill, flaggedsymboloutline, plotrange, title, xlabel, ylabel, showmajorgrid, majorwidth, majorstyle, majorcolor, showminorgrid, minorwidth, minorstyle, minorcolor, plotfile, expformat, highres, interactive, overwrite)
00570               casalog.post('##### End Task: ' + tname + '  ' + spaces + ' #####'+
00571                            '\n##########################################')
00572 
00573         except Exception, instance:
00574           if(self.__globals__.has_key('__rethrow_casa_exceptions') and self.__globals__['__rethrow_casa_exceptions']) :
00575              raise
00576           else :
00577              #print '**** Error **** ',instance
00578              tname = 'plotms'
00579              casalog.post('An error occurred running task '+tname+'.', 'ERROR')
00580              pass
00581 
00582         gc.collect()
00583         return result
00584 #
00585 #
00586 #
00587     def paramgui(self, useGlobals=True, ipython_globals=None):
00588         """
00589         Opens a parameter GUI for this task.  If useGlobals is true, then any relevant global parameter settings are used.
00590         """
00591         import paramgui
00592         if not hasattr(self, "__globals__") or self.__globals__ == None :
00593            self.__globals__=sys._getframe(len(inspect.stack())-1).f_globals
00594 
00595         if useGlobals:
00596             if ipython_globals == None:
00597                 myf=self.__globals__
00598             else:
00599                 myf=ipython_globals
00600 
00601             paramgui.setGlobals(myf)
00602         else:
00603             paramgui.setGlobals({})
00604 
00605         paramgui.runTask('plotms', myf['_ip'])
00606         paramgui.setGlobals({})
00607 
00608 #
00609 #
00610 #
00611     def defaults(self, param=None, ipython_globals=None, paramvalue=None, subparam=None):
00612         if not hasattr(self, "__globals__") or self.__globals__ == None :
00613            self.__globals__=sys._getframe(len(inspect.stack())-1).f_globals
00614         if ipython_globals == None:
00615             myf=self.__globals__
00616         else:
00617             myf=ipython_globals
00618 
00619         a = odict()
00620         a['vis']  = ''
00621         a['xaxis']  = ''
00622         a['yaxis']  = ''
00623         a['selectdata']  = True
00624         a['averagedata']  = True
00625         a['transform']  = False
00626         a['extendflag']  = False
00627         a['iteraxis']  = ''
00628         a['customsymbol']  = True
00629         a['coloraxis']  = ''
00630         a['customflaggedsymbol']  = False
00631         a['plotrange']  = [
00632         ]
00633         a['title']  = ''
00634         a['xlabel']  = ''
00635         a['ylabel']  = ''
00636         a['showmajorgrid']  = False
00637         a['showminorgrid']  = False
00638         a['plotfile']  = ''
00639 
00640         a['async']=False
00641         a['xaxis'] = {
00642                     0:{'value':''}, 
00643                     1:odict([{'value':'amp'}, {'xdatacolumn':''}]), 
00644                     2:odict([{'value':'amplitude'}, {'xdatacolumn':''}]), 
00645                     3:odict([{'value':'phase'}, {'xdatacolumn':''}]), 
00646                     4:odict([{'value':'real'}, {'xdatacolumn':''}]), 
00647                     5:odict([{'value':'imag'}, {'xdatacolumn':''}]), 
00648                     6:odict([{'value':'imaginary'}, {'xdatacolumn':''}]), 
00649                     7:{'value':'scan'}, 
00650                     8:{'value':'field'}, 
00651                     9:{'value':'time'}, 
00652                     10:{'value':'time_interval'}, 
00653                     11:{'value':'timeinterval'}, 
00654                     12:{'value':'timeint'}, 
00655                     13:{'value':'spw'}, 
00656                     14:{'value':'channel'}, 
00657                     15:{'value':'chan'}, 
00658                     16:{'value':'frequency'}, 
00659                     17:{'value':'freq'}, 
00660                     18:{'value':'correlation'}, 
00661                     19:{'value':'corr'}, 
00662                     20:{'value':'antenna1'}, 
00663                     21:{'value':'ant1'}, 
00664                     22:{'value':'antenna2'}, 
00665                     23:{'value':'ant2'}, 
00666                     24:{'value':'baseline'}, 
00667                     25:{'value':'uvdist'}, 
00668                     26:{'value':'uvwave'}, 
00669                     27:{'value':'uvdist_l'}, 
00670                     28:{'value':'uvdistl'}, 
00671                     29:{'value':'u'}, 
00672                     30:{'value':'v'}, 
00673                     31:{'value':'w'}, 
00674                     32:{'value':'uwave'}, 
00675                     33:{'value':'vwave'}, 
00676                     34:{'value':'wwave'}, 
00677                     35:{'value':'velocity'}, 
00678                     36:{'value':'vel'}, 
00679                     37:{'value':'wt'}, 
00680                     38:{'value':'weight'}, 
00681                     39:{'value':'imwt'}, 
00682                     40:{'value':'flag'}, 
00683                     41:{'value':'azimuth'}, 
00684                     42:{'value':'elevation'}, 
00685                     43:{'value':'hourang'}, 
00686                     44:{'value':'hourangle'}, 
00687                     45:{'value':'parang'}, 
00688                     46:{'value':'parangle'}, 
00689                     47:{'value':'parallacticangle'}, 
00690                     48:{'value':'antenna'}, 
00691                     49:{'value':'ant'}, 
00692                     50:{'value':'ant-azimuth'}, 
00693                     51:{'value':'ant-elevation'}, 
00694                     52:{'value':'ant-hourang'}, 
00695                     53:{'value':'ant-hourangle'}, 
00696                     54:{'value':'ant-parang'}, 
00697                     55:{'value':'ant-parangle'}, 
00698                     56:{'value':'ant-parallacticangle'}, 
00699                     57:{'value':'row'}, 
00700                     58:{'value':'flagrow'}}
00701         a['yaxis'] = {
00702                     0:{'value':''}, 
00703                     1:odict([{'value':'amp'}, {'ydatacolumn':''}]), 
00704                     2:odict([{'value':'amplitude'}, {'ydatacolumn':''}]), 
00705                     3:odict([{'value':'phase'}, {'ydatacolumn':''}]), 
00706                     4:odict([{'value':'real'}, {'ydatacolumn':''}]), 
00707                     5:odict([{'value':'imag'}, {'ydatacolumn':''}]), 
00708                     6:odict([{'value':'imaginary'}, {'ydatacolumn':''}]), 
00709                     7:{'value':'scan'}, 
00710                     8:{'value':'field'}, 
00711                     9:{'value':'time'}, 
00712                     10:{'value':'time_interval'}, 
00713                     11:{'value':'timeinterval'}, 
00714                     12:{'value':'timeint'}, 
00715                     13:{'value':'spw'}, 
00716                     14:{'value':'channel'}, 
00717                     15:{'value':'chan'}, 
00718                     16:{'value':'frequency'}, 
00719                     17:{'value':'freq'}, 
00720                     18:{'value':'correlation'}, 
00721                     19:{'value':'corr'}, 
00722                     20:{'value':'antenna1'}, 
00723                     21:{'value':'ant1'}, 
00724                     22:{'value':'antenna2'}, 
00725                     23:{'value':'ant2'}, 
00726                     24:{'value':'baseline'}, 
00727                     25:{'value':'uvdist'}, 
00728                     26:{'value':'uvwave'}, 
00729                     27:{'value':'uvdist_l'}, 
00730                     28:{'value':'uvdistl'}, 
00731                     29:{'value':'u'}, 
00732                     30:{'value':'v'}, 
00733                     31:{'value':'w'}, 
00734                     32:{'value':'uwave'}, 
00735                     33:{'value':'vwave'}, 
00736                     34:{'value':'wwave'}, 
00737                     35:{'value':'velocity'}, 
00738                     36:{'value':'vel'}, 
00739                     37:{'value':'wt'}, 
00740                     38:{'value':'imwt'}, 
00741                     39:{'value':'flag'}, 
00742                     40:{'value':'azimuth'}, 
00743                     41:{'value':'elevation'}, 
00744                     42:{'value':'hourang'}, 
00745                     43:{'value':'hourangle'}, 
00746                     44:{'value':'parang'}, 
00747                     45:{'value':'parangle'}, 
00748                     46:{'value':'parallacticangle'}, 
00749                     47:{'value':'antenna'}, 
00750                     48:{'value':'ant'}, 
00751                     49:{'value':'ant-azimuth'}, 
00752                     50:{'value':'ant-elevation'}, 
00753                     51:{'value':'ant-hourang'}, 
00754                     52:{'value':'ant-hourangle'}, 
00755                     53:{'value':'ant-parang'}, 
00756                     54:{'value':'ant-parangle'}, 
00757                     55:{'value':'ant-parallacticangle'}, 
00758                     56:{'value':'row'}, 
00759                     57:{'value':'flagrow'}}
00760         a['selectdata'] = {
00761                     0:odict([{'value':True}, {'field':''}, {'spw':''}, {'timerange':''}, {'uvrange':''}, {'antenna':''}, {'scan':''}, {'correlation':''}, {'array':''}, {'observation':''}, {'msselect':''}]), 
00762                     1:{'value':False}}
00763         a['averagedata'] = {
00764                     0:odict([{'value':True}, {'avgchannel':''}, {'avgtime':''}, {'avgscan':False}, {'avgfield':False}, {'avgbaseline':False}, {'avgantenna':False}, {'avgspw':False}, {'scalar':False}]), 
00765                     1:{'value':False}}
00766         a['transform'] = {
00767                     0:{'value':False}, 
00768                     1:odict([{'value':True}, {'freqframe':''}, {'restfreq':''}, {'veldef':'RADIO'}, {'shift':[0.0, 0.0]}])}
00769         a['extendflag'] = {
00770                     0:{'value':False}, 
00771                     1:odict([{'value':True}, {'extcorr':False}, {'extchannel':False}])}
00772         a['iteraxis'] = {
00773                     0:odict([{'notvalue':''}, {'xselfscale':False}, {'yselfscale':False}])}
00774         a['customsymbol'] = {
00775                     0:odict([{'value':True}, {'symbolshape':'autoscaling'}, {'symbolsize':2}, {'symbolcolor':'0000ff'}, {'symbolfill':'fill'}, {'symboloutline':False}]), 
00776                     1:{'value':False}}
00777         a['customflaggedsymbol'] = {
00778                     0:{'value':False}, 
00779                     1:odict([{'value':True}, {'flaggedsymbolshape':'nosymbol'}, {'flaggedsymbolsize':2}, {'flaggedsymbolcolor':'ff0000'}, {'flaggedsymbolfill':'fill'}, {'flaggedsymboloutline':False}])}
00780         a['plotfile'] = {
00781                     0:odict([{'notvalue':''}, {'expformat':''}, {'highres':False}, {'interactive':False}, {'overwrite':False}])}
00782         a['showmajorgrid'] = {
00783                     0:{'value':False}, 
00784                     1:odict([{'value':True}, {'majorwidth':0}, {'majorstyle':''}, {'majorcolor':''}])}
00785         a['showminorgrid'] = {
00786                     0:{'value':False}, 
00787                     1:odict([{'value':True}, {'minorwidth':0}, {'minorstyle':''}, {'minorcolor':''}])}
00788 
00789 ### This function sets the default values but also will return the list of
00790 ### parameters or the default value of a given parameter
00791         if(param == None):
00792                 myf['__set_default_parameters'](a)
00793         elif(param == 'paramkeys'):
00794                 return a.keys()
00795         else:
00796             if(paramvalue==None and subparam==None):
00797                if(a.has_key(param)):
00798                   return a[param]
00799                else:
00800                   return self.itsdefault(param)
00801             else:
00802                retval=a[param]
00803                if(type(a[param])==dict):
00804                   for k in range(len(a[param])):
00805                      valornotval='value'
00806                      if(a[param][k].has_key('notvalue')):
00807                         valornotval='notvalue'
00808                      if((a[param][k][valornotval])==paramvalue):
00809                         retval=a[param][k].copy()
00810                         retval.pop(valornotval)
00811                         if(subparam != None):
00812                            if(retval.has_key(subparam)):
00813                               retval=retval[subparam]
00814                            else:
00815                               retval=self.itsdefault(subparam)
00816                      else:
00817                         retval=self.itsdefault(subparam)
00818                return retval
00819 
00820 
00821 #
00822 #
00823     def check_params(self, param=None, value=None, ipython_globals=None):
00824       if ipython_globals == None:
00825           myf=self.__globals__
00826       else:
00827           myf=ipython_globals
00828 #      print 'param:', param, 'value:', value
00829       try :
00830          if str(type(value)) != "<type 'instance'>" :
00831             value0 = value
00832             value = myf['cu'].expandparam(param, value)
00833             matchtype = False
00834             if(type(value) == numpy.ndarray):
00835                if(type(value) == type(value0)):
00836                   myf[param] = value.tolist()
00837                else:
00838                   #print 'value:', value, 'value0:', value0
00839                   #print 'type(value):', type(value), 'type(value0):', type(value0)
00840                   myf[param] = value0
00841                   if type(value0) != list :
00842                      matchtype = True
00843             else :
00844                myf[param] = value
00845             value = myf['cu'].verifyparam({param:value})
00846             if matchtype:
00847                value = False
00848       except Exception, instance:
00849          #ignore the exception and just return it unchecked
00850          myf[param] = value
00851       return value
00852 #
00853 #
00854     def description(self, key='plotms', subkey=None):
00855         desc={'plotms': 'A plotter/interactive flagger for visibility data.',
00856                'vis': 'input visibility dataset (blank for none)',
00857                'xaxis': 'plot x-axis (blank for default/current)',
00858                'xdatacolumn': 'data column to use for x-axis (blank for default/current)',
00859                'yaxis': 'plot y-axis (blank for default/current)',
00860                'ydatacolumn': 'data column to use for y-axis (blank for default/current)',
00861                'selectdata': 'data selection parameters',
00862                'field': 'field names or field index numbers (blank for all)',
00863                'spw': 'spectral windows:channels (blank for all)',
00864                'timerange': 'time range (blank for all)',
00865                'uvrange': 'uv range (blank for all)',
00866                'antenna': 'antenna/baselines (blank for all)',
00867                'scan': 'scan numbers (blank for all)',
00868                'correlation': 'correlations (blank for all)',
00869                'array': '(sub)array numbers (blank for all)',
00870                'observation': 'Select by observation ID(s)',
00871                'msselect': 'MS selection (blank for all)',
00872                'averagedata': 'data averaging parameters',
00873                'avgchannel': 'average over channel?  (blank = False, otherwise value in channels)',
00874                'avgtime': 'average over time? (blank = False, other value in seconds)',
00875                'avgscan': 'only valid if time averaging is turned on.  average over scans?',
00876                'avgfield': 'only valid if time averaging is turned on.  average over fields?',
00877                'avgbaseline': 'average over all baselines?  (mutually exclusive with avgantenna)',
00878                'avgantenna': 'average by per-antenna?  (mutually exclusive with avgbaseline)',
00879                'avgspw': 'average over all spectral windows?',
00880                'scalar': 'Do scalar averaging?',
00881                'transform': 'transform data in various ways?',
00882                'freqframe': 'the frame in which to render frequency and velocity axes ',
00883                'restfreq': 'Rest frequency to use for velocity conversions ',
00884                'veldef': 'the definition in which to render velocity ',
00885                'shift': 'Adjust phases by this phase center shift [dx,dy] (arcsec)',
00886                'extendflag': 'have flagging extend to other data points?',
00887                'extcorr': 'extend flags based on correlation? ',
00888                'extchannel': 'extend flags based on channel?',
00889                'iteraxis': 'the axis over which to iterate',
00890                'xselfscale': 'Self-scale X axis in each plot ',
00891                'yselfscale': 'Self-scale Y axis in each plot ',
00892                'customsymbol': 'set a custom symbol for unflagged points',
00893                'symbolshape': 'shape of plotted unflagged symbols',
00894                'symbolsize': 'size of plotted unflagged symbols',
00895                'symbolcolor': 'color of plotted unflagged symbols',
00896                'symbolfill': 'fill type of plotted unflagged symbols',
00897                'symboloutline': 'selects outlining plotted unflagged points',
00898                'coloraxis': 'selects which data to use for colorizing',
00899                'customflaggedsymbol': 'set a custom plot symbol for flagged points',
00900                'flaggedsymbolshape': 'shape of plotted flagged symbols',
00901                'flaggedsymbolsize': 'size of plotted flagged symbols',
00902                'flaggedsymbolcolor': 'color of plotted flagged symbols',
00903                'flaggedsymbolfill': 'fill type of plotted flagged symbols',
00904                'flaggedsymboloutline': 'selects outlining plotted flagged points',
00905                'plotrange': 'plot axes ranges: [xmin,xmax,ymin,ymax]',
00906                'title': 'Title written along top of plot',
00907                'xlabel': 'Text for horizontal axis. Blank for default.',
00908                'ylabel': 'Text for vertical axis. Blank for default.',
00909                'showmajorgrid': 'Show major grid lines (horiz and vert.)',
00910                'majorwidth': 'Line width in pixels of major grid lines',
00911                'majorstyle': 'Major grid line style: solid dash dot none',
00912                'majorcolor': 'Color as name or hex code of major grid lines',
00913                'showminorgrid': 'Show minor grid lines (horiz and vert.)',
00914                'minorwidth': 'Line width in pixels of minor grid lines',
00915                'minorstyle': 'Minor grid line style: solid dash dot none',
00916                'minorcolor': 'Color as name or hex code of minor grid lines',
00917                'plotfile': 'Name of plot file to save automatically.',
00918                'expformat': 'Export format type (jpg, png, ps, pdf, txt), if not provided, plotfile extension will be used.',
00919                'highres': 'Use high resolution? Always true for jpg and png.',
00920                'interactive': 'Interactive mode (pop up confirmation window if true, set false for automated scripts to prevent blocking).',
00921                'overwrite': 'Overwrite plot file if it already exists?',
00922 
00923                'async': 'If true the taskname must be started using plotms(...)'
00924               }
00925 
00926 #
00927 # Set subfields defaults if needed
00928 #
00929 
00930         if(desc.has_key(key)) :
00931            return desc[key]
00932 
00933     def itsdefault(self, paramname) :
00934         a = {}
00935         a['vis']  = ''
00936         a['xaxis']  = ''
00937         a['xdatacolumn']  = ''
00938         a['yaxis']  = ''
00939         a['ydatacolumn']  = ''
00940         a['selectdata']  = True
00941         a['field']  = ''
00942         a['spw']  = ''
00943         a['timerange']  = ''
00944         a['uvrange']  = ''
00945         a['antenna']  = ''
00946         a['scan']  = ''
00947         a['correlation']  = ''
00948         a['array']  = ''
00949         a['observation']  = ''
00950         a['msselect']  = ''
00951         a['averagedata']  = True
00952         a['avgchannel']  = ''
00953         a['avgtime']  = ''
00954         a['avgscan']  = False
00955         a['avgfield']  = False
00956         a['avgbaseline']  = False
00957         a['avgantenna']  = False
00958         a['avgspw']  = False
00959         a['scalar']  = False
00960         a['transform']  = False
00961         a['freqframe']  = ''
00962         a['restfreq']  = ''
00963         a['veldef']  = 'RADIO'
00964         a['shift']  = [0.0, 0.0]
00965         a['extendflag']  = False
00966         a['extcorr']  = False
00967         a['extchannel']  = False
00968         a['iteraxis']  = ''
00969         a['xselfscale']  = False
00970         a['yselfscale']  = False
00971         a['customsymbol']  = True
00972         a['symbolshape']  = 'autoscaling'
00973         a['symbolsize']  = 2
00974         a['symbolcolor']  = '0000ff'
00975         a['symbolfill']  = 'fill'
00976         a['symboloutline']  = False
00977         a['coloraxis']  = ''
00978         a['customflaggedsymbol']  = False
00979         a['flaggedsymbolshape']  = 'nosymbol'
00980         a['flaggedsymbolsize']  = 2
00981         a['flaggedsymbolcolor']  = 'ff0000'
00982         a['flaggedsymbolfill']  = 'fill'
00983         a['flaggedsymboloutline']  = False
00984         a['plotrange']  = [
00985         ]
00986         a['title']  = ''
00987         a['xlabel']  = ''
00988         a['ylabel']  = ''
00989         a['showmajorgrid']  = False
00990         a['majorwidth']  = 1
00991         a['majorstyle']  = ''
00992         a['majorcolor']  = 'B0B0B0'
00993         a['showminorgrid']  = False
00994         a['minorwidth']  = 1
00995         a['minorstyle']  = ''
00996         a['minorcolor']  = 'D0D0D0'
00997         a['plotfile']  = ''
00998         a['expformat']  = ''
00999         a['highres']  = False
01000         a['interactive']  = False
01001         a['overwrite']  = False
01002 
01003         #a = sys._getframe(len(inspect.stack())-1).f_globals
01004 
01005         if self.parameters['xaxis']  == 'amp':
01006             a['xdatacolumn'] = ''
01007 
01008         if self.parameters['xaxis']  == 'amplitude':
01009             a['xdatacolumn'] = ''
01010 
01011         if self.parameters['xaxis']  == 'phase':
01012             a['xdatacolumn'] = ''
01013 
01014         if self.parameters['xaxis']  == 'real':
01015             a['xdatacolumn'] = ''
01016 
01017         if self.parameters['xaxis']  == 'imag':
01018             a['xdatacolumn'] = ''
01019 
01020         if self.parameters['xaxis']  == 'imaginary':
01021             a['xdatacolumn'] = ''
01022 
01023         if self.parameters['yaxis']  == 'amp':
01024             a['ydatacolumn'] = ''
01025 
01026         if self.parameters['yaxis']  == 'amplitude':
01027             a['ydatacolumn'] = ''
01028 
01029         if self.parameters['yaxis']  == 'phase':
01030             a['ydatacolumn'] = ''
01031 
01032         if self.parameters['yaxis']  == 'real':
01033             a['ydatacolumn'] = ''
01034 
01035         if self.parameters['yaxis']  == 'imag':
01036             a['ydatacolumn'] = ''
01037 
01038         if self.parameters['yaxis']  == 'imaginary':
01039             a['ydatacolumn'] = ''
01040 
01041         if self.parameters['selectdata']  == True:
01042             a['field'] = ''
01043             a['spw'] = ''
01044             a['timerange'] = ''
01045             a['uvrange'] = ''
01046             a['antenna'] = ''
01047             a['scan'] = ''
01048             a['correlation'] = ''
01049             a['array'] = ''
01050             a['observation'] = ''
01051             a['msselect'] = ''
01052 
01053         if self.parameters['averagedata']  == True:
01054             a['avgchannel'] = ''
01055             a['avgtime'] = ''
01056             a['avgscan'] = False
01057             a['avgfield'] = False
01058             a['avgbaseline'] = False
01059             a['avgantenna'] = False
01060             a['avgspw'] = False
01061             a['scalar'] = False
01062 
01063         if self.parameters['transform']  == True:
01064             a['freqframe'] = ''
01065             a['restfreq'] = ''
01066             a['veldef'] = 'RADIO'
01067             a['shift'] = [0.0, 0.0]
01068 
01069         if self.parameters['extendflag']  == True:
01070             a['extcorr'] = False
01071             a['extchannel'] = False
01072 
01073         if self.parameters['iteraxis']  != '':
01074             a['xselfscale'] = False
01075             a['yselfscale'] = False
01076 
01077         if self.parameters['customsymbol']  == True:
01078             a['symbolshape'] = 'autoscaling'
01079             a['symbolsize'] = 2
01080             a['symbolcolor'] = '0000ff'
01081             a['symbolfill'] = 'fill'
01082             a['symboloutline'] = False
01083 
01084         if self.parameters['customflaggedsymbol']  == True:
01085             a['flaggedsymbolshape'] = 'nosymbol'
01086             a['flaggedsymbolsize'] = 2
01087             a['flaggedsymbolcolor'] = 'ff0000'
01088             a['flaggedsymbolfill'] = 'fill'
01089             a['flaggedsymboloutline'] = False
01090 
01091         if self.parameters['plotfile']  != '':
01092             a['expformat'] = ''
01093             a['highres'] = False
01094             a['interactive'] = False
01095             a['overwrite'] = False
01096 
01097         if self.parameters['showmajorgrid']  == True:
01098             a['majorwidth'] = 0
01099             a['majorstyle'] = ''
01100             a['majorcolor'] = ''
01101 
01102         if self.parameters['showminorgrid']  == True:
01103             a['minorwidth'] = 0
01104             a['minorstyle'] = ''
01105             a['minorcolor'] = ''
01106 
01107         if a.has_key(paramname) :
01108               return a[paramname]
01109 plotms_cli = plotms_cli_()