[GRASS-dev] [GRASS GIS] #3552: i.spectral fails due to missing monitor

#3552: i.spectral fails due to missing monitor
-------------------------+-------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.6.0
Component: Imagery | Version: svn-trunk
Keywords: i.spectral | CPU: Unspecified
Platform: Unspecified |
-------------------------+-------------------------
From the code of i.spectral I could not figure out what should happen when
gnuplot is absent – should it plot on screen? Into a file?
In either case, code needs enhancements to handle corner cases (i.e.
output file not provided or is not writeable).

At the moment it doesn't do any of those things:
{{{
ERROR: Neither MONITOR (managed by d.mon command) nor
GRASS_RENDER_IMMEDIATE (used for direct rendering) defined
Traceback (most recent call last):
   File "/home/marisn/soft/grass7_trunk/dist.x86_64-pc-linux-
gnu/scripts/i.spectral", line 273, in <module>
     main()
   File "/home/marisn/soft/grass7_trunk/dist.x86_64-pc-linux-
gnu/scripts/i.spectral", line 268, in main
     draw_linegraph(what)
   File "/home/marisn/soft/grass7_trunk/dist.x86_64-pc-linux-
gnu/scripts/i.spectral", line 200, in draw_linegraph
     x_title=_("Bands"), y_title=_("DN Value"))
   File "/home/marisn/soft/grass7_trunk/dist.x86_64-pc-linux-
gnu/etc/python/grass/script/core.py", line 421, in
run_command
     return handle_errors(returncode, returncode, args,
kwargs)
   File "/home/marisn/soft/grass7_trunk/dist.x86_64-pc-linux-
gnu/etc/python/grass/script/core.py", line 332, in
handle_errors
     returncode=returncode)
grass.exceptions.CalledModuleError: Module run None
['d.linegraph', 'x_title=Bands', 'x_file=/home/marisn/data/G
RASS_DB/LV_UTM34V/piemers/.tmp/seda/1232.0/data_x', 'y_file=
/home/marisn/data/GRASS_DB/LV_UTM34V/piemers/.tmp/seda/1232.
0/data_y_0', 'y_title=DN Value', 'title=Spectral
signatures', 'y_color=red'] ended with error
Process ended with non-zero return code 1. See errors in the
(error) output.
}}}

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

#3552: i.spectral fails due to missing monitor
--------------------------+-------------------------
  Reporter: marisn | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.6.0
Component: Imagery | Version: svn-trunk
Resolution: | Keywords: i.spectral
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by neteler):

Replying to [ticket:3552 marisn]:
> From the code of i.spectral I could not figure out what should happen
when gnuplot is absent – should it plot on screen? Into a file?
> In either case, code needs enhancements to handle corner cases (i.e.
output file not provided or is not writeable).

I suppose that the default should be output into a PNG file.

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