Commit b7cbfbe0 authored by SPeillet's avatar SPeillet
Browse files

Merge branch 'python3' of https://gitlab.irstea.fr/raffaele.gaetano/moringa into tensorflow

No related merge requests found
Showing with 6 additions and 6 deletions
+6 -6
......@@ -562,7 +562,7 @@ def randomword(length):
OUTPUT : random word (string)
"""
return ''.join(random.choice(string.lowercase) for i in range(length))
return ''.join(random.choice(string.ascii_lowercase) for i in range(length))
def rescaleImage(img, outmin=0, outmax=255, nodata=None, bw=False):
......
......@@ -26,7 +26,7 @@ def genScript(argv):
clipping = False
clip_shp = None
single_tile = ''
srs = None
for opt, val in opts:
if opt == '-o':
od = val
......@@ -38,7 +38,7 @@ def genScript(argv):
elif opt == '--srs':
srs = str(val)
if srs is None :
ds = gdal.Open(glob.glob(dirs[0] + '/GRANULE/*/IMG_DATA/*_B2.tif')[0])
ds = gdal.Open(glob.glob(dirs[0] + '/*_B2.tif')[0])
prj = ds.GetProjectionRef()
srs = osr.SpatialReference(prj)
srs = 'EPSG:'+srs.GetAuthorityCode('PROJCS')
......@@ -56,11 +56,11 @@ def genScript(argv):
mtd = glob.glob(dir + '/*_MTD_ALL.xml')
if len(mtd) > 0:
#cmd = ['python', 'prepareS2THEIA.py'] + argv[:-1] + [dir]
cmd = ['python', 'prepareS2THEIA.py', '-o', '\"' + od + '\"']
cmd = ['python', 'prepareS2THEIA.py', '-o', od]
if clip_shp is not None:
cmd += ['-c', '\"' + clip_shp + '\"']
cmd += ['-c', clip_shp]
cmd += ['--srs', srs]
cmd += ['\"' + dir + '\"']
cmd += [dir]
f.write(' '.join(cmd) + '\n')
f.close()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment