Re: [GRASS-user] Using r.resamp.stats for null values

2011-07-05 Thread Glynn Clements

katrin eggert wrote:

> Just one question: is it possible to "count" number of cells with a certain
> value (or nulls) from one scale that are being used to calculate each value
> pixel of the target scale?

Not directly, but you can create a binary (0/1 or null/1) version of
the input map then use "r.resamp.stats method=sum ..." on that.

-- 
Glynn Clements 
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Using r.resamp.stats for null values

2011-07-04 Thread katrin eggert
Just one question: is it possible to "count" number of cells with a certain
value (or nulls) from one scale that are being used to calculate each value
pixel of the target scale?
Thanks


2011/6/22 Glynn Clements 

>
> katrin eggert wrote:
>
> > I just one to confirm one thing. If I'm using r.resamp.stats with
> > *mode *option.
> > If the most frequent value is a null, will i have a null value in the
> ouput?
>
> No.
>
> With the -n option, the output is null if any input cell is null.
> Without the -n option, most aggregates (including "mode") ignore null
> cells; you'll only get a null result if all input cells are null.
>
> IIRC, the only reason that nulls are retained in the array passed to
> the aggregate functions is that some of them (e.g. interspersion,
> regression) consider the cell's position within the array, and having
> the caller discard nulls beforehand would interfere with this.
>
> --
> Glynn Clements 
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Using r.resamp.stats for null values

2011-06-22 Thread Glynn Clements

katrin eggert wrote:

> I just one to confirm one thing. If I'm using r.resamp.stats with
> *mode *option.
> If the most frequent value is a null, will i have a null value in the ouput?

No.

With the -n option, the output is null if any input cell is null. 
Without the -n option, most aggregates (including "mode") ignore null
cells; you'll only get a null result if all input cells are null.

IIRC, the only reason that nulls are retained in the array passed to
the aggregate functions is that some of them (e.g. interspersion,
regression) consider the cell's position within the array, and having
the caller discard nulls beforehand would interfere with this.

-- 
Glynn Clements 
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Using r.resamp.stats for null values

2011-06-21 Thread katrin eggert
Hi there

I just one to confirm one thing. If I'm using r.resamp.stats with
*mode *option.
If the most frequent value is a null, will i have a null value in the ouput?
Thank you
Kat
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Using r.resamp.stats

2011-05-31 Thread Glynn Clements

Jenny Turner wrote:

> I have one question regarding null values: I'm using r.resamp.stats with
> method average. My question is, if I have a Target pixel based on 10 null
> values and 1 non-null value, the target pixel will be based only on valid
> pixel? I mean, it only requires at least 1 value to produce an output value?

Without -n, the aggregate is computed over the non-null values; if all
values are null, the result will be null.

With -n, if any value is null, the result will be null.

-- 
Glynn Clements 
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Using r.resamp.stats

2011-05-31 Thread Jenny Turner
I have one question regarding null values: I'm using r.resamp.stats with
method average. My question is, if I have a Target pixel based on 10 null
values and 1 non-null value, the target pixel will be based only on valid
pixel? I mean, it only requires at least 1 value to produce an output value?

Thanks
Jenny
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] using r.resamp.stats- When I reach a tie

2011-03-01 Thread Glynn Clements

António Rocha wrote:

> >> I'm planning on using r.resamp.stats in order to  resample a grid to a 
> >> coarser resolution. Since I'm using this function with classes I will 
> >> use mode method (more frequentclass to fall into a destination cell is 
> >> the chosen). My question is: when I have a tie between two classes, how 
> >> does GRASS decides which class shall be chosen?
> >> 
> >
> > In the event of a tie, the lowest-numbered category is chosen.
> 
> Thanks for your answer. Is there any other alternative, to resample 
> data, that uses another approach to solve tie events?

What mechanism do you want?

If you wanted e.g. the highest-numbered category, you could use
r.mapcalc to create a map with the categories negated, run
r.resamp.stats on that, then negate the result.

Some other possibilities could reasonably be handled with a
combination of pre- and post-processing.

For others, the only practical solution is to modify
lib/stats/c_mode.c.

-- 
Glynn Clements 
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] using r.resamp.stats- When I reach a tie

2011-02-28 Thread António Rocha

Hi Glynn.
Thanks for your answer. Is there any other alternative, to resample 
data, that uses another approach to solve tie events?

THanks
Antonio

Glynn Clements wrote:

António Rocha wrote:

  
I'm planning on using r.resamp.stats in order to  resample a grid to a 
coarser resolution. Since I'm using this function with classes I will 
use mode method (more frequentclass to fall into a destination cell is 
the chosen). My question is: when I have a tie between two classes, how 
does GRASS decides which class shall be chosen?



In the event of a tie, the lowest-numbered category is chosen.

  




__ Information from ESET NOD32 Antivirus, version of virus signature 
database 5912 (20110227) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] using r.resamp.stats- When I reach a tie

2011-02-25 Thread Glynn Clements

António Rocha wrote:

> I'm planning on using r.resamp.stats in order to  resample a grid to a 
> coarser resolution. Since I'm using this function with classes I will 
> use mode method (more frequentclass to fall into a destination cell is 
> the chosen). My question is: when I have a tie between two classes, how 
> does GRASS decides which class shall be chosen?

In the event of a tie, the lowest-numbered category is chosen.

-- 
Glynn Clements 
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] using r.resamp.stats- When I reach a tie

2011-02-25 Thread António Rocha

Greetings

I'm planning on using r.resamp.stats in order to  resample a grid to a 
coarser resolution. Since I'm using this function with classes I will 
use mode method (more frequentclass to fall into a destination cell is 
the chosen). My question is: when I have a tie between two classes, how 
does GRASS decides which class shall be chosen?


Thanks

Antonio


__ Information from ESET NOD32 Antivirus, version of virus signature 
database 5906 (20110225) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user