Commit ea55ecf9 authored by geoint's avatar geoint

filter

parent 3e9f8efc
......@@ -9,4 +9,11 @@ area = "POLYGON((-89.79030210118333 21.122657323983717,-89.77308220413153 21.122
footprint = "Intersects(POLYGON((-89.79030210118333 21.122657323983717,-89.77308220413153 21.122657323983717,-89.77308220413153 21.140540053466538,-89.79030210118333 21.140540053466538,-89.79030210118333 21.122657323983717)))"
products = sentinel.getProducts(area, ('20150101', '20180517'), {"platformname":"Sentinel-2", "cloudcoverpercentage":"[0 TO 10]"})
print len(products)
for p in products:
print products[p]['filename']
print len(products)
products=sentinel.filterProducts(products)
for p in products:
print products[p]['filename']
print len(products)
#sentinel.downloadProducts(products,dir)
......@@ -82,8 +82,13 @@ class APISentinel(object):
self.api.download_all(products)
# def filterProducts(self, products_list, user_footprint, threshold):
# products_down = OrderedDict()
def filterProducts(self, productList):
#, user_footprint, threshold):
products = productList.copy()
for p in productList:
if productList[p]['filename'].find("OPER_PRD") != -1:
del products[p]
# products_down = products_list.copy()
# products_df = self.api.to_dataframe(products_list)
......@@ -104,6 +109,6 @@ class APISentinel(object):
# # Deleting element
# del products_down[products_df.uuid[i]]
# return products_down
return products
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