In [1]:
# import Libraries
import pandas as pd
import numpy as np
import urllib
import os
import requests
import shutil
from sentinelsat import SentinelAPI, read_geojson, geojson_to_wkt
from multiprocessing.pool import ThreadPool
import time
In [2]:
# Import Folders
data_folder = os.path.abspath("data")
output_folder = os.path.abspath("output")
#check if outfolder exists if not create it
if not os.path.exists(output_folder):
    os.makedirs(output_folder)
In [3]:
# Credentials
username = ""
password = ""

# Declarables
url = "https://scihub.copernicus.eu/apihub/odata/v1"
searchapi = "https://scihub.copernicus.eu/dhus/search"
In [ ]:
# Helping Functions

# Authenticate
session_store = {}

global multicred

# MultiCredentials
def init_session():
    global multicred
    multicred = pd.read_csv('credentials.csv').to_dict(orient='records')
    parallelfactor = 2
    for i, j in enumerate(multicred):
        session = get_search_api_session(i)
        if session.get('https://scihub.copernicus.eu/dhus/search?q=*').status_code != 200:
            del multicred[i]
        else:
            print('----Successfully Validated Credential:', multicred[i])
    for i in list(range(1, parallelfactor)):
        multicred+=multicred
    print("Total", len(multicred), "Connections Available for Download")
    #return multicred


def get_search_api_session(i=0):
    global multicred
    #Configuration
    username = multicred[i]['username']
    password = multicred[i]['password']
    try:
        session = session_store[i]
        if session.get('https://scihub.copernicus.eu/dhus/search?q=*').status_code != 200:
            raise ValueError
        else:
            print('----using previous session')
    except :
        print('----creating session with username', username)
        session = requests.Session()
        session.auth = (username, password)
        auth = session.get(searchapi)
        session_store[i] = session
    return session

def download_scenes_multi(chunk):
    multi_chunk_size = len(chunk)
    chunk = chunk.reset_index().drop(columns=['index'])
    chunk = chunk.reset_index()
    print("\n----Downloading %s Scenes" % multi_chunk_size)
    start = time.time()
    pool = ThreadPool(multi_chunk_size)
    for i in pool.imap_unordered(download_scenes, chunk.to_dict(orient='records')):
        #print i
        pass
    pool.close()
    pool.join()
    print ('----All Files Downloaded Time elapsed: %s' % (time.time() - start))

def download_scenes(row):
    filename = row['title'] + ".zip"
    filepath = os.path.join(output_folder, filename)
    url = row['link'].replace('apihub', 'dhus')
    if not os.path.exists(filepath):
        print("\n----Downloading File at Url:", url, " | Session", multicred[row['index']])
        session = get_search_api_session(row['index'])
        with session.get(url, stream=True) as r:
            with open(filepath, 'wb') as f:
                shutil.copyfileobj(r.raw, f, 10240)
                #for chunk in r.iter_content(chunk_size=10240):
                #    f.write(chunk)
        print("\n----File successfuly downloaded to ", filepath, " | Url:", url, " | Session", multicred[row['index']])
    else:
        print("\n----Using Previouslly downloaded file ", filepath)
    return filepath

# Cleanup
def cleanup():
    output_files = os.listdir(output_folder)
    output_files = [os.path.join(output_folder, x) for x in output_files if x.split('.')[-1].upper() == 'ZIP']
    for i in output_files:
        size = os.stat(i).st_size
        if size < 1000:
            os.remove(i)
            print("----Invalid File", i, " with size ", size, " bytes deleted")
        else:
            print("----#Valid File", i, " with size ", (size/1024/1024), " MB")
            
# Initialize sessions
init_session()
In [ ]:
# Connect to API
api = SentinelAPI(username, password)

# Search for Data
#footprint = geojson_to_wkt(read_geojson('search_polygon.geojson'))
footprint = "POLYGON ((79.2076887512349 15.7097283184072,81.5605925962714 15.7097283184072,81.5605925962714 17.1532438033589,79.2076887512349 17.1532438033589,79.2076887512349 15.7097283184072))"
products = api.query(footprint,
                     producttype='GRD',
                     platformname='Sentinel-1',
                     #beginposition='[2010-01-01T00:00:00.000Z TO NOW]',
                    )
