Changeset 1545


Ignore:
Timestamp:
03/27/09 15:52:54 (16 years ago)
Author:
Malte Marquarding
Message:

allow for (max,min) mask windows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r1536 r1545  
    784784             and args or args[0]
    785785        for window in ws:
    786             if (len(window) != 2 or window[0] > window[1] ):
    787                 raise TypeError("A window needs to be defined as [min, max]")
     786            if len(window) != 2:
     787                raise ValueError("A window needs to be defined as [start, end]")
     788            if window[0] > window[1]:
     789                tmp = window[0]
     790                window[0] = window[1]
     791                window[1] = tmp
    788792            for i in range(n):
    789793                if data[i] >= window[0] and data[i] <= window[1]:
Note: See TracChangeset for help on using the changeset viewer.