[GRASS-dev] adding lib_arraystats

Glynn Clements glynn at gclements.plus.com
Fri Feb 15 18:33:04 EST 2008


Roger Bivand wrote:

> > What r.series and r.resamp.stats need is:
> >
> > 	Initialise R
> > 	For each cell:
> > 		push a vector of doubles into R
> > 		call the R function on the vector
> > 		pull the result (a single double) from R
> > 	Shut down R
> 
> Certainly feasible. Probably it would be reasonable to block up the single 
> cell, to push a cube of doubles and pull a matrix of doubles (vector with 
> three dimensions/two dimensions), but that is just a performance question 
> of whether the push/pull operations are costly compared to the vectorised 
> function within R operating on multiple cells. Are we in Python for this?

I'm referring to the case of calling R from C; no Python involved.

For r.series and r.resamp.stats[1], blocking the data would only
provide a significant benefit if there was a substantial per-call
overhead.

[1] For "r.resamp.stats -w", there would be some benefit to
maintaining a sliding window in R, to avoid having to transfer
boundary cells more than once.

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


More information about the grass-dev mailing list