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

find products

parent 1191fbf1
/home/mario/git/GeoSentinel/geosentinel
\ No newline at end of file
#!/usr/bin/python
# -*- coding: utf-8 -*-
from catalog.models import Product_l1c, Product_l2a
sys.path.append('../')
from geosentinel import APISentinel, polygonToBox
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('products', nargs=1, type=str)
def handle(self, *args, **options):
options['products']
products = options['products'].split()
pl1c = Product_l1c.objects.all().filter(identifier_in=products)
pl2a = Product_l1c.objects.all().filter(identifier_in=pl1c)
fileList = [ p.file_path for p in pl2a]
print fileList
# sentinel = APISentinel.APISentinel('emmhp', 'geoemm29')
# Product_l2a.objects().all().filter()
# date = ("".join(init_date.split('-')), "".join(end_date.split('-')))
# params = {"platformname": "Sentinel-2"}
# pol_bbox = polygonToBox.getWKTPolygonBoundingBox(area, True)
# products = sentinel.getProducts(pol_bbox, date, params)
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