Changeset 928


Ignore:
Timestamp:
03/24/06 13:41:27 (18 years ago)
Author:
mar637
Message:

re-enabled plotter; added new utility function _to_list(); added empty lists as valid in _is_sequence_or_number; removed scantable.plotter as it is redundant.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/__init__.py

    r895 r928  
    6868    'scantable.autoaverage'      : [True, _validate_bool],
    6969    'scantable.freqframe' : ['LSRK', str],  #default frequency frame
    70     'scantable.plotter'   : [True, _validate_bool], # use internal plotter
    7170    'scantable.verbosesummary'   : [False, _validate_bool]
    7271
     
    215214def _is_sequence_or_number(param, ptype=int):
    216215    if isinstance(param,tuple) or isinstance(param,list):
     216        if len(param) == 0: return True # empty list
    217217        out = True
    218218        for p in param:
     
    223223    return False
    224224
     225def _to_list(param, ptype=int):
     226    if isinstance(param, ptype):
     227        if ptype is str: return param.split()
     228        else: return [param]
     229    if _is_sequence_or_number(param, ptype):
     230        return param
     231    return None
    225232
    226233# workaround for ipython, which redirects this if banner=0 in ipythonrc
     
    254261from numarray import logical_not as mask_not
    255262
    256 # if rcParams['useplotter']:
    257 #     from  asapplotter import *
    258 #     gui = os.environ.has_key('DISPLAY') and rcParams['plotter.gui']
    259 #     plotter = asapplotter(gui)
    260 #     del gui
     263if rcParams['useplotter']:
     264    from  asapplotter import *
     265    gui = os.environ.has_key('DISPLAY') and rcParams['plotter.gui']
     266    plotter = asapplotter(gui)
     267    del gui
    261268
    262269__date__ = '$Date$'.split()[1]
Note: See TracChangeset for help on using the changeset viewer.