Opened 12 years ago

Last modified 10 years ago

#1279 new defect

i.pca metadata truncated

Reported by: Barney2011 Owned by: grass-dev@…
Priority: normal Milestone: 6.5.0
Component: Imagery Version: 6.4.0
Keywords: i.pca, metadata, Cc:
CPU: x86-64 Platform: Linux


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.

Attachments (1)

Jan_1_PCA.1 (8.7 KB ) - added by hamish 12 years ago.
$MAPSET/hist/ metadata file

Download all attachments as: .zip

Change History (6)

comment:1 by hamish, 12 years ago


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

comment:2 by hamish, 12 years ago

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.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).

by hamish, 12 years ago

Attachment: Jan_1_PCA.1 added

$MAPSET/hist/ metadata file

comment:3 by hamish, 12 years ago

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.


comment:4 by neteler, 10 years ago


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

comment:5 by hamish, 10 years ago

Component: DefaultImagery
Keywords: i.pca metadata → i.pca, metadata,
Note: See TracTickets for help on using tickets.