#!/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()