Querying products: 100%|█████████████████████████████████████████████████████| 482/482 [00:02<00:00, 113.44 products/s]
In [ ]:
# Show Products data
product_df = api.to_geodataframe(products)
time_columns = product_df.loc[:, product_df.dtypes == 'datetime64[ns]'].columns
for x in time_columns:
    product_df[x] = product_df[x].apply(lambda x: x.strftime('%Y-%m-%d'))
product_df.to_file(driver='ESRI Shapefile', filename=os.path.join(output_folder, 'products.shp'))
product_df.reset_index()
C:\Users\apsac243\AppData\Local\conda\conda\envs\geo\lib\site-packages\geopandas\io\file.py:108: FionaDeprecationWarning: Use fiona.Env() instead.
  with fiona.drivers():
Out[ ]:
index title link link_alternative link_icon summary ingestiondate beginposition endposition missiondatatakeid ... polarisationmode productclass producttype platformname size status timeliness uuid processed geometry
0 00215102-cd36-4744-812f-2eaa30329930 S1A_IW_GRDH_1SDV_20170921T002210_20170921T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-09-21T00:22:10.45Z, Instrument: SAR... 2017-09-21 2017-09-21 2017-09-21 127379 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED NaN 00215102-cd36-4744-812f-2eaa30329930 NaN POLYGON ((83.521805 16.570839, 81.17205 17.007...
1 003d24c2-c3eb-4cb7-b4c4-3ba439f4d59c S1A_IW_GRDH_1SDV_20180318T003856_20180318T0039... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-03-18T00:38:56.669Z, Instrument: SA... 2018-03-18 2018-03-18 2018-03-18 148185 ... VV VH S GRD Sentinel-1 1.6 GB ARCHIVED NaN 003d24c2-c3eb-4cb7-b4c4-3ba439f4d59c NaN POLYGON ((79.135071 15.273588, 76.792015000000...
2 011b185d-e3e1-4630-83a5-f2ede8f4af25 S1A_IW_GRDH_1SDV_20180612T002211_20180612T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-06-12T00:22:11.747Z, Instrument: SA... 2018-06-12 2018-06-12 2018-06-12 158304 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED NaN 011b185d-e3e1-4630-83a5-f2ede8f4af25 NaN POLYGON ((83.52151499999999 16.570919, 81.1718...
3 019386fa-c3a7-4f14-a37b-6fb06b38242e S1A_IW_GRDH_1SDV_20181008T003841_20181008T0039... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-10-08T00:38:41.323Z, Instrument: SA... 2018-10-08 2018-10-08 2018-10-08 172140 ... VV VH S GRD Sentinel-1 1.6 GB ARCHIVED Fast-24h 019386fa-c3a7-4f14-a37b-6fb06b38242e NaN POLYGON ((79.447327 16.785086, 77.085175000000...
4 01bc36e7-2950-4e74-916f-e6cb4732df81 S1A_IW_GRDH_1SDV_20180205T003049_20180205T0031... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-02-05T00:30:49.403Z, Instrument: SA... 2018-02-06 2018-02-05 2018-02-05 143332 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED NaN 01bc36e7-2950-4e74-916f-e6cb4732df81 NaN POLYGON ((81.118202 14.890947, 78.804184000000...
5 01fcc775-91bd-48c1-a147-7c28726a7ae7 S1A_IW_GRDH_1SDV_20181231T003904_20181231T0039... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-12-31T00:39:04.638Z, Instrument: SA... 2018-12-31 2018-12-31 2018-12-31 183087 ... VV VH S GRD Sentinel-1 1.6 GB ARCHIVED Fast-24h 01fcc775-91bd-48c1-a147-7c28726a7ae7 NaN POLYGON ((79.13587200000001 15.27381, 76.79245...
6 03c24a4a-51f2-40cc-a553-bfbe8c5ca406 S1A_IW_GRDH_1SDV_20180119T002233_20180119T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-01-19T00:22:33.322Z, Instrument: SA... 2018-01-19 2018-01-19 2018-01-19 141292 ... VV VH S GRD Sentinel-1 1.3 GB ARCHIVED NaN 03c24a4a-51f2-40cc-a553-bfbe8c5ca406 NaN POLYGON ((83.267021 15.337936, 80.932365 15.77...
7 043c2ae0-6ded-4ec6-8be9-8492aa9b2f43 S1A_IW_GRDH_1SDV_20180129T003831_20180129T0038... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-01-29T00:38:31.944Z, Instrument: SA... 2018-01-29 2018-01-29 2018-01-29 142483 ... VV VH S GRD Sentinel-1 1.6 GB ARCHIVED NaN 043c2ae0-6ded-4ec6-8be9-8492aa9b2f43 NaN POLYGON ((79.447227 16.785292, 77.084976 17.22...
8 0453b022-2958-4322-a3d4-d460e5f6f0fb S1A_IW_GRDH_1SDV_20181120T003058_20181120T0031... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-11-20T00:30:58.659Z, Instrument: SA... 2018-11-20 2018-11-20 2018-11-20 177645 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED Fast-24h 0453b022-2958-4322-a3d4-d460e5f6f0fb NaN POLYGON ((81.118683 14.890813, 78.804665 15.32...
9 0462604d-5ffe-4ddd-9d07-fe40cdd83912 S1A_IW_GRDH_1SDV_20170524T002229_20170524T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-05-24T00:22:29.05Z, Instrument: SAR... 2017-05-24 2017-05-24 2017-05-24 113703 ... VV VH S GRD Sentinel-1 1.65 GB ARCHIVED NaN 0462604d-5ffe-4ddd-9d07-fe40cdd83912 NaN POLYGON ((83.19818100000001 15.00429, 80.86776...
10 04727e30-8f92-4762-bc45-675cd77298f9 S1A_IW_GRDH_1SDV_20181115T002217_20181115T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-11-15T00:22:17.236Z, Instrument: SA... 2018-11-15 2018-11-15 2018-11-15 176963 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED Fast-24h 04727e30-8f92-4762-bc45-675cd77298f9 NaN POLYGON ((83.52198 16.570959, 81.171959 17.007...
11 04734001-ace5-4a95-a0b7-1d88c33ab00b S1A_IW_GRDH_1SDV_20180706T002237_20180706T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-07-06T00:22:37.873Z, Instrument: SA... 2018-07-06 2018-07-06 2018-07-06 160950 ... VV VH S GRD Sentinel-1 1.3 GB ARCHIVED NaN 04734001-ace5-4a95-a0b7-1d88c33ab00b NaN POLYGON ((83.26823400000001 15.337513, 80.9338...
12 0477955a-9d2c-4024-8318-9c1cad1f9e75 S1A_IW_GRDH_1SDV_20180512T003051_20180512T0031... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-05-12T00:30:51.376Z, Instrument: SA... 2018-05-12 2018-05-12 2018-05-12 154664 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED NaN 0477955a-9d2c-4024-8318-9c1cad1f9e75 NaN POLYGON ((81.117874 14.89085, 78.804039 15.328...
13 04dc7293-58b3-4e2c-97b0-ce92b997d00c S1A_IW_GRDH_1SDV_20151117T003843_20151117T0039... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2015-11-17T00:38:43.925Z, Instrument: SA... 2015-11-18 2015-11-17 2015-11-17 50263 ... VV VH S GRD Sentinel-1 1.58 GB ARCHIVED NaN 04dc7293-58b3-4e2c-97b0-ce92b997d00c NaN POLYGON ((79.173599 15.460616, 76.868919000000...
14 0695082e-c268-484c-8864-03e858980ab5 S1A_IW_GRDH_1SDV_20150305T003010_20150305T0030... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2015-03-05T00:30:10.83Z, Instrument: SAR... 2015-05-06 2015-03-05 2015-03-05 24964 ... VV VH S GRD Sentinel-1 1 GB ARCHIVED NaN 0695082e-c268-484c-8864-03e858980ab5 NaN POLYGON ((81.366241 16.097265, 79.042984 16.53...
15 07112936-b934-4b46-9eb5-65dbb1973b1f S1A_IW_GRDH_1SDV_20161229T003825_20161229T0038... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2016-12-29T00:38:25.861Z, Instrument: SA... 2016-12-29 2016-12-29 2016-12-29 97105 ... VV VH S GRD Sentinel-1 1.58 GB ARCHIVED NaN 07112936-b934-4b46-9eb5-65dbb1973b1f NaN POLYGON ((79.465614 16.880596, 77.130516 17.31...
16 07c8cc00-380f-453e-bd74-7eb698760375 S1A_IW_GRDH_1SDV_20180222T003856_20180222T0039... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-02-22T00:38:56.475Z, Instrument: SA... 2018-02-22 2018-02-22 2018-02-22 145349 ... VV VH S GRD Sentinel-1 1.6 GB ARCHIVED NaN 07c8cc00-380f-453e-bd74-7eb698760375 NaN POLYGON ((79.13613100000001 15.27372, 76.7929 ...
17 084777e5-abd2-405e-b559-0d3d69945dad S1A_IW_GRDH_1SDV_20170728T003024_20170728T0030... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-07-28T00:30:24.583Z, Instrument: SA... 2017-07-28 2017-07-28 2017-07-28 121130 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED NaN 084777e5-abd2-405e-b559-0d3d69945dad NaN POLYGON ((81.42923 16.402493, 79.097145 16.836...
18 0a95166c-4341-46b9-a314-838e4dc34383 S1A_IW_GRDH_1SDV_20180529T003834_20180529T0038... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-05-29T00:38:34.654Z, Instrument: SA... 2018-05-29 2018-05-29 2018-05-29 156675 ... VV VH S GRD Sentinel-1 1.6 GB ARCHIVED NaN 0a95166c-4341-46b9-a314-838e4dc34383 NaN POLYGON ((79.446938 16.785139, 77.084969 17.22...
19 0ae3bf9a-6d09-466e-a1b9-37fe529f2372 S1A_IW_GRDH_1SDV_20180828T003057_20180828T0031... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-08-28T00:30:57.735Z, Instrument: SA... 2018-08-28 2018-08-28 2018-08-28 167192 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED Fast-24h 0ae3bf9a-6d09-466e-a1b9-37fe529f2372 NaN POLYGON ((81.118156 14.890616, 78.804413 15.32...
20 0b34040a-d7df-4942-9e2b-892c528b7757 S1A_IW_GRDH_1SDV_20160912T003858_20160912T0039... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2016-09-12T00:38:58.846Z, Instrument: SA... 2016-09-12 2016-09-12 2016-09-12 84404 ... VV VH S GRD Sentinel-1 1.58 GB ARCHIVED NaN 0b34040a-d7df-4942-9e2b-892c528b7757 F POLYGON ((79.068085 14.942512, 76.769791 15.37...
21 0b55dbf7-af17-4a73-9c17-d6bc4e033f39 S1A_IW_GRDH_1SDV_20161123T003827_20161123T0038... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2016-11-23T00:38:27.026Z, Instrument: SA... 2016-11-23 2016-11-23 2016-11-23 92886 ... VV VH S GRD Sentinel-1 1.58 GB ARCHIVED NaN 0b55dbf7-af17-4a73-9c17-d6bc4e033f39 F POLYGON ((79.466362 16.880527, 77.131279000000...
22 0b5c5431-4652-45d5-8214-20c8c9b3783e S1B_IW_GRDH_1SDV_20181227T002137_20181227T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-12-27T00:21:37.369Z, Instrument: SA... 2018-12-27 2018-12-27 2018-12-27 108277 ... VV VH S GRD Sentinel-1 1.57 GB ARCHIVED Fast-24h 0b5c5431-4652-45d5-8214-20c8c9b3783e NaN POLYGON ((83.48112500000001 16.375294, 81.1670...
23 0b758364-4073-426d-95b1-050176457011 S1A_IW_GRDH_1SDV_20170428T003826_20170428T0038... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-04-28T00:38:26.575Z, Instrument: SA... 2017-04-28 2017-04-28 2017-04-28 110741 ... VV VH S GRD Sentinel-1 1.6 GB ARCHIVED NaN 0b758364-4073-426d-95b1-050176457011 NaN POLYGON ((79.44689200000001 16.785147, 77.0849...
24 0b865594-ebef-4de3-ac57-820e957ffa38 S1A_IW_GRDH_1SDV_20171108T002210_20171108T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-11-08T00:22:10.685Z, Instrument: SA... 2017-11-08 2017-11-08 2017-11-08 132864 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED NaN 0b865594-ebef-4de3-ac57-820e957ffa38 NaN POLYGON ((83.522217 16.570953, 81.172195 17.00...
25 0d6ff8b3-fec2-41d3-aaf1-082c2560a1d7 S1A_IW_GRDH_1SDV_20180325T003049_20180325T0031... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-03-25T00:30:49.38Z, Instrument: SAR... 2018-03-25 2018-03-25 2018-03-25 149023 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED NaN 0d6ff8b3-fec2-41d3-aaf1-082c2560a1d7 NaN POLYGON ((81.11891199999999 14.890955, 78.8051...
26 0da82093-5765-4551-9f4e-5f1645733924 S1A_IW_GRDH_1SDV_20170517T003020_20170517T0030... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-05-17T00:30:20.421Z, Instrument: SA... 2017-05-17 2017-05-17 2017-05-17 112909 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED NaN 0da82093-5765-4551-9f4e-5f1645733924 NaN POLYGON ((81.428909 16.402582, 79.096915999999...
27 0e6cdabc-214e-4518-84e7-b5af9d3daa14 S1A_IW_GRDH_1SDV_20170704T003023_20170704T0030... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-07-04T00:30:23.012Z, Instrument: SA... 2017-07-04 2017-07-04 2017-07-04 118407 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED NaN 0e6cdabc-214e-4518-84e7-b5af9d3daa14 NaN POLYGON ((81.42945899999999 16.402468, 79.0974...
28 0e819626-cf24-4b35-a527-12ace40be37b S1A_IW_GRDH_1SDV_20150628T002150_20150628T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2015-06-28T00:21:50.26Z, Instrument: SAR... 2015-06-28 2015-06-28 2015-06-28 35799 ... VV VH S GRD Sentinel-1 1 GB ARCHIVED NaN 0e819626-cf24-4b35-a527-12ace40be37b NaN POLYGON ((83.541237 16.672056, 81.221046 17.10...
29 0f1c1483-4f69-4cf7-b85e-3b45e0ec8125 S1A_IW_GRDH_1SDV_20180617T003053_20180617T0031... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-06-17T00:30:53.548Z, Instrument: SA... 2018-06-17 2018-06-17 2018-06-17 158881 ... VV VH S GRD Sentinel-1 1.58 GB ARCHIVED NaN 0f1c1483-4f69-4cf7-b85e-3b45e0ec8125 NaN POLYGON ((81.118202 14.890787, 78.804543 15.32...
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
452 edd4213f-34dc-4ea7-be28-26db1acd0dd2 S1A_IW_GRDH_1SDV_20161118T003020_20161118T0030... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2016-11-18T00:30:20.857Z, Instrument: SA... 2016-11-18 2016-11-18 2016-11-18 92328 ... VV VH S GRD Sentinel-1 1.58 GB ARCHIVED NaN edd4213f-34dc-4ea7-be28-26db1acd0dd2 F POLYGON ((81.43338799999999 16.423691, 79.1043...
453 ee041572-0723-44c9-b592-9fac4685d8ae S1A_IW_GRDH_1SDV_20180718T002238_20180718T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-07-18T00:22:38.84Z, Instrument: SAR... 2018-07-18 2018-07-18 2018-07-18 162321 ... VV VH S GRD Sentinel-1 1.3 GB ARCHIVED NaN ee041572-0723-44c9-b592-9fac4685d8ae NaN POLYGON ((83.26733400000001 15.337138, 80.9329...
454 ef0efca7-4eee-467d-b527-0fb4b602c97f S1A_IW_GRDH_1SDV_20170821T003050_20170821T0031... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-08-21T00:30:50.754Z, Instrument: SA... 2017-08-21 2017-08-21 2017-08-21 123857 ... VV VH S GRD Sentinel-1 1.58 GB ARCHIVED NaN ef0efca7-4eee-467d-b527-0fb4b602c97f NaN POLYGON ((81.118195 14.890609, 78.804451 15.32...
455 f0ad2843-919c-4853-bf20-1ae33aec380a S1A_IW_GRDH_1SDV_20170404T003825_20170404T0038... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-04-04T00:38:25.671Z, Instrument: SA... 2017-04-04 2017-04-04 2017-04-04 108009 ... VV VH S GRD Sentinel-1 1.6 GB ARCHIVED NaN f0ad2843-919c-4853-bf20-1ae33aec380a NaN POLYGON ((79.446342 16.78513, 77.084564 17.222...
456 f0dd12ba-09ae-4362-b194-4759fb9d856f S1A_IW_GRDH_1SDV_20160819T003832_20160819T0038... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2016-08-19T00:38:32.933Z, Instrument: SA... 2016-08-19 2016-08-19 2016-08-19 81448 ... VV VH S GRD Sentinel-1 1.58 GB ARCHIVED NaN f0dd12ba-09ae-4362-b194-4759fb9d856f F POLYGON ((79.378525 16.454079, 77.062004 16.88...
457 f1309f09-284b-4243-8547-f148f8b5d616 S1A_IW_GRDH_1SDV_20171001T003834_20171001T0038... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-10-01T00:38:34.594Z, Instrument: SA... 2017-10-01 2017-10-01 2017-10-01 128537 ... VV VH S GRD Sentinel-1 1.6 GB ARCHIVED NaN f1309f09-284b-4243-8547-f148f8b5d616 NaN POLYGON ((79.446709 16.784986, 77.084656 17.22...
458 f207d68c-6819-419b-81c5-9f9d0a7c754d S1A_IW_GRDH_1SDV_20180928T002217_20180928T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-09-28T00:22:17.224Z, Instrument: SA... 2018-09-28 2018-09-28 2018-09-28 170901 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED Fast-24h f207d68c-6819-419b-81c5-9f9d0a7c754d NaN POLYGON ((83.522156 16.570816, 81.172318 17.00...
459 f20ba1fb-fc02-43ae-9762-18f4c4f17277 S1A_IW_GRDH_1SDV_20180902T003905_20180902T0039... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-09-02T00:39:05.435Z, Instrument: SA... 2018-09-02 2018-09-02 2018-09-02 167780 ... VV VH S GRD Sentinel-1 1.6 GB ARCHIVED Fast-24h f20ba1fb-fc02-43ae-9762-18f4c4f17277 NaN POLYGON ((79.134933 15.273275, 76.791977 15.71...
460 f2119757-7fb1-462c-a80b-631407d1b3d5 S1A_IW_GRDH_1SDV_20180222T003831_20180222T0038... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-02-22T00:38:31.474Z, Instrument: SA... 2018-02-22 2018-02-22 2018-02-22 145349 ... VV VH S GRD Sentinel-1 1.6 GB ARCHIVED NaN f2119757-7fb1-462c-a80b-631407d1b3d5 NaN POLYGON ((79.44735 16.785288, 77.0851969999999...
461 f211dc83-61e8-4ab1-b849-301f456101ee S1A_IW_GRDH_1SDV_20171001T003859_20171001T0039... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-10-01T00:38:59.595Z, Instrument: SA... 2017-10-01 2017-10-01 2017-10-01 128537 ... VV VH S GRD Sentinel-1 1.6 GB ARCHIVED NaN f211dc83-61e8-4ab1-b849-301f456101ee NaN POLYGON ((79.135513 15.273414, 76.792381000000...
462 f2573b43-98b4-4031-9fce-1228e895b4c2 S1A_IW_GRDH_1SDV_20180129T003856_20180129T0039... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-01-29T00:38:56.945Z, Instrument: SA... 2018-01-29 2018-01-29 2018-01-29 142483 ... VV VH S GRD Sentinel-1 1.6 GB ARCHIVED NaN f2573b43-98b4-4031-9fce-1228e895b4c2 NaN POLYGON ((79.136032 15.273719, 76.792709 15.71...
463 f29f3e18-d276-4ca1-9c2c-4855893112ff S1A_IW_GRDH_1SDV_20160726T003856_20160726T0039... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2016-07-26T00:38:56.561Z, Instrument: SA... 2016-07-26 2016-07-26 2016-07-26 78477 ... VV VH S GRD Sentinel-1 1.58 GB ARCHIVED NaN f29f3e18-d276-4ca1-9c2c-4855893112ff F POLYGON ((79.068298 14.942539, 76.770004 15.37...
464 f461c9c2-40e4-44f8-ad9a-eacdb616930a S1A_IW_GRDH_1SDV_20170828T002209_20170828T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-08-28T00:22:09.596Z, Instrument: SA... 2017-08-28 2017-08-28 2017-08-28 124629 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED NaN f461c9c2-40e4-44f8-ad9a-eacdb616930a NaN POLYGON ((83.522148 16.570793, 81.172318 17.00...
465 f47d7761-0d36-48d2-a3d9-7e098dcd50cb S1A_IW_GRDH_1SDV_20170728T003049_20170728T0031... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-07-28T00:30:49.582Z, Instrument: SA... 2017-07-28 2017-07-28 2017-07-28 121130 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED NaN f47d7761-0d36-48d2-a3d9-7e098dcd50cb NaN POLYGON ((81.11835499999999 14.890726, 78.8045...
466 f4edf36a-a747-45ca-9550-8deed553aec7 S1A_IW_GRDH_1SDV_20180413T002208_20180413T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-04-13T00:22:08.505Z, Instrument: SA... 2018-04-13 2018-04-13 2018-04-13 151225 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED NaN f4edf36a-a747-45ca-9550-8deed553aec7 NaN POLYGON ((83.521835 16.57098, 81.17218 17.0076...
467 f578dd55-df56-4459-8ad8-272a732c6998 S1A_IW_GRDH_1SDV_20181127T002241_20181127T0023... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-11-27T00:22:41.775Z, Instrument: SA... 2018-11-27 2018-11-27 2018-11-27 178611 ... VV VH S GRD Sentinel-1 1.3 GB ARCHIVED Fast-24h f578dd55-df56-4459-8ad8-272a732c6998 NaN POLYGON ((83.267639 15.338005, 80.932991 15.77...
468 f58a9034-961b-41f1-908b-8c989ccac355 S1A_IW_GRDH_1SDV_20160802T003007_20160802T0030... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2016-08-02T00:30:07.978Z, Instrument: SA... 2016-08-03 2016-08-02 2016-08-02 79357 ... VV VH S GRD Sentinel-1 1.83 GB ARCHIVED NaN f58a9034-961b-41f1-908b-8c989ccac355 F POLYGON ((81.519058 16.841997, 79.198402 17.27...
469 f6a88cc6-71eb-4c0d-bc2c-88cb2b2fc9c1 S1A_IW_GRDH_1SDV_20180711T003029_20180711T0030... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2018-07-11T00:30:29.78Z, Instrument: SAR... 2018-07-11 2018-07-11 2018-07-11 161511 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED NaN f6a88cc6-71eb-4c0d-bc2c-88cb2b2fc9c1 NaN POLYGON ((81.429237 16.402487, 79.097244 16.83...
470 f7426499-f8c5-4888-8383-0dc032206feb S1A_IW_GRDH_1SDV_20161013T003046_20161013T0031... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2016-10-13T00:30:46.14Z, Instrument: SAR... 2016-10-13 2016-10-13 2016-10-13 88146 ... VV VH S GRD Sentinel-1 1.58 GB ARCHIVED NaN f7426499-f8c5-4888-8383-0dc032206feb F POLYGON ((81.12291 14.911947, 78.8121260000000...
471 f8d419ff-a3e6-4a0c-bb76-05626b427387 S1A_IW_GRDH_1SDV_20160527T003847_20160527T0039... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2016-05-27T00:38:47.461Z, Instrument: SA... 2016-05-27 2016-05-27 2016-05-27 71312 ... VV VH S GRD Sentinel-1 1.58 GB ARCHIVED NaN f8d419ff-a3e6-4a0c-bb76-05626b427387 F POLYGON ((79.138351 15.286938, 76.836952 15.72...
472 fa1271ff-6d3f-4178-8a74-de27051a9b8e S1A_IW_GRDH_1SDV_20170301T002235_20170301T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-03-01T00:22:35.369Z, Instrument: SA... 2017-03-01 2017-03-01 2017-03-01 104219 ... VV VH S GRD Sentinel-1 1.06 GB ARCHIVED NaN fa1271ff-6d3f-4178-8a74-de27051a9b8e NaN POLYGON ((83.198509 15.003414, 80.844025 15.44...
473 fab8fbe0-7984-40fb-9160-6e27e165465f S1A_IW_GRDH_1SDV_20170921T002235_20170921T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-09-21T00:22:35.449Z, Instrument: SA... 2017-09-21 2017-09-21 2017-09-21 127379 ... VV VH S GRD Sentinel-1 1.3 GB ARCHIVED NaN fab8fbe0-7984-40fb-9160-6e27e165465f NaN POLYGON ((83.266571 15.335485, 80.93222 15.775...
474 fc93991d-0b66-4814-9dc1-76b3433738c2 S1A_IW_GRDH_1SDV_20171025T003859_20171025T0039... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-10-25T00:38:59.88Z, Instrument: SAR... 2017-10-25 2017-10-25 2017-10-25 131265 ... VV VH S GRD Sentinel-1 1.6 GB ARCHIVED NaN fc93991d-0b66-4814-9dc1-76b3433738c2 NaN POLYGON ((79.13539900000001 15.273571, 76.7920...
475 fc94745e-f5f1-4de9-addf-f76fda7dfcb1 S1A_IW_GRDH_1SDV_20170814T003832_20170814T0038... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-08-14T00:38:32.818Z, Instrument: SA... 2017-08-14 2017-08-14 2017-08-14 123052 ... VV VH S GRD Sentinel-1 1.6 GB ARCHIVED NaN fc94745e-f5f1-4de9-addf-f76fda7dfcb1 NaN POLYGON ((79.446518 16.784956, 77.084648 17.22...
476 fca2f811-ed89-43b7-bac4-fc876ebf9266 S1A_IW_GRDH_1SDV_20170909T002209_20170909T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-09-09T00:22:09.979Z, Instrument: SA... 2017-09-09 2017-09-09 2017-09-09 126001 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED NaN fca2f811-ed89-43b7-bac4-fc876ebf9266 NaN POLYGON ((83.522278 16.570835, 81.172432 17.00...
477 fdd9276d-b15c-4aab-85da-7d582fb38fa9 S1A_IW_GRDH_1SDV_20170117T003017_20170117T0030... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-01-17T00:30:17.784Z, Instrument: SA... 2017-01-17 2017-01-17 2017-01-17 99278 ... VV VH S GRD Sentinel-1 1.58 GB ARCHIVED NaN fdd9276d-b15c-4aab-85da-7d582fb38fa9 NaN POLYGON ((81.43383 16.423864, 79.104797 16.857...
478 fecab593-c53c-46e6-8f6b-b4b381c6f5a2 S1A_IW_GRDH_1SDV_20161018T003852_20161018T0039... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2016-10-18T00:38:52.254Z, Instrument: SA... 2016-10-18 2016-10-18 2016-10-18 88738 ... VV VH S GRD Sentinel-1 1.58 GB ARCHIVED NaN fecab593-c53c-46e6-8f6b-b4b381c6f5a2 F POLYGON ((79.155266 15.368896, 76.838989 15.80...
479 fee051cc-1556-44c9-8fc8-b87c9e080d6a S1A_IW_GRDH_1SDV_20171101T003027_20171101T0030... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-11-01T00:30:27.512Z, Instrument: SA... 2017-11-01 2017-11-01 2017-11-01 132078 ... VV VH S GRD Sentinel-1 1.59 GB ARCHIVED NaN fee051cc-1556-44c9-8fc8-b87c9e080d6a NaN POLYGON ((81.42907700000001 16.402437, 79.0969...
480 ff68e353-b4f6-4413-a639-f91d0f7ca42c S1A_IW_GRDH_1SDV_20150528T003012_20150528T0030... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2015-05-28T00:30:12.033Z, Instrument: SA... 2015-05-28 2015-05-28 2015-05-28 32514 ... VV VH S GRD Sentinel-1 1 GB ARCHIVED NaN ff68e353-b4f6-4413-a639-f91d0f7ca42c NaN POLYGON ((81.398521 16.253454, 79.071625 16.68...
481 ff6a1b59-3232-4678-bd38-d7c3ddb042f1 S1A_IW_GRDH_1SDV_20170430T002227_20170430T0022... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... https://scihub.copernicus.eu/apihub/odata/v1/P... Date: 2017-04-30T00:22:27.886Z, Instrument: SA... 2017-04-30 2017-04-30 2017-04-30 110966 ... VV VH S GRD Sentinel-1 1.65 GB ARCHIVED NaN ff6a1b59-3232-4678-bd38-d7c3ddb042f1 NaN POLYGON ((83.19821899999999 15.003605, 80.8677...

482 rows × 35 columns

In [ ]:
# Check Previous Files
cleanup()
output_files = os.listdir(output_folder)
output_files = [ x[:-4] for x in output_files if x.split('.')[-1].upper() == 'ZIP']
if len(output_files) > 0:
    odf = pd.DataFrame(output_files)
    download_df = product_df[~product_df['title'].isin(odf[0])]
    print("Using ", (product_df.shape[0] - download_df.shape[0]), " already saved files")
else:
    download_df = product_df

# Download Data
#files = os.listdir(output_folder)
#files
#product_df['saved_file'] = product_df.apply(download_scenes, axis=1)
chunk_size = len(multicred)
print('Downloading', len(download_df), 'files using', chunk_size, 'parallel downloads')
df_chunks = download_df.groupby(np.arange(len(download_df))//chunk_size)
for k,_df in df_chunks:
    download_scenes_multi(_df)
In [ ]:
 
In [ ]: