[GRASS-user] landsat import with python-script
hamish_b at yahoo.com
Sun Feb 5 20:56:49 EST 2012
> I tried to perform an automated import of landsat imagery
> using the python
> script (found here:
> After starting the python-script, I get the following
> The structure of the folder 'LS5_125_049_20050504' is as
> Anybody has an idea, why the py-script cannot define the
> 'band' name?
> View this message in context: http://osgeo-org.1560.n6.nabble.com/landsat-import-with-python-script-tp4366043p4366043.html
> Sent from the Grass - Users mailing list archive at
weird, nabble seems to have removed the attachments.
anyway, here they are from the nabble site:
> :~ ./import_landsat.py LS5_125_049_20050504/
> Importing L5125049_04920050504_B70.TIF -> B70 at LS5_125_049_20050504/...
> Traceback (most recent call last):
> File "./import_landsat.py", line 87, in <module>
> File "./import_landsat.py", line 84, in main
> File "./import_landsat.py", line 47, in import_tifs
> title = 'band %d' % band)
> NameError: global name 'band' is not defined
the "band" variable was never set in the script. it's a bug
on the wiki page.
I guess you need to change:
kanal = int(name[-2])
band = int(name[-2])
in the code.
More information about the grass-user