[GRASS-dev] r.series method=minimum yields float map when integer maps are used as input

Nikos Alexandris nik at nikosalexandris.net
Sun Aug 26 08:48:15 PDT 2018



Le Dimanche 26 août 2018, Veronica Andreo a écrit :
> Hi Nikos,
> 
> El dom., 26 ago. 2018 13:16, Nikos Alexandris <nik at nikosalexandris.net>
> escribió:
> 
> > * Veronica Andreo <veroandreo at gmail.com> [2018-08-25 18:17:51 +0200]:
> >
> > >Hi devs,
> > >
> > >If I use a series of integer type maps as input to t.rast.series or
> > >r.series and select minimum as method, the output is a floating point map.
> > >I would have thought that if the input are integers then output should be
> > >integer as well. I realized when I made a plot of the map and got a smooth
> > >legend instead of integer numbers.
> > >
> > >Here an example:
> > >
> > >{{{
> > >for i in `seq 1 6` ; do r.mapcalc expression="map${i} = ${i}" ; done
> > >r.info map1 <<-- CELL
> > >r.series input=`g.list rast pat=map* sep=,` method=minimum output=test_min
> > >r.info test_min <<-- DCELL
> > >}}}
> > >
> > >Is this an expected behaviour?
> >
> > Vero,
> >
> > just guessing,
> >
> > maybe it's similar to my question about 'count' in `r.stats.zonal` [0]:
> > use of DCELL allows for integers larger than CELL (32-bit).
> 
> 
> Thanks for your answer. I can understand the storage of 'count' output as
> double since the count can exceed the length of input data type. But why
> minimum? If I input integer data, the minimum of a set of integer numbers
> should be integer, no? How can it exceed the CELL range if it is the
> minimum of that range?
> 
> Just thinking out loud

Me too: among a long 'series' of minimums, maybe an extreme min? 

:-)

Maybe a silly thought.

Nikos


More information about the grass-dev mailing list