Commit 7dc7f8fb authored by Pedro Alfonso Ramirez's avatar Pedro Alfonso Ramirez

Unzip sentinel files

parent 697495a2
......@@ -65,22 +65,24 @@ def check_existing_productType(product,flag):
def find_files_Sentinel(args):
check_existing_directory(args.folder, 2)
check_existing_productType(args.satellite, 1)
check_existing_productType(args.plattform, 1)
check_existing_productType(args.product_type, 2)
files = os.listdir(folder)
files = os.listdir(args.folder)
if (args.product_type == "all"):
if args.satellite == 'Sentinel-1' or args.satellite == 'sentinel-1':
if args.plattform == 'Sentinel-1' or args.plattform == 'sentinel-1':
namfil1 = 'S1A_'
namfil2 = 'S1B_'
if args.satellite == 'Sentinel-2' or args.satellite == 'sentinel-2':
namfil3 = 'S2A_'
namfil4 = 'S2B_'
files = [f for f in files if f.startswith(namfil1) or f.startswith(namfil2) or f.startswith(namfil3) or f.startswith(namfil4)]
if args.plattform == 'Sentinel-2' or args.plattform == 'sentinel-2':
namfil1 = 'S2A_'
namfil2 = 'S2B_'
files = [f for f in files if f.startswith(namfil1) or f.startswith(namfil2)]
if (len(files) == 0):
print"Files not found..."
else:
if args.satellite=="Sentinel-1" or args.satellite=="sentinel-1":
if args.plattform=="Sentinel-1" or args.plattform=="sentinel-1":
namfil1 = 'S1A_'+ args.product_type
namfil2 = 'S1B_'+ args.product_type
if args.satellite=="Sentinel-2" or args.satellite=="sentinel-2":
if args.plattform=="Sentinel-2" or args.plattform=="sentinel-2":
namfil1 = 'S2A_'+ args.product_type
namfil2 = 'S2B_'+ args.product_type
files = [f for f in files if f.startswith(namfil1) or f.startswith(namfil2)]
......
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