Changeset 1024


Ignore:
Timestamp:
04/20/06 14:41:10 (19 years ago)
Author:
mar637
Message:

Fixed create_mask to use start and end point. Added example

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r1010 r1024  
    598598        Parameters:
    599599            [min,max],[min2,max2],...
    600                 Pairs of start/end points specifying the regions
     600                Pairs of start/end points (inclusive)specifying the regions
    601601                to be masked
    602602            invert:     optional argument. If specified as True,
     
    608608        Example:
    609609            scan.set_unit('channel')
    610 
    611610            a)
    612             msk = scan.set_mask([400,500],[800,900])
     611            msk = scan.create_mask([400,500],[800,900])
    613612            # masks everything outside 400 and 500
    614613            # and 800 and 900 in the unit 'channel'
    615614
    616615            b)
    617             msk = scan.set_mask([400,500],[800,900], invert=True)
     616            msk = scan.create_mask([400,500],[800,900], invert=True)
    618617            # masks the regions between 400 and 500
    619618            # and 800 and 900 in the unit 'channel'
    620 
     619            c)
     620            mask only channel 400
     621            msk =  scan.create_mask([400,400])
    621622        """
    622623        row = 0
     
    641642                raise TypeError("A window needs to be defined as [min,max]")
    642643            for i in range(n):
    643                 if data[i] >= window[0] and data[i] < window[1]:
     644                if data[i] >= window[0] and data[i] <= window[1]:
    644645                    msk[i] = 1
    645646        if kwargs.has_key('invert'):
Note: See TracChangeset for help on using the changeset viewer.