Changeset 918 for trunk/python


Ignore:
Timestamp:
03/22/06 21:41:30 (19 years ago)
Author:
mar637
Message:

added merge

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapmath.py

    r876 r918  
    106106        else:
    107107            raise TypeError(msg)
    108     from asap._asap import b_operate as _bop
    109     s = scantable(_bop(left, right, op, tsys))
     108    s = scantable(stm._bop(left, right, op, tsys))
    110109    s._add_history("simple_math", varlist)
    111110    print_log()
    112111    return s
     112
     113def merge(*args):
     114    varlist = vars()
     115    if isinstance(args[0],list):
     116        lst = tuple(args[0])
     117    elif isinstance(args[0],tuple):
     118        lst = args[0]
     119    else:
     120        lst = tuple(args)
     121    varlist["args"] = "%d scantables" % len(lst)
     122    # need special formatting her for history...
     123    from asap._asap import stmath
     124    stm = stmath()
     125    for s in lst:
     126        if not isinstance(s,scantable):
     127            msg = "Please give a list of scantables"
     128            if rcParams['verbose']:
     129                print msg
     130                return
     131            else:
     132                raise TypeError(msg)
     133    s = scantable(stm._merge(lst))
     134    s._add_history("merge", varlist)
     135    print_log()
     136    return s
Note: See TracChangeset for help on using the changeset viewer.