[GRASS-dev] [GRASS GIS] #1279: i.pca metadata truncated

#1279: i.pca metadata truncated
-----------------------------------+----------------------------------------
Reporter: Barney2011 | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.1
Component: Default | Version: 6.4.0
Keywords: i.pca metadata r.info | Platform: Linux
      Cpu: x86-64 |
-----------------------------------+----------------------------------------
Due to character limits the full metadata of the i.pca module is not
recorded to the resulting raster files.

output should read:
PC1 1170.12 ( -0.63 -0.65 -0.43 ) [ 88.07% ]
instead reads:
PC1 13770134.87 ( 0.1019, 0.5087, 0.1896, 0.5185, 0.4578, 0.4527, 0.107

with loss of vector values and % importance.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1279&gt;
GRASS GIS <http://grass.osgeo.org>

#1279: i.pca metadata truncated
-----------------------------------+----------------------------------------
Reporter: Barney2011 | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.1
Component: Default | Version: 6.4.0
Keywords: i.pca metadata r.info | Platform: Linux
      Cpu: x86-64 |
-----------------------------------+----------------------------------------

Comment(by hamish):

Hi,

could you upload the $MAPSET/hist/$MAPNAME file as an attachment to this
bug report?

also, knowing the exact command used to run the program would help- this
is for 6 input maps, right? is it LANDSAT data?

thanks,
Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1279#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1279: i.pca metadata truncated
-----------------------------------+----------------------------------------
Reporter: Barney2011 | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.1
Component: Default | Version: 6.4.0
Keywords: i.pca metadata r.info | Platform: Linux
      Cpu: x86-64 |
-----------------------------------+----------------------------------------

Comment(by hamish):

more from Rebecca:
{{{

Here is the command (as created through the gui in GRASS7.0)
i.pca
input=1_jan_4789.1@PERMANENT,1_jan_4789.10@PERMANENT,1_jan_4789.11@PERMANENT,\
1_jan_4789.12@PERMANENT,1_jan_4789.13@PERMANENT,1_jan_4789.14@PERMANENT,\
1_jan_4789.2@PERMANENT,1_jan_4789.3@PERMANENT,1_jan_4789.4@PERMANENT
output=Jan_Pca_test

Metadata file attached.

I'm actually using the pca module for airborne spectral data (14 bands
from the CASI2 sensor).
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1279#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1279: i.pca metadata truncated
-----------------------------------+----------------------------------------
Reporter: Barney2011 | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.1
Component: Default | Version: 6.4.0
Keywords: i.pca metadata r.info | Platform: Linux
      Cpu: x86-64 |
-----------------------------------+----------------------------------------

Comment(by hamish):

so it is getting chopped at char 80.
by my calculations 14 bands would need ~140 characters.

maps written by grass 7's i.pca should be ok as they don't have the 80x40
limit. although instead of allocating 256 chars for i.pca/support.c's
tmpeigen we might allocate (bands * 8) + 30 instead. (or perhaps just
1024 and push the problem away a few years)

as for a fix in GRASS 6, I think we need to insert a "\n" then 15 spaces
after each 6th band is
printed (if there's more to come). so it would look like:
{{{
PC14 67.08 ( 0.0188, 0.0040,-0.0002, 0.0096, 0.0023,-0.0056,
                  0.0126,-0.0173,-0.0002, 0.0096, 0.0023,-0.0056,
                  0.0126,-0.0173 ) [ 88.07% ]
}}}

but in the case of 14 bands it would then make the history file 50 lines
long, and so more than the max 40 lines long, at which the command history
would be truncated.

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1279#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1279: i.pca metadata truncated
-----------------------------------+----------------------------------------
Reporter: Barney2011 | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Default | Version: 6.4.0
Keywords: i.pca metadata r.info | Platform: Linux
      Cpu: x86-64 |
-----------------------------------+----------------------------------------
Changes (by neteler):

  * milestone: 6.4.1 => 6.4.3

Comment:

At least for GRASS 7 the raster history limitation should be overcome.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1279#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1279: i.pca metadata truncated
-------------------------------------+--------------------------------------
Reporter: Barney2011 | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.5.0
Component: Imagery | Version: 6.4.0
Keywords: i.pca, metadata, r.info | Platform: Linux
      Cpu: x86-64 |
-------------------------------------+--------------------------------------
Changes (by hamish):

  * keywords: i.pca metadata r.info => i.pca, metadata, r.info
  * component: Default => Imagery
  * milestone: 6.4.3 => 6.5.0

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1279#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>