Changeset 2900 for trunk/python


Ignore:
Timestamp:
03/12/14 12:23:31 (10 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-5875

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: test_sdcoadd

Put in Release Notes: No

Module(s): sd

Description: Describe your changes here...

Added freq_tol parameter to asapmath.merge.
The freq_tol allows to specify frequency tolerance as
numeric value (1.0e6) or string ('1MHz'). The value will
be used to merge FREQUENCIES rows, FREQ_ID, and IFNO.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapmath.py

    r2845 r2900  
    823823
    824824@asaplog_post_dec
    825 def merge(*args):
     825def merge(*args, **kwargs):
    826826    """
    827827    Merge a list of scanatables, or comma-sperated scantables into one
     
    829829    Parameters:
    830830        A list [scan1, scan2] or scan1, scan2.
     831        freq_tol: frequency tolerance for merging IFs. numeric values
     832                  in units of Hz (1.0e6 -> 1MHz) and string ('1MHz')
     833                  is allowed.
    831834    Example:
    832835        myscans = [scan1, scan2]
     
    834837        # or equivalent
    835838        sameallscans = merge(scan1, scan2)
     839        # with freqtol
     840        allscans = merge(scan1, scan2, freq_tol=1.0e6)
     841        # or equivalently
     842        allscans = merge(scan1, scan2, freq_tol='1MHz')
    836843    """
    837844    varlist = vars()
     
    842849    else:
    843850        lst = tuple(args)
     851    if kwargs.has_key('freq_tol'):
     852        freq_tol = str(kwargs['freq_tol'])
     853    else:
     854        freq_tol = ''
    844855    varlist["args"] = "%d scantables" % len(lst)
    845856    # need special formatting her for history...
     
    850861            msg = "Please give a list of scantables"
    851862            raise TypeError(msg)
    852     s = scantable(stm._merge(lst))
     863    s = scantable(stm._merge(lst, freq_tol))
    853864    s._add_history("merge", varlist)
    854865    return s
Note: See TracChangeset for help on using the changeset viewer.