[GRASS-SVN] r47830 -
grass-addons/grass7/raster/r.modis/r.modis.import
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Aug 22 12:44:32 EDT 2011
Author: neteler
Date: 2011-08-22 09:44:32 -0700 (Mon, 22 Aug 2011)
New Revision: 47830
Modified:
grass-addons/grass7/raster/r.modis/r.modis.import/r.modis.import.py
Log:
region fix; r.null fix;
Modified: grass-addons/grass7/raster/r.modis/r.modis.import/r.modis.import.py
===================================================================
--- grass-addons/grass7/raster/r.modis/r.modis.import/r.modis.import.py 2011-08-22 16:21:57 UTC (rev 47829)
+++ grass-addons/grass7/raster/r.modis/r.modis.import/r.modis.import.py 2011-08-22 16:44:32 UTC (rev 47830)
@@ -191,7 +191,7 @@
tifiles = glob.glob1(basedir, out + "*.tif")
if not tifiles:
grass.fatal(_('Error during the conversion'))
- # check if is in latlong location to set flag l
+ # check if user is in latlong location to set flag l
if projection().val == 'll':
f = "l"
else:
@@ -261,14 +261,15 @@
val.append(findfile(pref,v))
if q:
qa.append(findfile(pref,q))
- grass.run_command('g.region', rast = val[0]['fullname'])
+ # TODO: save region here
for n in range(len(val)):
valname = val[n]['name']
valfull = val[n]['fullname']
- grass.run_command('r.null', map = valfull)
+ grass.run_command('g.region', rast = valfull)
+ grass.run_command('r.null', map = valfull, setnull = 0)
if string.find(cod,'13Q1') >= 0 or string.find(cod,'13A2') >= 0:
- mapc = "%s.2 = %s / 10000" % (valname, valfull)
+ mapc = "%s.2 = %s / 10000." % (valname, valfull)
grass.mapcalc(mapc)
elif string.find(cod,'11A1') >= 0 or string.find(cod,'11A2') >= 0 or string.find(cod,'11B1') >= 0:
mapc = "%s.2 = (%s * 0.0200) - 273.15" % (valname, valfull)
@@ -317,6 +318,9 @@
metadata(parse, valname, col)
metadata(parse, valname + '.check', col)
metadata(parse, qafull, 'byr')
+
+ # TODO: restore region here
+
def single(options,remove,an,ow):
"""Convert the HDF file to TIF and import it
"""
More information about the grass-commit
mailing list