Changeset 981


Ignore:
Timestamp:
04/04/06 11:58:41 (19 years ago)
Author:
mar637
Message:

Removed align option from average in c++ as it is buggy.
python is now applying it.

Location:
trunk/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapmath.py

    r945 r981  
    4141    varlist = vars()
    4242    if isinstance(args[0],list):
    43         lst = tuple(args[0])
     43        lst = args[0]
    4444    elif isinstance(args[0],tuple):
    45         lst = args[0]
     45        lst = list(args[0])
    4646    else:
    47         lst = tuple(args)
     47        lst = list(args)
    4848
    4949    del varlist["kwargs"]
    5050    varlist["args"] = "%d scantables" % len(lst)
    51     # need special formatting her for history...
     51    # need special formatting here for history...
    5252
    5353    from asap._asap import stmath
     
    6363    if scanav: scanav = "SCAN"
    6464    else: scanav = "NONE"
    65     s = scantable(stm._average(lst, mask, weight, scanav, align))
     65    alignedlst = []
     66    if align:
     67        refepoch = lst[0].get_time(0)
     68        for scan in lst:
     69            alignedlst.append(scan.freq_align(refepoch,insitu=False))
     70    else:
     71        aligendlst = lst
     72    s = scantable(stm._average(alignedlst, mask, weight, scanav))
    6673    s._add_history("average_time",varlist)
    6774    print_log()
  • trunk/python/scantable.py

    r976 r981  
    757757        if mask is None: mask = ()
    758758        if scanav:
    759           scanav = "SCAN"
    760         else:
    761           scanav = "NONE"
    762         s = scantable(self._math._average((self,), mask, weight.upper(),
    763                       scanav, align))
     759            scanav = "SCAN"
     760        else:
     761            scanav = "NONE"
     762        scan = (self,)
     763        if align:
     764            scan = (self.freq_align(insitu=False),)
     765        s = scantable(self._math._average(scan, mask, weight.upper(),
     766                      scanav))
    764767        s._add_history("average_time",varlist)
    765768        print_log()
     
    14461449            tbl = r._getdata()
    14471450            if average:
    1448                 tbl = self._math._average((tbl,),(),'NONE','SCAN', False)
     1451                tbl = self._math._average((tbl,),(),'NONE','SCAN')
    14491452                #tbl = tbl2
    14501453            if not first:
Note: See TracChangeset for help on using the changeset viewer.