Changeset 1678 for branches/alma


Ignore:
Timestamp:
01/28/10 17:48:32 (14 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-1823

Ready to Release: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Bug fix.

  • self.nchan(0) is replaced with self.nchan(self.getifnos()[0])
  • casalog.post() should not use. Use asaplog.push() and print_log() instead.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/alma/python/scantable.py

    r1677 r1678  
    20472047            if len(other) == self.nrow():
    20482048                s = scantable(self._math._arrayop(self.copy(), other, "ADD", False, 'row'))
    2049             elif len(other) == self.nchan(0):
     2049            elif len(other) == self.nchan(self.getifnos()[0]):
    20502050                s = scantable(self._math._arrayop(self.copy(), other, "ADD", False, 'channel'))
    20512051            else:
    2052                 casalog.post( 'Length of list operand should equal to either scantable.nchan() or scantable.nrow().', 'ERROR' )
     2052                asaplog.push( 'Length of list operand should equal to either scantable.nchan() or scantable.nrow().' )
     2053                print_log( 'ERROR' )
    20532054        else:
    20542055            raise TypeError("Other input is not a scantable or float value or float list")
     
    20702071            if len(other) == self.nrow():
    20712072                s = scantable(self._math._arrayop(self.copy(), other, "SUB", False, 'row'))
    2072             elif len(other) == self.nchan(0):
     2073            elif len(other) == self.nchan(self.getifnos()[0]):
    20732074                s = scantable(self._math._arrayop(self.copy(), other, "SUB", False, 'channel'))
    20742075            else:
    2075                 casalog.post( 'Length of list operand should equal to either scantable.nchan() or scantable.nrow().', 'ERROR' )
     2076                asaplog.push( 'Length of list operand should equal to either scantable.nchan() or scantable.nrow().' )
     2077                print_log( 'ERROR' )
    20762078        else:
    20772079            raise TypeError("Other input is not a scantable or float value or float list")
     
    20932095            if len(other) == self.nrow():
    20942096                s = scantable(self._math._arrayop(self.copy(), other, "MUL", False, 'row'))
    2095             elif len(other) == self.nchan(0):
     2097            elif len(other) == self.nchan(self.getifnos()[0]):
    20962098                s = scantable(self._math._arrayop(self.copy(), other, "MUL", False, 'channel'))
    20972099            else:
    2098                 casalog.post( 'Length of list operand should equal to either scantable.nchan() or scantable.nrow().', 'ERROR' )
     2100                asaplog.push( 'Length of list operand should equal to either scantable.nchan() or scantable.nrow().' )
     2101                print_log( 'ERROR' )
    20992102        else:
    21002103            raise TypeError("Other input is not a scantable or float value or float list")
     
    21182121            if len(other) == self.nrow():
    21192122                s = scantable(self._math._array2dop(self.copy(), other, "DIV", False, 'row'))
    2120             elif len(other) == self.nchan(0):
     2123            elif len(other) == self.nchan(self.getifnos()[0]):
    21212124                s = scantable(self._math._arrayop(self.copy(), other, "DIV", False, 'channel'))
    21222125            else:
    2123                 casalog.post( 'Length of list operand should equal to either scantable.nchan() or scantable.nrow().', 'ERROR' )
     2126                asaplog.push( 'Length of list operand should equal to either scantable.nchan() or scantable.nrow().' )
     2127                print_log( 'ERROR' )
    21242128        else:
    21252129            raise TypeError("Other input is not a scantable or float value or float list")
Note: See TracChangeset for help on using the changeset viewer.