Commit e70fb5ca authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬
Browse files

Merge branch 'revert-95b2d119' into 'master'

Revert "Update"

See merge request adan.salazar/GeoSentinel!2
parents 95b2d119 d8abcfc7
Loading
Loading
Loading
Loading
+0 −7
Changes for examples/downloadTest.py: 0 added lines, 7 removed lines.
Original line number Original line Diff line number Diff line
@@ -9,11 +9,4 @@ 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)))"
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]"})
products = sentinel.getProducts(area, ('20150101', '20180517'), {"platformname":"Sentinel-2", "cloudcoverpercentage":"[0 TO 10]"})
print len(products)
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)
#sentinel.downloadProducts(products,dir)
+54 −0
Changes for examples/download_images: 54 added lines, 0 removed lines.
Original line number Original line Diff line number Diff line
#!/bin/python
# Copyright (C) 2018 Adan Salazar <asalazargaribay@gmail.com>
#
#
# This file is part of GeoSentinel
#
#
# GeoSentinel is free software  you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GeoSentinel is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with StereoVision.  If not, see <http://www.gnu.org/licenses/>.

"""
Example of dowloading Sentinel images from the Copernicus Open Access Hub < https://scihub.copernicus.eu/dhus/#/home >
"""
from sentinelsat.sentinel import read_geojson, geojson_to_wkt
from argparse import ArgumentParser
from geosentinel.ui_utils import (download_sentinel_mages)
from geosentinel.arguments import SENTINEL_ARGUMENTS

def main():
    """   
    Download all Sentinel images from the Copernicus Hub and save them in the folder specified by the user.
    
    Please run: python dowload_images  --help   before usage
    
    First, parse arguments provided by the user. Then choose the images that are in the
    dates and polygon provided by the user, then remove the images that do not overlap more than 30 %
    of the input polygon and the polygon of the image. Finally, download the remaining images.
    
    """
    parser = ArgumentParser(description="Download Sentinel images from the Copernicus Hub",
                             parents=[SENTINEL_ARGUMENTS])
       
     
    args = parser.parse_args()
    
    path_json=args.input_file
    
    args.footprint = geojson_to_wkt(read_geojson(path_json))
    
    download_sentinel_mages(args)


if __name__ == "__main__":
    main()
+3 −8
Changes for geosentinel/APISentinel.py: 3 added lines, 8 removed lines.
Original line number Original line Diff line number Diff line
@@ -82,13 +82,8 @@ class APISentinel(object):
        self.api.download_all(products)
        self.api.download_all(products)




    def filterProducts(self, productList):
#    def filterProducts(self, products_list, user_footprint, threshold):
#, user_footprint, threshold):
#        products_down = OrderedDict()

        products = productList.copy()
	for p in productList:
		if productList[p]['filename'].find("OPER_PRD") != -1:
			del products[p]
#        products_down = products_list.copy()
#        products_down = products_list.copy()
#        products_df = self.api.to_dataframe(products_list)
#        products_df = self.api.to_dataframe(products_list)


@@ -109,6 +104,6 @@ class APISentinel(object):
#                # Deleting element
#                # Deleting element
#                del products_down[products_df.uuid[i]]
#                del products_down[products_df.uuid[i]]


        return products
#        return products_down


geosentinel/APISentinel.pyc

deleted100644 → 0
−3.82 KiB

File deleted.

geosentinel/__init__.pyc

deleted100644 → 0
−164 B

File deleted.

Loading