Changeset 1229


Ignore:
Timestamp:
09/01/06 09:31:49 (18 years ago)
Author:
mar637
Message:

Fix for Ticket #68, added 'median' to average_time

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/Release2.1.0b/python/asapmath.py

    r1085 r1229  
    1212        scanav:   True averages each scan separately.
    1313                  False (default) averages all scans together,
    14         weight:   Weighting scheme. 'none, 'var' (1/var(spec)
    15                   weighted), 'tsys' (1/Tsys**2 weighted), 'tint'
    16                   (integration time weighted) or 'tintsys' (Tsys
    17                   and tint). The default is 'tint'
     14        weight:   Weighting scheme.
     15                    'none'     (mean no weight)
     16                    'var'      (1/var(spec) weighted)
     17                    'tsys'     (1/Tsys**2 weighted)
     18                    'tint'     (integration time weighted)
     19                    'tintsys'  (Tint/Tsys**2)
     20                    'median'   ( median averaging)
    1821        align:    align the spectra in velocity before averaging. It takes
    1922                  the time of the first spectrum in the first scantable
     
    7073    else:
    7174        alignedlst = lst
    72     s = scantable(stm._average(alignedlst, mask, weight.upper(), scanav))
     75    if weight.upper() == 'MEDIAN':
     76        # median doesn't support list of scantables - merge first
     77        merged = None
     78        if len(alignedlst) > 1:
     79            merged = merge(alignedlst)
     80        else:
     81            merged = alignedlst[0]
     82        s = scantable(stm._averagechannel(merged, 'MEDIAN', scanav))
     83        del merged
     84    else:
     85        s = scantable(stm._average(alignedlst, mask, weight.upper(), scanav))
    7386    s._add_history("average_time",varlist)
    7487    print_log()
Note: See TracChangeset for help on using the changeset viewer.