Changeset 189 for trunk


Ignore:
Timestamp:
01/11/05 12:32:02 (20 years ago)
Author:
mar637
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r181 r189  
    11from asap._asap import sdtable
    2 from numarray import ones
     2from numarray import ones,zeros
    33import sys
    44
     
    386386        """
    387387        Compute and return a mask based on [min,max] windows.
    388         The specified windows are to be EXCLUDED, when the mask is
     388        The specified windows are to be INCLUDED, when the mask is
    389389        applied.
    390390        Parameters:
     
    392392                Pairs of start/end points specifying the regions
    393393                to be masked
    394             invert:     return an inverted mask, i.e. the regions
    395                         specified are not masked (INCLUDED)
     394            invert:     optional argument. If specified as True,
     395                        return an inverted mask, i.e. the regions
     396                        specified are EXCLUDED
    396397        Example:
    397398            scan.set_unit('channel')
     
    399400            a)
    400401            msk = scan.set_mask([400,500],[800,900])
    401             # masks the regions between 400 and 500
     402            # masks everything outside 400 and 500
    402403            # and 800 and 900 in the unit 'channel'
    403404
    404405            b)
    405406            msk = scan.set_mask([400,500],[800,900], invert=True)
    406             # masks the regions outside 400 and 500
     407            # masks the regions between 400 and 500
    407408            # and 800 and 900 in the unit 'channel'
    408409           
     
    414415        n = self.nchan()
    415416        data = self.getabcissa()
    416         msk = ones(n)
     417        msk = zeros(n)
    417418        for  window in args:
    418419            if (len(window) != 2 or window[0] > window[1] ):
     
    421422            for i in range(n):
    422423                if data[i] >= window[0] and data[i] < window[1]:
    423                     msk[i] = 0
     424                    msk[i] = 1
    424425        if kwargs.has_key('invert'):
    425426            if kwargs.get('invert'):
     
    475476
    476477        validyax = ['spectrum','tsys']
     478        from asap.asaplot import ASAPlot
    477479        if not self._p:
    478             from asap.asaplot import ASAPlot
    479480            self._p = ASAPlot()
    480 #            print "Plotting not enabled"
    481 #            return
     481            #print "Plotting not enabled"
     482            #return
     483        if self._p.is_dead:
     484            del self._p
     485            self._p = ASAPlot()
    482486        npan = 1
    483487        x = None
Note: See TracChangeset for help on using the changeset viewer.