Tue, May 6 2003
14:47:21
|
|
Request created by guest
|
|
Subject: merge of r.average, r.median and r.mode
grass binary for platform: Compiled from Sources
To reduce the number of modules, the modules
r.average
r.median
r.mode
should be merged. The new module may have a "method" parameter
similar to r.neighbors.
Markus
|
|
Thu, Dec 18 2003
15:57:52
|
|
Taken by smitchell
|
|
Thu, Dec 18 2003
16:04:30
|
|
Comments added by smitchell
|
|
Cc: grass5@grass.itc.it
If there are no objections, I'd like to tackle this request tracker issue (Markus'
suggestion #1848,
to merge r.average, r.median, and r.mode), as I've been thinking a fair bit about
these.
Currently there is the GRASS/R interface for this kind of work, but for some
of the larger
datasets I use, that's not very efficient. There is also r.statistics, but it
only works on integers.
I also have an "in-house" command (r.polystats), which evolved from some grass4.1
(r.pinpoly)
code that I inherited. It calculates several other statistics as well. But
it has lots of legacy
"messy" code issues, so I'd like to take ideas from it rather than large amounts
of code.
I'm thinking to package all of this functionality together into a "new" r.statistics,
starting with the
mode median and average "engines" from the current up to date modules, and adding
in the
other statistics as I get to them.
Comments, suggestions etc welcome.
Scott Mitchell
smitch@mac.com
|
|
Fri, Dec 19 2003
02:38:37
|
|
Comments added by hbowman
|
|
Cc: grass5@grass.itc.it
There is a lot of room for code merging here, see the following thread:
http://article.gmane.org/gmane.comp.gis.grass.devel/1969
http://article.gmane.org/gmane.comp.gis.grass.devel/1970
http://article.gmane.org/gmane.comp.gis.grass.devel/1973
http://article.gmane.org/gmane.comp.gis.grass.devel/2380
Summary:
It would be nice to take the functions from
src/raster/r.series/cmd/c_*
and make a stats library in
src/libes/gmath
?
Hamish
|
|
Fri, Dec 19 2003
03:14:23
|
|
Mail sent by glynn.clements@virgin.net
|
|
Return-Path |
<glynn.clements@virgin.net>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
From |
Glynn Clements <glynn.clements@virgin.net>
|
MIME-Version |
1.0
|
Content-Type |
text/plain; charset=us-ascii
|
Content-Transfer-Encoding |
7bit
|
Message-ID |
<16354.24016.621651.918148@cerise.nosuchdomain.co.uk>
|
Date |
Fri, 19 Dec 2003 02:09:20 +0000
|
To |
Harmisch Bowman via RT <grass-bugs@intevation.de>
|
Cc |
grass5@grass.itc.it
|
Subject |
Re: [GRASS5] [bug #1848] (grass) merge of r.average, r.median and r.mode
|
In-Reply-To |
<20031219013837.2657813B18@lists.intevation.de>
|
References |
<20031219013837.2657813B18@lists.intevation.de>
|
X-Mailer |
VM 7.07 under 21.4 (patch 14) "Reasonable Discussion" XEmacs Lucid
|
X-Spam-Status |
No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
|
X-Spam-Level |
|
Harmisch Bowman via RT wrote:
> this bug's URL: http://intevation.de/rt/webrt?serial_num=1848
> There is a lot of room for code merging here, see the following thread:
>
> http://article.gmane.org/gmane.comp.gis.grass.devel/1969
> http://article.gmane.org/gmane.comp.gis.grass.devel/1970
> http://article.gmane.org/gmane.comp.gis.grass.devel/1973
> http://article.gmane.org/gmane.comp.gis.grass.devel/2380
>
>
> Summary:
>
> It would be nice to take the functions from
> src/raster/r.series/cmd/c_*
>
> and make a stats library in
> src/libes/gmath
Those functions are only suitable for handling relatively small
amounts of data, as they require the entire set to be passed as a
single array. E.g. computing the mean cell value for an entire map
would require reading the entire map into memory.
A more useful interface would have begin/update/end operations, with
the update operation being called repeatedly in a loop. However, some
aggregates might need multiple passes.
E.g. for computing the median, you want to avoid having to sort large
lists. It would be preferable to have a first pass which simply counts
the number of values falling into each of a number of ranges. From
this, you can determine the range into which the median falls, and the
position of the median within that range. A second pass would extract
the subset of values which fall into that range. Finally, you sort the
subset and extract the appropriate element.
For a highly uneven distribution, you might need to make several
passes before getting a subset which is small enough to sort (the
first pass might have 99% of the data in a single range).
This isn't an issue for r.series; because it needs to have all of the
input maps open simultaneously, the limit on the number of open maps
will ensure that the number of samples remains manageable.
But, in general, assuming that the entire set fits into memory
excludes any application where the set is either an entire raster or a
significant portion of one. So I doubt that the code from r.series is
of much use except for r.series (and possibly r.mapcalc; although the
nature of r.mapcalc's interface is such that the required "glue" code
may exceed that of the actual algorithm).
--
Glynn Clements <glynn.clements@virgin.net>
|
|
Fri, Nov 19 2004
08:53:54
|
|
Comments added by guest
|
|
From: Scott Mitchell <smitchmaccom>
Subject: Re: [GRASS5] Porting list
Date: Thu, 18 Nov 2004 08:26:45 -0500
List-Post: <mailto:grass5@grass.itc.it>
I think there are unresolved issues here - I see that the floating
point prohibition in r.statistics seems to be gone, but in a silly test
example I just tried testing r.statistics against r.average using a
floating point base map, and I get output from r.average, but all NULLs
from r.statistics using method=average.
|
|
Sat, Feb 26 2005
17:41:23
|
|
Area changed to wish5.7 by mneteler
|
|
Wed, Aug 31 2005
13:42:51
|
|
Area changed to wish6 by msieczka
|
|
Tue, Nov 8 2005
08:53:13
|
|
Mail sent by mneteler
|
|
Scott,
could you try this again? Today a bug was fixed in r.stats
for FP maps.
Markus |
|
Mon, Nov 27 2006
02:34:15
|
|
Comments added by hbowman
|
|
WRT to these modules:
r.sum, r.mode, r.median, r.average, r.statistics, r.univar, r.univar2
maybe they can be reduced to just r.statistics and r.univar?
Hamish
|
|