Commit 37db2bf3 authored by Lozac'h Loic's avatar Lozac'h Loic

UPDATE: BatchMosaic add vh support

parent c3ac57de
......@@ -115,6 +115,7 @@ if __name__ == "__main__":
""")
parser.add_argument('-format', choices=['S1-SNAP','L8-NDVI'], required=True)
parser.add_argument('-mode', choices=['vv','vh'], required=True, default="vv")
parser.add_argument('-indir', action='store', required=True, help='Directory containing Sentinel1 SNAP Calibrated or Landsat8 NDVI')
parser.add_argument('-inref', action='store', required=True, help='Image references Sentinel-2 Tile, example any S2 NDVI')
parser.add_argument('-outdir', action='store', required=True, help='Output directory')
......@@ -131,6 +132,16 @@ if __name__ == "__main__":
splitinref = os.path.basename(args.inref).split("_")
tileid = splitinref[1]
if args.mode == "vv":
modeinprefix = "Sigma0_VV.img"
modeoutprefix = "_VV.TIF"
elif args.mode == "vh":
modeinprefix = "Sigma0_VH.img"
modeoutprefix = "_VH.TIF"
else:
print("Error: mode not recognized")
exit()
if args.format == "S1-SNAP" :
indir=[]
......@@ -152,10 +163,10 @@ if __name__ == "__main__":
if len(l) == 2 :
in1 = os.path.join(indir[l[0]], "Sigma0_VV.img")
in2 = os.path.join(indir[l[1]], "Sigma0_VV.img")
in1 = os.path.join(indir[l[0]], modeinprefix)
in2 = os.path.join(indir[l[1]], modeinprefix)
outfile = outfilebase +"_VV.TIF"
outfile = outfilebase +modeoutprefix
if os.path.exists(outfile) :
continue
......@@ -173,8 +184,8 @@ if __name__ == "__main__":
dejafait.append(indir[l[1]])
elif len(l) == 1 :
in1 = os.path.join(file, "Sigma0_VV.img")
outfile = outfilebase +"_VV.TIF"
in1 = os.path.join(file, modeinprefix)
outfile = outfilebase +modeoutprefix
if os.path.exists(outfile) :
continue
......
......@@ -964,6 +964,8 @@ if __name__ == "__main__":
print("#################################################################################### ")
print("Resolving filenames for " + sard)
#TODO find S1A or S1B
sardata = os.path.basename(sard)
fdate = re.findall("20\d{6}T\d{6}",sardata)
if not(fdate):
......
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