[GRASS5] r.mapcalc bug/64bit?

Markus Neteler neteler at itc.it
Mon May 1 04:34:47 EDT 2006


On Mon, May 01, 2006 at 08:01:27PM +1200, Hamish wrote:
> > # filter command to check if a new frost period starts or
> > # an existing one continues:
> > GRASS 6.1.cvs (pat):~ > r.mapcalc \
> >    'startday=if(modis_t_a_lst1km20040102.daily_min < -2.0 && \
> >    (startday_previous == 0 || condition_previous == 0), 2, \
> >     startday_previous)'
> >  100%
> > 
> > GRASS 6.1.cvs (pat):~ > r.info -r startday
> > min=-2147483648
> > max=-2147483648
> > 
> > GRASS 6.1.cvs (pat):~ > r.univar startday
> > ...
> > total null and non-null cells: 1136163
> > total null cells: 1136163
> > Of the non-null cells:
> > ----------------------
> > n: 0
> > minimum: nan
> > maximum: nan
> > range: nan
> > mean: nan
> > standard deviation: nan
> > variance: nan
> > variation coefficient: nan %
> > sum: 0
> 
> 
> No problem, besides r.info (both -r and normal) doesn't translate NULLs.

OK, while this is "cosmetics", I wonder why the result is NULL!

I think that the result of the if() condition here [1]:


r.mapcalc 'startday=if(modis_t_a_lst1km20040102.daily_min < -2.0 && (startday_previous == 0 || condition_previous == 0), 2, startday_previous)'

in my case:
r.mapcalc 'startday=if(-16.51 < -2.0 && ( 1 == 0 || 1 == 0), 2, 1)'
                      (    true      && ( false  || false ), 2, 1)

Shouldn't the result be 1 and not NULL?
At least I want 1, how to rewrite the condition?

confused,
  Markus

[1] http://grass.itc.it/pipermail/grass5/2006-April/022623.html




More information about the grass-dev mailing list