Commit 1d5848e1 authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

findproducts

parent ee1d425d
......@@ -4,17 +4,23 @@
from catalog.models import Product_l1c, Product_l2a
sys.path.append('../')
from geosentinel import APISentinel, polygonToBox
from geosentinel import APISentinel, polygonToBox, findProducts
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('products', nargs=1, type=str)
parser.add_argument('wtk', nargs=1, type=str)
parser.add_argument('startdate', nargs=2, type=str)
parser.add_argument('enddate', nargs=3, type=str)
parser.add_argument('platform', nargs=4, type=str)
parser.add_argument('cloud', nargs=5, type=str)
def handle(self, *args, **options):
options['products']
products = options['products'].split()
# options['products']
# products = options['products'].split()
products = findProducts.findSentinelProducts(options['wkt'], options['startDate'], options['endDate'], options['platform'], options['cloud'])
pl1c = Product_l1c.objects.all().filter(identifier_in=products)
pl2a = Product_l1c.objects.all().filter(identifier_in=pl1c)
......
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