Commit b6d7b956 authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

L1C fix

parent b45443e5
...@@ -68,16 +68,29 @@ def main(argv): ...@@ -68,16 +68,29 @@ def main(argv):
L2ADir = cfg["productsDir"]+"L2A/" L2ADir = cfg["productsDir"]+"L2A/"
if cfg["productLevel"]=="L1C": if cfg["productLevel"]=="L1C":
fileNamesL2A = [productList[k]['filename'].replace("SAFE", "zip").replace("L1C", "L2A") for k in productList.keys() ] fileNamesL2A = [productList[k]['filename'].replace("SAFE", "zip").replace("L1C", "L2A") for k in productList.keys() ]
L1CDir = os.listdir(cfg["productsDir"]+"L1C/") L1CDir = cfg["productsDir"]+"L1C/"
linksDir=cfg["projectDir"]+"L1C/"
if not os.path.exists(linksDir):
os.mkdir(linksDir)
L1CDirList = os.listdir(L1CDir)
#LinkProducts
fileNames = [productList[k]['filename'].replace("SAFE", "zip") for k in productList.keys() ]
matchingProducts = set(fileNames).intersection(set(L1CDirList))
for f in matchingProducts:
print (f)
print("ln -s " + L1CDir+f + " " + linksDir+f)
os.system("ln -s " + L1CDir+f + " " + linksDir+f)
print (str(len(matchingProducts)) + " Linked to " + linksDir)
matchingProducts = set(fileNames).intersection(set(L1CDir))
print ( str(len(matchingProducts))+" of " + str(len(fileNames)) +" L1C products found in L2A.") print ( str(len(matchingProducts))+" of " + str(len(fileNames)) +" L1C products found in L2A.")
text ="" text =""
while text != "yes" and text != "no": while text != "yes" and text != "no":
text = raw_input("Do you want to download this products to "+downloadDir+ " ? (yes, no)") text = raw_input("Do you want to convert this products and save them to "+downloadDir+ " ? (yes, no)")
if text=="yes": if text=="yes":
#print("L1CProductListToL2A.sh "+rawDir+" "+inDir+" 1") #print("L1CProductListToL2A.sh "+rawDir+" "+inDir+" 1")
os.system("L1CProductListToL2A.sh "+L1CDir+" "+L2ADir+" 1") os.system("L1CProductListToL2A.sh "+linksDir+" "+L2ADir+" 1")
text ="" text =""
linksDir=cfg["projectDir"]+"L2A/" linksDir=cfg["projectDir"]+"L2A/"
......
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