From the numarray manual 18.5.1
The result of a unary operation will be masked whenever the original operand was masked.... The following functions have their standard meaning absolute, ...., sin, ... I would have expected this to work import numarray as nx import numarray.ma as ma t = nx.arange(0.0, 2.0, 0.01) tm = ma.masked_outside(t, .2, 1.2) s = nx.sin(tm) but instead I get /usr/lib/python2.4/site-packages/numarray/ma/MA.py in __array__(self, t) 673 if self._mask is not None: 674 if Numeric.any(self._mask): --> 675 raise MAError, \ 676 """Cannot automatically convert masked array to Numeric because data 677 is masked in one or more locations. MAError: Cannot automatically convert masked array to Numeric because data is masked in one or more locations. I see the same with Numeric and MA Am I misreading this? Does "have their standard meaning" mean that MA is not supported? In [8]: numarray.__version__ Out[8]: '1.3.2' In [9]: Numeric.__version__ Out[9]: '24.0b2' JDH
"John" == John Hunter <jdhunter@ace.bsd.uchicago.edu> writes:
John> MAError: Cannot automatically convert masked array to John> Numeric because data is masked in one or more locations. Please ignore me -- I now see you have to use ma.sin not nx.sin (slaps self on head!) import numarray as nx import numarray.ma as ma t = ma.arange(0.0, 2.0, 0.01) tm = ma.masked_outside(t, .2, 1.2) s = ma.sin(tm) JDH
participants (1)
-
John Hunter