- Timestamp:
- 01/11/05 12:32:02 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/scantable.py
r181 r189 1 1 from asap._asap import sdtable 2 from numarray import ones 2 from numarray import ones,zeros 3 3 import sys 4 4 … … 386 386 """ 387 387 Compute and return a mask based on [min,max] windows. 388 The specified windows are to be EXCLUDED, when the mask is388 The specified windows are to be INCLUDED, when the mask is 389 389 applied. 390 390 Parameters: … … 392 392 Pairs of start/end points specifying the regions 393 393 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 396 397 Example: 397 398 scan.set_unit('channel') … … 399 400 a) 400 401 msk = scan.set_mask([400,500],[800,900]) 401 # masks the regions between400 and 500402 # masks everything outside 400 and 500 402 403 # and 800 and 900 in the unit 'channel' 403 404 404 405 b) 405 406 msk = scan.set_mask([400,500],[800,900], invert=True) 406 # masks the regions outside400 and 500407 # masks the regions between 400 and 500 407 408 # and 800 and 900 in the unit 'channel' 408 409 … … 414 415 n = self.nchan() 415 416 data = self.getabcissa() 416 msk = ones(n)417 msk = zeros(n) 417 418 for window in args: 418 419 if (len(window) != 2 or window[0] > window[1] ): … … 421 422 for i in range(n): 422 423 if data[i] >= window[0] and data[i] < window[1]: 423 msk[i] = 0424 msk[i] = 1 424 425 if kwargs.has_key('invert'): 425 426 if kwargs.get('invert'): … … 475 476 476 477 validyax = ['spectrum','tsys'] 478 from asap.asaplot import ASAPlot 477 479 if not self._p: 478 from asap.asaplot import ASAPlot479 480 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() 482 486 npan = 1 483 487 x = None
Note:
See TracChangeset
for help on using the changeset viewer.