[GRASS-dev] pygrass: it is an error of mine?

Dear all,

I have a rasterNumpy map
_____________
type(new)
Out[94]: grass.pygrass.raster.RasterNumpy
_______________

Inside there are some nan and some float32 values.

I would like to set the nans to 0.0

I have tried with:
_____________
whereAreNaNs = np.isnan(new);
new[whereAreNaNs] = 0.0;
_____________

But this is part of what I obtain:

_______________________________________________
new
Out[98]:
RasterNumpy([[ 0. , 0. , 0. ,
0. ,
           0. , 0. , 0. , 0. ,
           0. , 0. , 0. , 0. ,
           0. , 0. , 0. , 0. ,
           0. , 0. , 0. , 0. ],
       [ 0. , 0. , 0. , 0. ,
           0. , 0. , 0. , 0. ,
           0. , 0. , 0. , 0. ,
           0. , 0. , 0. , 0. ,
           0. , 0. , 0. , 0. ],
       [ nan, nan, nan, nan,
                  nan, nan, nan, nan,
                  nan, nan, 339.98999023, nan,
                  nan, nan, nan, 348.72000122,
         348.82998657, nan, nan, nan],
       [ nan, nan, nan, nan,
                  nan, nan, nan, nan,
...
...
___________________________________

It seems that only the first row of the matrix is affected by the
change..

is that my fault?

Thank you very much

Ivan

Hi Ivan,

On Wed, Mar 12, 2014 at 2:13 PM, Ivan Marchesini
<ivan.marchesini@gmail.com> wrote:

Inside there are some nan and some float32 values.

I would like to set the nans to 0.0

[cut]

It seems that only the first row of the matrix is affected by the
change..

I got the same problem trying to set to nan some values, so I think is
a bug in the RasterNumpy class, the weird thing is that it seems to
work for the first two lines...
I have no time to work on it at the moment.

Best regards

Pietro