Changeset 2427 for trunk/python


Ignore:
Timestamp:
03/08/12 16:57:56 (12 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: Yes (CAS-3758)

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs: interactive test with

Put in Release Notes: No

Module(s): sdbaseline, sdfit, sdstat

Description:

Interactivemask module looks for the number of channels in the first
IF to create mask instead of the number recorded in scantable header.
Changed minimum number of channels required from 2 to 1 in
scantable.get_masklist, scantable.get_mask_indices,
Scantable::getMaskRangeList, and Scantable::getMaskEdgeIndices,
because it is not mandatory to have multiple channels in these functions.


Location:
trunk/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/interactivemask.py

    r2117 r2427  
    5555            raise TypeError(msg)
    5656
    57         self.mask = _n_bools(self.scan.nchan(),True)
     57        self.mask = _n_bools(self.scan.nchan(self.scan.getif(0)),True)
    5858        self.callback = None
    5959        self.event = None
     
    9292            self.mask = self.scan.create_mask(masklist,invert=invert)
    9393        elif invert == True:
    94             self.mask = _n_bools(self.scan.nchan(),False)
    95         else:
    96             self.mask = _n_bools(self.scan.nchan(),True)
     94            self.mask = _n_bools(self.scan.nchan(self.scan.getif(0)),False)
     95        else:
     96            self.mask = _n_bools(self.scan.nchan(self.scan.getif(0)),True)
    9797
    9898
  • trunk/python/scantable.py

    r2411 r2427  
    14261426        if not (isinstance(mask,list) or isinstance(mask, tuple)):
    14271427            raise TypeError("The mask should be list or tuple.")
    1428         if len(mask) < 2:
    1429             raise TypeError("The mask elements should be > 1")
     1428        if len(mask) <= 0:
     1429            raise TypeError("The mask elements should be > 0")
    14301430        data = self._getabcissa(row)
    14311431        if len(data) != len(mask):
     
    14671467        if not (isinstance(mask,list) or isinstance(mask, tuple)):
    14681468            raise TypeError("The mask should be list or tuple.")
    1469         if len(mask) < 2:
    1470             raise TypeError("The mask elements should be > 1")
     1469        if len(mask) <= 0:
     1470            raise TypeError("The mask elements should be > 0")
    14711471        istart = []
    14721472        iend = []
Note: See TracChangeset for help on using the changeset viewer.