[GRASS-user] i.pansharpen error

Joseph Kariuki joehene at gmail.com
Mon May 22 03:35:44 PDT 2017


Hi?

I am trying to perform pansharpening on landsat raster, using pygrass.
Below is the snippet





*n = 0for x in bluear:
mypansharpen.append(grass.run_command("i.pansharpen", red=redar[n],
green=greenar[n], blue=bluear[n], pan=panar[n],
                  output=bluear[n][0:21]+"pansharpen", method="ihs"))
  n = n + 1*

Running the code returns the following error

*ERROR: Raster map <LE07_L1TP_166060_20161016_20161111_01_T1_B8.TIF.aux> not
       found
Traceback (most recent call last):
  File "/usr/local/grass-7.2.2svn/scripts/i.pansharpen", line 452, in <module>
    main()
  File "/usr/local/grass-7.2.2svn/scripts/i.pansharpen", line 119, in main
    kv = grass.raster_info(map=pan)
  File "/usr/local/grass-7.2.2svn/etc/python/grass/script/raster.py",
line 78, in raster_info
    s = read_command('r.info <http://r.info>', flags='gre', map=map)
  File "/usr/local/grass-7.2.2svn/etc/python/grass/script/core.py",
line 461, in read_command
    return handle_errors(returncode, stdout, args, kwargs)
  File "/usr/local/grass-7.2.2svn/etc/python/grass/script/core.py",
line 329, in handle_errors
    returncode=returncode)
grass.exceptions.CalledModuleError: Module run None ['r.info
<http://r.info>', '-gre',
'map=LE07_L1TP_166060_20161016_20161111_01_T1_B8.TIF.aux'] ended with
error
Process ended with non-zero return code 1. See errors in the (error) output.
Traceback (most recent call last):
  File "/home/hempire/PycharmProjects/GRASSproject/landsatProcessing.py",
line 185, in <module>
    output=bluear[n][0:21]+"pansharpen", method="ihs"))
  File "/usr/local/grass-7.2.2svn/etc/python/grass/script/core.py",
line 410, in run_command
    return handle_errors(returncode, returncode, args, kwargs)
  File "/usr/local/grass-7.2.2svn/etc/python/grass/script/core.py",
line 329, in handle_errors
    returncode=returncode)
grass.exceptions.CalledModuleError: Module run None ['i.pansharpen',
'blue=LE07_L1TP_166060_20030303_20170126_01_T1_B2',
'green=LE07_L1TP_166060_20030303_20170126_01_T1_B3',
'pan=LE07_L1TP_166060_20161016_20161111_01_T1_B8.TIF.aux',
'output=LE07_L1TP_166060_2003pansharpen', 'method=ihs',
'red=LE07_L1TP_166060_20030303_20170126_01_T1_B4'] ended with error
Process ended with non-zero return code 1. See errors in the (error) output.*

Note that I have also tried grass.read_command in place of
grass.run_command but still getting the same error output.




Kind Regards,

*Joseph Kariuki*

*Geospatial Engineer** | **GIS / Web Developer*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170522/7c45b954/attachment.html>


More information about the grass-user mailing list