[GRASS5] Re: Numercial stuff in GRASS

Markus Neteler neteler at geog.uni-hannover.de
Sat Jul 7 09:13:39 EDT 2001


On Fri, Jul 06, 2001 at 06:18:56AM +0100, Glynn Clements wrote:
> Markus Neteler wrote:
> 
> > as your improvements and comments may be of further interest,
> > I cc it to grass5.
> > 
> > Hi all: Glynn is currently improving the "gmath" lib to add further
> > maxtrix/vector functionality:
> 
> I've also added src/libes/gmath/DEPEND, which lists programs which
> depend upon the gmath library (and which functions).
> 
> The programs are:
> 
> i.cca
> i.fft

there is also i.ifft (reverse fft) - I have added it to DEPEND.

> i.pca
> i.zc
> r.surf.fractal
> r.surf.gauss
> r.surf.random
> i.shape
> 
> At present, I haven't converted any of these programs to use the new
> functions, as I don't know how to test them. Examples would be
> appreciated.

My suggestion is to use test patterns:
Probably useful for FFT:

# generate tilted stripes:
r.mapcalc test="if( (row() + col())%50 > 25,1,null())"
d.rast test

#fft them: result should look perpendicular and one "line" only
i.fft in=test real=real ima=img
d.rast real
d.rast img

i.ifft real=real ima=img out=test_back
# compare result to original:
d.rast test_back
d.rast test
(oops, i.ifft writes 0 instead of NULL!)

The i.pca needs multispectral images, maybe I manage to cut a small portion
from the LANDSAT 7 image of Greece or Israel and publish on GRASS web site
(only lack of time problem).
The i.pca will sort all variance contained in image to the first channels
while the last pca components contain mostly uncorrelated noise only.

The i.zc:
i.zc in=test out=zc
d.rast zc
# should contain only the outlines of "test" pattern.

The i.shape:
i.shape in=test out=shape
# doesn't seem to work...

> r.surf.fractal
> r.surf.gauss
> r.surf.random
-> the "just" generate surfaces (either you get them or not).

> The functions which haven't yet been replaced are:
> 
> fft	copyright issues
> jacobi	use gmath matrix type
> eigen	use gmath matrix type
> del2g	needs to match new fft interface
> rand1	copyright issues
> gauss	copyright issues
> 
> It's unclear as to whether fft should use the gmath matrix type. If it
> should, there should probably be a function to initialise a matrix
> from a raster map layer.
> 
> max_pow2 can remain as-is.

Sorry, I can't recommend here (anyone else?)

Glynn, please keep the modules above working, even if LAPACK is not present,
I hope that's possible not to have LAPACK being a strict dependency.

Thanks for your gmath programming,

 Markus



More information about the grass-dev mailing list