Commit 353d1921 authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

find Products

parent fceca62f
......@@ -32,7 +32,7 @@ def findSentinelProducts(wkt, startDate, endDate, platform, cloud):
def main(argv):
if len(sys.argv) != 7:
print("Usage: " + argv[0] + " <WKT Polygon> <Start Date> <End Date> <Platform> <Maximum Cloud %> <Destination>")
print("Usage: " + argv[0] + " <WKT Polygon> <Start Date> <End Date> <Platform> <Maximum Cloud %> <Source> <Destination>")
else:
# with suppress_stdout():
# with contextlib.redirect_stdout(None):
......@@ -40,12 +40,12 @@ def main(argv):
fileNames = [productList[k]['filename'].replace("SAFE", "ZIP").replace("L1C", "L2A") for k in productList.keys() ]
# print(fileNames)
dirList = os.listdir(".")
dirList = os.listdir(sys.argv[6])
matchingProducts = list(set(fileNames) & set(fileNames))
print ( str(len(matchingProducts))+" of " + str(len(productList)) +" products found.")
outdir = sys.argv[6]
outdir = sys.argv[7]
for f in matchingProducts:
os.system("ln -s " + f + " " + outdir+f)
print (str(len(matchingProducts)) + " Linked to " + outdir)
......
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