[GRASS-dev] r.series: thresholding?

Hi,

would it be possible to add a threshold parameter to r.series?
In our case, we want to consider only pixels above a certain
value (>=).

Not sure about the implementation: have two flags to define
above/below?

Markus

Markus Neteler wrote:

would it be possible to add a threshold parameter to r.series?

don't know,

In our case, we want to consider only pixels above a
certain value (>=).

Not sure about the implementation: have two flags to define
above/below?

more concise: range=min,max ?

Hamish

On Wed, Oct 15, 2008 at 1:45 AM, Hamish <hamish_b@yahoo.com> wrote:

Markus Neteler wrote:

would it be possible to add a threshold parameter to r.series?

don't know,

You don't know if you like it or don't know how?
It seems to be a simple if condition in the core of the
raster col/row loop.

In our case, we want to consider only pixels above a
certain value (>=).

Not sure about the implementation: have two flags to define
above/below?

more concise: range=min,max ?

I guess above/below or so?

Markus

Markus Neteler wrote:

>> would it be possible to add a threshold parameter to r.series?
>
> don't know,

You don't know if you like it or don't know how?
It seems to be a simple if condition in the core of the
raster col/row loop.

The usual recommendation here would be to process the source data with
r.mapcalc.

I'm aware that adding this feature to r.series could save a fair
amount of time, given that it is often used on large numbers of maps.

However, the same would be true of just about any such transformation
which could be applied to the input data.

--
Glynn Clements <glynn@gclements.plus.com>

On Wed, Oct 15, 2008 at 1:07 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:

Markus Neteler wrote:

>> would it be possible to add a threshold parameter to r.series?
>
> don't know,

You don't know if you like it or don't know how?
It seems to be a simple if condition in the core of the
raster col/row loop.

The usual recommendation here would be to process the source data with
r.mapcalc.

I'm aware that adding this feature to r.series could save a fair
amount of time, given that it is often used on large numbers of maps.

However, the same would be true of just about any such transformation
which could be applied to the input data.

In our projects, we have to play around with various thresholds.

Using r.mapcalc, would replicate my source data n times (or have to
always overwrite them and lose extra computation time on this).

I am speaking here about hundreds to thousands of input maps. While
disk space becomes cheaper, person days become more expensive...

Markus

Markus Neteler wrote:

would it be possible to add a threshold parameter to r.series?
In our case, we want to consider only pixels above a certain
value (>=).

Not sure about the implementation: have two flags to define
above/below?

Implemented in r33886.

r.series has a new option, range=lo,hi; values outside of this range
are treated as null (i.e. will be ignored by most aggregates, or will
cause the result to be null if -n is given).

The values are FP, so you can use -inf or inf for a single threshold,
e.g. range=0,inf to ignore negative values.

--
Glynn Clements <glynn@gclements.plus.com>

On Wed, Oct 15, 2008 at 5:46 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:

Markus Neteler wrote:

would it be possible to add a threshold parameter to r.series?
In our case, we want to consider only pixels above a certain
value (>=).

Not sure about the implementation: have two flags to define
above/below?

Implemented in r33886.

r.series has a new option, range=lo,hi; values outside of this range
are treated as null (i.e. will be ignored by most aggregates, or will
cause the result to be null if -n is given).

The values are FP, so you can use -inf or inf for a single threshold,
e.g. range=0,inf to ignore negative values.

Excellent & quite helpful. I have slightly expanded the docs,
tested and backported it as r33905 to G6.4.

Markus