[GRASS-dev] [GRASS GIS] #3865: i.spec.unmix: map writeout broken

#3865: i.spec.unmix: map writeout broken
--------------------------+-------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Imagery | Version: unspecified
Keywords: i.spec.unmix | CPU: x86-64
Platform: Unspecified |
--------------------------+-------------------------
For unknow reasons i.spec.unmix is unable to write out the resulting maps:

{{{
GRASS 7.7.dev (nc_spm_08_grass7):~ >

g.region raster=lsat7_2002_10 -p
[...]
nsres: 28.5
ewres: 28.5
rows: 475
cols: 527
cells: 250325

i.spec.unmix group=lsat_2002 matrix=spectrum.txt result=lsat7_2002_unmix
error=lsat7_2002_unmix_err iter=lsat7_2002_unmix_iterations
D0/0: buff: Matrix: 5 by 7
Opening input file no. 1 [lsat7_2002_10]
Opening input file no. 2 [lsat7_2002_20]
Opening input file no. 3 [lsat7_2002_30]
Opening input file no. 4 [lsat7_2002_40]
Opening input file no. 5 [lsat7_2002_50]
Opening input file no. 6 [lsat7_2002_70]
Opening input file no. 7 [lsat7_2002_80]
Opening output file [lsat7_2002_unmix.1]
Opening output file [lsat7_2002_unmix.2]
Opening output file [lsat7_2002_unmix.3]
Opening output file [lsat7_2002_unmix.4]
Opening output file [lsat7_2002_unmix.5]
Opening error file [lsat7_2002_unmix_err]
Opening iteration file [lsat7_2002_unmix_iterations]
Checking linear dependencies (orthogonality check) of Matrix A...
Angle between row 1 and row 2: 60.9753 degree
Angle between row 1 and row 3: 56.5953 degree
Angle between row 1 and row 4: 34.7591 degree
Angle between row 1 and row 5: 43.122 degree
Angle between row 2 and row 1: 60.9753 degree
Angle between row 2 and row 3: 42.7788 degree
Angle between row 2 and row 4: 35.7377 degree
Angle between row 2 and row 5: 40.2744 degree
Angle between row 3 and row 1: 56.5953 degree
Angle between row 3 and row 2: 42.7788 degree
Angle between row 3 and row 4: 32.3279 degree
Angle between row 3 and row 5: 28.9019 degree
Angle between row 4 and row 1: 34.7591 degree
Angle between row 4 and row 2: 35.7377 degree
Angle between row 4 and row 3: 32.3279 degree
Angle between row 4 and row 5: 28.552 degree
Angle between row 5 and row 1: 43.122 degree
Angle between row 5 and row 2: 40.2744 degree
Angle between row 5 and row 3: 28.9019 degree
Angle between row 5 and row 4: 28.552 degree
Spectral matrix is o.k. Proceeding...
Calculating for 475 x 527 pixels (7 bands) = 277729 pixelvectors.
  100%
ERROR: Unable to open header file for raster map
        <lsat7_2002_unmix.1@PERMANENT>
}}}

Since i.spec.unmix was ported from GRASS 5 years ago, perhaps some raster
function usage is not correct?

I have attached the input matrix of endmembers for easy testing.

Ideas welcome!

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

#3865: i.spec.unmix: map writeout broken
----------------------+--------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Imagery | Version: unspecified
Resolution: | Keywords: i.spec.unmix
       CPU: x86-64 | Platform: Unspecified
----------------------+--------------------------
Changes (by neteler):

* Attachment "spectrum.txt" added.

Input data for i.spec.unmix (endmember table)

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

#3865: i.spec.unmix: map writeout broken
----------------------+--------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Imagery | Version: unspecified
Resolution: | Keywords: i.spec.unmix
       CPU: x86-64 | Platform: Unspecified
----------------------+--------------------------

Comment (by mmetz):

I found the error, and some other bugs, but need some time to manually
merge the fixes with recent changes to i.spec.unmix.

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

#3865: i.spec.unmix: map writeout broken
----------------------+--------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Imagery | Version: unspecified
Resolution: | Keywords: i.spec.unmix
       CPU: x86-64 | Platform: Unspecified
----------------------+--------------------------

Comment (by mmetz):

Fixed in [https://github.com/OSGeo/grass-
addons/commit/5c43635bb9ba0df0243f94a314a77a97213b2bf2 5c43635], together
with some other bugs and improvements.

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

#3865: i.spec.unmix: map writeout broken
----------------------+--------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone:
Component: Imagery | Version: unspecified
Resolution: fixed | Keywords: i.spec.unmix
       CPU: x86-64 | Platform: Unspecified
----------------------+--------------------------
Changes (by neteler):

* status: new => closed
* resolution: => fixed

Comment:

Great, thanks for the massive bugfixing, much appreciated!

The error no longer occurs and maps are now written out.

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