i.pca
Michael Shapiro
shapiro at zorro.cecer.army.mil
Fri Aug 21 08:19:50 EDT 1992
I woke up and realized that this solution for i.pca won't give
you what you need. It will only sample every 3rd pixel, that much
is true. But the resulting output raster maps from i.pca will
have the coarser resolution and this isn't good.
This memory problem will have to be fixed for 4.1.
If you have a fortran compiler, there is a workaround. You can
compile m.eigensystem (under src.contrib/CERL/misc). This will
take an input covariance matrix and output the eigenvalues and
eigen vectors. Then you can use r.mapcalc to build the components
you want. The program r.covar can be used to generate the
covariance matrix to be input to m.eigensystem. There is a manual
entry for m.eigensystem (via g.manual) even though it isn't
compiled. r.covar is fast and uses little memory. This is a
workaround (provided you have fortran) until i.pca gets fixed.

One solution for i.pca is to set your resolution "larger" so that i.pca
doesn't read each pixel, but, say, every 3rd pixel. The difference between
the covariance matrices for all pixels and a subsample would probably
not be significant.

 "i.pca" gives me a G_malloc erros whenever I use it on an image subscene
 > than 900*900 pixels i.e. less than 1 Mb in GRASS compressed raster format?
 ...I don't understand why this is so as we have a 320 H with 32Mb RAM
 & 64 Mb swap space (running AIX 3.2.1).
More information about the grassdev
mailing list