casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
cvel_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_cvel import cvel
00018 class cvel_cli_:
00019     __name__ = "cvel"
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__ = (cvel_cli_,)
00028        self.__doc__ = self.__call__.__doc__
00029 
00030        self.parameters={'vis':None, 'outputvis':None, 'passall':None, 'field':None, 'spw':None, 'selectdata':None, 'antenna':None, 'timerange':None, 'scan':None, 'array':None, 'mode':None, 'nchan':None, 'start':None, 'width':None, 'interpolation':None, 'phasecenter':None, 'restfreq':None, 'outframe':None, 'veltype':None, 'hanning':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, outputvis=None, passall=None, field=None, spw=None, selectdata=None, antenna=None, timerange=None, scan=None, array=None, mode=None, nchan=None, start=None, width=None, interpolation=None, phasecenter=None, restfreq=None, outframe=None, veltype=None, hanning=None,  async=None):
00047 
00048         """regrid an MS to a new spectral window / channel structure or frame
00049 
00050        vis -- Name of input visibility file
00051                default: none; example: vis='ngc5921.ms'    
00052 
00053        outputvis -- Name of output measurement set (required)
00054                default: none; example: vis='ngc5921-regridded.ms'    
00055                
00056        passall --  if False, data not meeting the selection is omitted/deleted 
00057                or flagged (if in-row); if True, data not meeting the selection 
00058                on field and spw is passed through without modification
00059                default: False; example: 
00060                field='NGC5921'
00061                passall=False : only data from NGC5921 is included in output MS, 
00062                          no data from other fields (e.g. 1331+305) is included
00063                passall=True : data from NGC5921 is transformed by cvel, all other 
00064                          fields are passed through unchanged 
00065 
00066        field -- Select fields in mosaic.  Use field id(s) or field name(s).
00067                   ['go listobs' to obtain the list id's or names]
00068               default: ''= all fields
00069               If field string is a non-negative integer, it is assumed to
00070                   be a field index otherwise, it is assumed to be a 
00071                   field name
00072               field='0~2'; field ids 0,1,2
00073               field='0,4,5~7'; field ids 0,4,5,6,7
00074               field='3C286,3C295'; field named 3C286 and 3C295
00075               field = '3,4C*'; field id 3, all names starting with 4C
00076 
00077        spw --Select spectral window/channels
00078               NOTE: This selects the data passed as the INPUT to mode
00079               default: ''=all spectral windows and channels
00080                 spw='0~2,4'; spectral windows 0,1,2,4 (all channels)
00081                 spw='0:5~61'; spw 0, channels 5 to 61
00082                 spw='<2';   spectral windows less than 2 (i.e. 0,1)
00083                 spw='0,10,3:3~45'; spw 0,10 all channels, spw 3, 
00084                                    channels 3 to 45.
00085                 spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each.
00086                 spw='0:0~10;15~60'; spectral window 0 with channels 
00087                                     0-10,15-60
00088                 spw='0:0~10,1:20~30,2:1;2;3'; spw 0, channels 0-10,
00089                       spw 1, channels 20-30, and spw 2, channels, 1,2 and 3
00090 
00091        selectdata -- Other data selection parameters
00092               default: True
00093 
00094   >>> selectdata=True expandable parameters
00095 
00096               antenna -- Select data based on antenna/baseline
00097                   default: '' (all)
00098                   If antenna string is a non-negative integer, it is 
00099                     assumed to be an antenna index, otherwise, it is
00100                     considered an antenna name.
00101                   antenna='5&6'; baseline between antenna index 5 and 
00102                                  index 6.
00103                   antenna='VA05&VA06'; baseline between VLA antenna 5 
00104                                        and 6.
00105                   antenna='5&6;7&8'; baselines 5-6 and 7-8
00106                   antenna='5'; all baselines with antenna index 5
00107                   antenna='05'; all baselines with antenna number 05 
00108                                 (VLA old name)
00109                   antenna='5,6,9'; all baselines with antennas 5,6,9 
00110                                    index numbers
00111 
00112               timerange  -- Select data based on time range:
00113                  default = '' (all); examples,
00114                   timerange = 'YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss'
00115                   Note: if YYYY/MM/DD is missing date defaults to first 
00116                         day in data set
00117                   timerange='09:14:0~09:54:0' picks 40 min on first day
00118                   timerange= '25:00:00~27:30:00' picks 1 hr to 3 hr 
00119                              30min on NEXT day
00120                   timerange='09:44:00' pick data within one integration 
00121                              of time
00122                   timerange='>10:24:00' data after this time
00123 
00124               scan -- Scan number range.
00125                   default: '' (all)
00126                   example: scan='1~5'
00127                   Check 'go listobs' to insure the scan numbers are in 
00128                         order.
00129 
00130               array -- Select data by (sub)array indices
00131                   default: '' (all); example:
00132                   array='0~2'; arrays 0 to 2 
00133 
00134       mode -- Frequency Specification:
00135                NOTE: See examples below:
00136                default: 'channel'
00137                  mode = 'channel'; Use with nchan, start, width to specify
00138                          output spw. Produces equidistant grid based on first
00139                          selected channel. See examples below.
00140                  mode = 'velocity', means channels are specified in 
00141                       velocity.
00142                  mode = 'frequency', means channels are specified in 
00143                       frequency.
00144                  mode = 'channel_b', alternative 'channel' mode.
00145                          Does not force an equidistant grid. Faster.
00146 
00147   >>> mode expandable parameters 
00148                Start, width are given in units of channels, frequency 
00149                   or velocity as indicated by mode 
00150                nchan -- Number of channels in output spw
00151                  default: -1 = all channels; example: nchan=3
00152                start -- Start or end input channel (zero-based) depending on the sign of the width parameter
00153                  default=0; example: start=5
00154                width -- Output channel width in units of the input
00155                      channel width (sign indicates whether the start parameter is lower(+) or upper(-) end of the range)
00156                  default=1; example: width=4
00157                interpolation -- Interpolation method (linear, nearest, cubic, spline, fftshift)
00158                  default = 'linear'
00159            examples:
00160                spw = '0,1'; mode = 'channel'
00161                   will produce a single spw containing all channels in spw 
00162                        0 and 1
00163                spw='0:5~28^2'; mode = 'channel'
00164                   will produce a single spw made with channels 
00165                        (5,7,9,...,25,27)
00166                spw = '0'; mode = 'channel': nchan=3; start=5; width=4
00167                   will produce an spw with 3 output channels
00168                   new channel 1 contains data from channels (5+6+7+8)
00169                   new channel 2 contains data from channels (9+10+11+12)
00170                   new channel 3 contains data from channels (13+14+15+16)
00171                spw = '0:0~63^3'; mode='channel'; nchan=21; start = 0; 
00172                    width = 1
00173                   will produce an spw with 21 channels
00174                   new channel 1 contains data from channel 0
00175                   new channel 2 contains data from channel 2
00176                   new channel 21 contains data from channel 61
00177                spw = '0:0~40^2'; mode = 'channel'; nchan = 3; start = 
00178                    5; width = 4
00179                   will produce an spw with three output channels
00180                   new channel 1 contains channels (5,7)
00181                   new channel 2 contains channels (13,15)
00182                   new channel 3 contains channels (21,23)
00183 
00184       phasecenter -- direction measure  or fieldid for the mosaic center
00185                default: '' => first field selected ; example: phasecenter=6
00186                or phasecenter='J2000 19h30m00 -40d00m00'
00187 
00188       restfreq -- Specify rest frequency to use for output image
00189                default='' Occasionally it is necessary to set this (for
00190                example some VLA spectral line data).  For example for
00191                NH_3 (1,1) put restfreq='23.694496GHz'
00192 
00193       outframe -- output reference frame
00194                default='' (keep original reference frame) ; example: outframe='bary'     
00195 
00196       veltype -- definition of velocity (in mode)
00197                default = 'radio'
00198 
00199       hanning -- if true, Hanning smooth frequency channel data to remove Gibbs ringing
00200 
00201 ==================================================================
00202 
00203 The intent of cvel is to transform channel labels and the 
00204 visibilities to a spectral reference frame which is appropriate
00205 for the science analysis, e.g. from TOPO to LSRK to correct for 
00206 Doppler shifts throughout the time of the observation. Naturally, 
00207 this will change the shape of the spectral feature to some extent. 
00208 According to the Nyquist theorem you should oversample a spectrum 
00209 with twice the numbers of channels to retain the shape. Based on 
00210 some tests, however, we recommend to observe with at least 
00211 3-4 times the number of channels for each significant spectral 
00212 feature (like 3-4 times the linewidth). This will minimize 
00213 regridding artifacts in cvel.
00214 
00215 If cvel has already established the grid that is desired for the
00216 imaging, clean should be run with exactly the same frequency/velocity 
00217 parameters as used in cvel in order to avoid additional regridding in 
00218 clean.
00219 
00220 Hanning smoothing is optionally offered in cvel, but tests have 
00221 shown that already the regridding process itself, if it involved 
00222 a transformation from TOPO to a non-terrestrial reference frame, 
00223 implies some smoothing (due to channel interpolation) such that 
00224 Hanning smoothing may not be necessary.
00225 
00226         """
00227         if not hasattr(self, "__globals__") or self.__globals__ == None :
00228            self.__globals__=sys._getframe(len(inspect.stack())-1).f_globals
00229         #casac = self.__globals__['casac']
00230         casalog = self.__globals__['casalog']
00231         #casalog = casac.casac.logsink()
00232         self.__globals__['__last_task'] = 'cvel'
00233         self.__globals__['taskname'] = 'cvel'
00234         ###
00235         self.__globals__['update_params'](func=self.__globals__['taskname'],printtext=False,ipython_globals=self.__globals__)
00236         ###
00237         ###
00238         #Handle globals or user over-ride of arguments
00239         #
00240         function_signature_defaults=dict(zip(self.__call__.func_code.co_varnames,self.__call__.func_defaults))
00241         useLocalDefaults = False
00242 
00243         for item in function_signature_defaults.iteritems():
00244                 key,val = item
00245                 keyVal = eval(key)
00246                 if (keyVal == None):
00247                         #user hasn't set it - use global/default
00248                         pass
00249                 else:
00250                         #user has set it - use over-ride
00251                         if (key != 'self') :
00252                            useLocalDefaults = True
00253 
00254         myparams = {}
00255         if useLocalDefaults :
00256            for item in function_signature_defaults.iteritems():
00257                key,val = item
00258                keyVal = eval(key)
00259                exec('myparams[key] = keyVal')
00260                self.parameters[key] = keyVal
00261                if (keyVal == None):
00262                    exec('myparams[key] = '+ key + ' = self.itsdefault(key)')
00263                    keyVal = eval(key)
00264                    if(type(keyVal) == dict) :
00265                       if len(keyVal) > 0 :
00266                          exec('myparams[key] = ' + key + ' = keyVal[len(keyVal)-1][\'value\']')
00267                       else :
00268                          exec('myparams[key] = ' + key + ' = {}')
00269 
00270         else :
00271             async = self.parameters['async']
00272             myparams['vis'] = vis = self.parameters['vis']
00273             myparams['outputvis'] = outputvis = self.parameters['outputvis']
00274             myparams['passall'] = passall = self.parameters['passall']
00275             myparams['field'] = field = self.parameters['field']
00276             myparams['spw'] = spw = self.parameters['spw']
00277             myparams['selectdata'] = selectdata = self.parameters['selectdata']
00278             myparams['antenna'] = antenna = self.parameters['antenna']
00279             myparams['timerange'] = timerange = self.parameters['timerange']
00280             myparams['scan'] = scan = self.parameters['scan']
00281             myparams['array'] = array = self.parameters['array']
00282             myparams['mode'] = mode = self.parameters['mode']
00283             myparams['nchan'] = nchan = self.parameters['nchan']
00284             myparams['start'] = start = self.parameters['start']
00285             myparams['width'] = width = self.parameters['width']
00286             myparams['interpolation'] = interpolation = self.parameters['interpolation']
00287             myparams['phasecenter'] = phasecenter = self.parameters['phasecenter']
00288             myparams['restfreq'] = restfreq = self.parameters['restfreq']
00289             myparams['outframe'] = outframe = self.parameters['outframe']
00290             myparams['veltype'] = veltype = self.parameters['veltype']
00291             myparams['hanning'] = hanning = self.parameters['hanning']
00292 
00293 
00294         result = None
00295 
00296 #
00297 #    The following is work around to avoid a bug with current python translation
00298 #
00299         mytmp = {}
00300 
00301         mytmp['vis'] = vis
00302         mytmp['outputvis'] = outputvis
00303         mytmp['passall'] = passall
00304         mytmp['field'] = field
00305         mytmp['spw'] = spw
00306         mytmp['selectdata'] = selectdata
00307         mytmp['antenna'] = antenna
00308         mytmp['timerange'] = timerange
00309         mytmp['scan'] = scan
00310         mytmp['array'] = array
00311         mytmp['mode'] = mode
00312         mytmp['nchan'] = nchan
00313         mytmp['start'] = start
00314         mytmp['width'] = width
00315         mytmp['interpolation'] = interpolation
00316         mytmp['phasecenter'] = phasecenter
00317         mytmp['restfreq'] = restfreq
00318         mytmp['outframe'] = outframe
00319         mytmp['veltype'] = veltype
00320         mytmp['hanning'] = hanning
00321         pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/'
00322         trec = casac.casac.utils().torecord(pathname+'cvel.xml')
00323 
00324         casalog.origin('cvel')
00325         try :
00326           #if not trec.has_key('cvel') or not casac.casac.utils().verify(mytmp, trec['cvel']) :
00327             #return False
00328 
00329           casac.casac.utils().verify(mytmp, trec['cvel'], True)
00330           scriptstr=['']
00331           saveinputs = self.__globals__['saveinputs']
00332           saveinputs('cvel', 'cvel.last', myparams, self.__globals__,scriptstr=scriptstr)
00333           if async :
00334             count = 0
00335             keybase =  time.strftime("%y%m%d.%H%M%S")
00336             key = keybase + "_" + str(count)
00337             while self.__async__.has_key(key) :
00338                count += 1
00339                key = keybase + "_" + str(count)
00340             result = tm.execute('cvel', vis, outputvis, passall, field, spw, selectdata, antenna, timerange, scan, array, mode, nchan, start, width, interpolation, phasecenter, restfreq, outframe, veltype, hanning)
00341             print "Use: "
00342             print "      tm.retrieve(return_value) # to retrieve the status"
00343             print 
00344             self.rkey = key
00345             self.__async__[key] = result
00346           else :
00347               tname = 'cvel'
00348               spaces = ' '*(18-len(tname))
00349               casalog.post('\n##########################################'+
00350                            '\n##### Begin Task: ' + tname + spaces + ' #####')
00351               casalog.post(scriptstr[1][1:]+'\n', 'INFO')
00352               result = cvel(vis, outputvis, passall, field, spw, selectdata, antenna, timerange, scan, array, mode, nchan, start, width, interpolation, phasecenter, restfreq, outframe, veltype, hanning)
00353               casalog.post('##### End Task: ' + tname + '  ' + spaces + ' #####'+
00354                            '\n##########################################')
00355 
00356         except Exception, instance:
00357           if(self.__globals__.has_key('__rethrow_casa_exceptions') and self.__globals__['__rethrow_casa_exceptions']) :
00358              raise
00359           else :
00360              #print '**** Error **** ',instance
00361              tname = 'cvel'
00362              casalog.post('An error occurred running task '+tname+'.', 'ERROR')
00363              pass
00364 
00365         gc.collect()
00366         return result
00367 #
00368 #
00369 #
00370     def paramgui(self, useGlobals=True, ipython_globals=None):
00371         """
00372         Opens a parameter GUI for this task.  If useGlobals is true, then any relevant global parameter settings are used.
00373         """
00374         import paramgui
00375         if not hasattr(self, "__globals__") or self.__globals__ == None :
00376            self.__globals__=sys._getframe(len(inspect.stack())-1).f_globals
00377 
00378         if useGlobals:
00379             if ipython_globals == None:
00380                 myf=self.__globals__
00381             else:
00382                 myf=ipython_globals
00383 
00384             paramgui.setGlobals(myf)
00385         else:
00386             paramgui.setGlobals({})
00387 
00388         paramgui.runTask('cvel', myf['_ip'])
00389         paramgui.setGlobals({})
00390 
00391 #
00392 #
00393 #
00394     def defaults(self, param=None, ipython_globals=None, paramvalue=None, subparam=None):
00395         if not hasattr(self, "__globals__") or self.__globals__ == None :
00396            self.__globals__=sys._getframe(len(inspect.stack())-1).f_globals
00397         if ipython_globals == None:
00398             myf=self.__globals__
00399         else:
00400             myf=ipython_globals
00401 
00402         a = odict()
00403         a['vis']  = ''
00404         a['outputvis']  = ''
00405         a['passall']  = False
00406         a['field']  = ''
00407         a['spw']  = ''
00408         a['selectdata']  = True
00409         a['mode']  = 'channel'
00410         a['phasecenter']  = ''
00411         a['restfreq']  = ''
00412         a['outframe']  = ''
00413         a['veltype']  = 'radio'
00414         a['hanning']  = False
00415 
00416         a['async']=False
00417         a['selectdata'] = {
00418                     0:odict([{'value':True}, {'timerange':''}, {'array':''}, {'antenna':''}, {'scan':''}]), 
00419                     1:{'value':False}}
00420         a['mode'] = {
00421                     0:odict([{'value':'channel'}, {'nchan':-1}, {'start':0}, {'width':1}, {'interpolation':'linear'}]), 
00422                     1:odict([{'value':'channel_b'}, {'nchan':-1}, {'start':0}, {'width':1}, {'interpolation':'linear'}]), 
00423                     2:odict([{'value':'velocity'}, {'nchan':-1}, {'start':''}, {'width':''}, {'interpolation':'linear'}]), 
00424                     3:odict([{'value':'frequency'}, {'nchan':-1}, {'start':''}, {'width':''}, {'interpolation':'linear'}])}
00425 
00426 ### This function sets the default values but also will return the list of
00427 ### parameters or the default value of a given parameter
00428         if(param == None):
00429                 myf['__set_default_parameters'](a)
00430         elif(param == 'paramkeys'):
00431                 return a.keys()
00432         else:
00433             if(paramvalue==None and subparam==None):
00434                if(a.has_key(param)):
00435                   return a[param]
00436                else:
00437                   return self.itsdefault(param)
00438             else:
00439                retval=a[param]
00440                if(type(a[param])==dict):
00441                   for k in range(len(a[param])):
00442                      valornotval='value'
00443                      if(a[param][k].has_key('notvalue')):
00444                         valornotval='notvalue'
00445                      if((a[param][k][valornotval])==paramvalue):
00446                         retval=a[param][k].copy()
00447                         retval.pop(valornotval)
00448                         if(subparam != None):
00449                            if(retval.has_key(subparam)):
00450                               retval=retval[subparam]
00451                            else:
00452                               retval=self.itsdefault(subparam)
00453                      else:
00454                         retval=self.itsdefault(subparam)
00455                return retval
00456 
00457 
00458 #
00459 #
00460     def check_params(self, param=None, value=None, ipython_globals=None):
00461       if ipython_globals == None:
00462           myf=self.__globals__
00463       else:
00464           myf=ipython_globals
00465 #      print 'param:', param, 'value:', value
00466       try :
00467          if str(type(value)) != "<type 'instance'>" :
00468             value0 = value
00469             value = myf['cu'].expandparam(param, value)
00470             matchtype = False
00471             if(type(value) == numpy.ndarray):
00472                if(type(value) == type(value0)):
00473                   myf[param] = value.tolist()
00474                else:
00475                   #print 'value:', value, 'value0:', value0
00476                   #print 'type(value):', type(value), 'type(value0):', type(value0)
00477                   myf[param] = value0
00478                   if type(value0) != list :
00479                      matchtype = True
00480             else :
00481                myf[param] = value
00482             value = myf['cu'].verifyparam({param:value})
00483             if matchtype:
00484                value = False
00485       except Exception, instance:
00486          #ignore the exception and just return it unchecked
00487          myf[param] = value
00488       return value
00489 #
00490 #
00491     def description(self, key='cvel', subkey=None):
00492         desc={'cvel': 'regrid an MS to a new spectral window / channel structure or frame',
00493                'vis': 'Name of input measurement set',
00494                'outputvis': 'Name of output measurement set',
00495                'passall': 'Pass through (write to output MS) non-selected data with no change',
00496                'field': 'Select field using field id(s) or field name(s)',
00497                'spw': 'Select spectral window/channels',
00498                'selectdata': 'Other data selection parameters',
00499                'antenna': 'Select data based on antenna/baseline',
00500                'timerange': 'Range of time to select from data',
00501                'scan': 'scan number range',
00502                'array': '(sub)array indices',
00503                'mode': ' Regridding mode ',
00504                'nchan': 'Number of channels in output spw (-1=all)',
00505                'start': 'First channel in input to use',
00506                'width': 'Number of input channels to average',
00507                'interpolation': 'Spectral interpolation method',
00508                'phasecenter': 'Image phase center: position or field index',
00509                'restfreq': 'rest frequency (see help)',
00510                'outframe': 'Output frame (\'\'=keep input frame)',
00511                'veltype': 'velocity definition',
00512                'hanning': ' If true, Hanning smooth data before regridding to remove Gibbs ringing.',
00513 
00514                'async': 'If true the taskname must be started using cvel(...)'
00515               }
00516 
00517 #
00518 # Set subfields defaults if needed
00519 #
00520         if(subkey == 'channel'):
00521           desc['start'] = 'first input channel to use'
00522         if(subkey == 'channel_b'):
00523           desc['start'] = 'first input channel to use'
00524         if(subkey == 'velocity'):
00525           desc['start'] = 'Velocity of first image channel: e.g \'0.0km/s\''
00526         if(subkey == 'velocity'):
00527           desc['width'] = 'image channel width in velocity units: e.g \'-1.0km/s\''
00528         if(subkey == 'frequency'):
00529           desc['start'] = 'Frequency of first image channel: e.q. \'1.4GHz\''
00530         if(subkey == 'frequency'):
00531           desc['width'] = 'Image channel width in frequency units: e.g \'1.0kHz\''
00532 
00533         if(desc.has_key(key)) :
00534            return desc[key]
00535 
00536     def itsdefault(self, paramname) :
00537         a = {}
00538         a['vis']  = ''
00539         a['outputvis']  = ''
00540         a['passall']  = False
00541         a['field']  = ''
00542         a['spw']  = ''
00543         a['selectdata']  = True
00544         a['antenna']  = ''
00545         a['timerange']  = ''
00546         a['scan']  = ''
00547         a['array']  = ''
00548         a['mode']  = 'channel'
00549         a['nchan']  = -1
00550         a['start']  = 0
00551         a['width']  = 1
00552         a['interpolation']  = 'linear'
00553         a['phasecenter']  = ''
00554         a['restfreq']  = ''
00555         a['outframe']  = ''
00556         a['veltype']  = 'radio'
00557         a['hanning']  = False
00558 
00559         #a = sys._getframe(len(inspect.stack())-1).f_globals
00560 
00561         if self.parameters['selectdata']  == True:
00562             a['timerange'] = ''
00563             a['array'] = ''
00564             a['antenna'] = ''
00565             a['scan'] = ''
00566 
00567         if self.parameters['mode']  == 'channel':
00568             a['nchan'] = -1
00569             a['start'] = 0
00570             a['width'] = 1
00571             a['interpolation'] = 'linear'
00572 
00573         if self.parameters['mode']  == 'channel_b':
00574             a['nchan'] = -1
00575             a['start'] = 0
00576             a['width'] = 1
00577             a['interpolation'] = 'linear'
00578 
00579         if self.parameters['mode']  == 'velocity':
00580             a['nchan'] = -1
00581             a['start'] = ''
00582             a['width'] = ''
00583             a['interpolation'] = 'linear'
00584 
00585         if self.parameters['mode']  == 'frequency':
00586             a['nchan'] = -1
00587             a['start'] = ''
00588             a['width'] = ''
00589             a['interpolation'] = 'linear'
00590 
00591         if a.has_key(paramname) :
00592               return a[paramname]
00593 cvel_cli = cvel_cli_()