Commit 5826ba1e authored by Gaetano Raffaele's avatar Gaetano Raffaele
Browse files

FIX: mosaicking single date scenes using max (avoids artefacts).

parent f8892887
......@@ -484,6 +484,7 @@ def extractROI(infiles, outdir, roi, roiname=None, ncores=12, overwrite=False, v
outfile = outdir / l[0].name.replace(oldd, newd).replace('.tiff', '_' + roiname + '.tiff')
outfiles.append(outfile)
if (not outfile.exists()) or overwrite:
"""
vrt = outfile.replace('.tiff', '.vrt')
vrtfiles.append(vrt)
proc_files.append(outfile)
......@@ -491,6 +492,12 @@ def extractROI(infiles, outdir, roi, roiname=None, ncores=12, overwrite=False, v
subprocess.call(vrtcmd, shell=False)
tiffcmd = ['gdal_translate', vrt, outfile]
subprocess.call(tiffcmd, shell=False)
"""
mbm = otb.Registry.CreateApplication('BandMathX')
mbm.SetParameterStringList('il', l)
mbm.SetParameterString('exp', 'vmax({' + ';'.join(['im%db1' % i for i in len(l)]) + '})')
mbm.SetParameterString('out', outfile)
mbm.ExecuteAndWriteOutput()
return outfiles
......
Markdown is supported
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