Changeset 690 for trunk


Ignore:
Timestamp:
09/26/05 10:19:05 (19 years ago)
Author:
mar637
Message:
  • tidy up, version bump
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/__init__.py

    r665 r690  
    2828     * environ var ASAPRC
    2929     * HOME/.asaprc
    30      
     30
    3131    """
    3232
     
    4747            return fname
    4848    return None
    49        
     49
    5050
    5151defaultParams = {
     
    5454    'useplotter'          : [True, _validate_bool],
    5555    'insitu'              : [True, _validate_bool],
    56    
     56
    5757    # plotting
    5858    'plotter.stacking'    : ['p', str],
    5959    'plotter.panelling'   : ['s', str],
    60    
     60
    6161    # scantable
    6262    'scantable.save'      : ['ASAP', str],
     
    7171
    7272def list_rcparameters():
    73    
     73
    7474    print """
    7575    # general
     
    8282    # apply operations on the input scantable or return new one
    8383    insitu                     : True
    84    
     84
    8585    # plotting
    8686    # default mode for colour stacking
     
    101101
    102102    # apply action to all axes not just the cursor location
    103     scantable.allaxes          : True 
     103    scantable.allaxes          : True
    104104
    105105    # use internal plotter
     
    108108    # Control the level of information printed by summary
    109109    scantable.verbosesummary   : False
    110    
    111     # Fitter   
    112     """
    113    
     110
     111    # Fitter
     112    """
     113
    114114def rc_params():
    115115    'Return the default params updated from the values in the rc file'
    116    
     116
    117117    fname = _asap_fname()
    118    
     118
    119119    if fname is None or not os.path.exists(fname):
    120120        message = 'could not find rc file; returning defaults'
     
    122122        #print message
    123123        return ret
    124        
     124
    125125    cnt = 0
    126126    for line in file(fname):
     
    133133            print ('Illegal line #%d\n\t%s\n\tin file "%s"' % (cnt, line, fname))
    134134            continue
    135        
     135
    136136        key, val = tup
    137137        key = key.strip()
     
    139139            print ('Bad key "%s" on line %d in %s' % (key, cnt, fname))
    140140            continue
    141        
     141
    142142        default, converter =  defaultParams[key]
    143143
     
    161161
    162162# this is the instance used by the asap classes
    163 rcParams = rc_params() 
     163rcParams = rc_params()
    164164
    165165rcParamsDefault = dict(rcParams.items()) # a copy
     
    175175
    176176    sets the current rc params and is equivalent to
    177    
     177
    178178      rcParams['scantable.save'] = 'SDFITS'
    179179
     
    182182
    183183    aliases = {}
    184    
     184
    185185    for k,v in kwargs.items():
    186186        name = aliases.get(k) or k
     
    188188        if not rcParams.has_key(key):
    189189            raise KeyError('Unrecognized key "%s" for group "%s" and name "%s"' % (key, group, name))
    190        
     190
    191191        rcParams[key] = v
    192192
     
    224224    if os.environ.has_key('DISPLAY'):
    225225        print "Initialising asapplotter with the name 'plotter' ..."
    226         import asapplotter 
     226        import asapplotter
    227227        plotter = asapplotter.asapplotter()
    228228    else:
    229229        print "No $DISPLAY set. Disabling plotter.\n"
    230230
    231 #from numarray ones,zeros
    232 
    233 
    234231__date__ = '$Date$'.split()[1]
    235 __version__  = '1.1'
     232__version__  = '1.2'
    236233
    237234def list_scans(t = scantable):
     
    248245
    249246def commands():
    250     x = """   
     247    x = """
    251248    [The scan container]
    252249        scantable           - a container for integrations/scans
     
    287284            history         - print the history of the scantable
    288285            get_fit         - get a fit which has been stored witnh the data
    289             average_time    - return the (weighted) time average of a scan 
     286            average_time    - return the (weighted) time average of a scan
    290287                              or a list of scans
    291288            average_pol     - average the polarisations together.
     
    293290                              all polarisations will contain the
    294291                              averaged spectrum.
     292            auto_quotient   - return the on/off quotient with
     293                              automatic detection of the on/off scans
    295294            quotient        - return the on/off quotient
    296295            scale           - return a scan scaled by a given factor
    297             add             - return a scan with given value added 
     296            add             - return a scan with given value added
    298297            bin             - return a scan with binned channels
    299298            resample        - return a scan with resampled channels
    300299            smooth          - return the spectrally smoothed scan
    301300            poly_baseline   - fit a polynomial baseline to all Beams/IFs/Pols
    302             auto_poly_baseline - automatically fit a polynomial baseline 
     301            auto_poly_baseline - automatically fit a polynomial baseline
    303302            gain_el         - apply gain-elevation correction
    304303            opacity         - apply opacity correction
     
    311310     [Math] Mainly functions which operate on more than one scantable
    312311
    313             average_time    - return the (weighted) time average 
     312            average_time    - return the (weighted) time average
    314313                              of a list of scans
    315314            quotient        - return the on/off quotient
     
    349348            set_abcissa     - specify a user label for the abcissa
    350349            set_layout      - specify the multi-panel layout (rows,cols)
    351            
     350
    352351    [Reading files]
    353352        reader              - access rpfits/sdfits files
     
    369368        mask_not            - boolean operations on masks created with
    370369                              scantable.create_mask
    371        
     370
    372371    Note:
    373372        How to use this with help:
     
    375374        [xxx] is just a category
    376375        Every 'sub-level' in this list should be replaces by a '.' Period when
    377         using help 
     376        using help
    378377        Example:
    379378            ASAP> help scantable # to get info on ths scantable
Note: See TracChangeset for help on using the changeset viewer.