better-wfp-00001 data pipeline results (Sentinel-1 backscatter time-sries selected polarization): loading from pickle file and exploiting

This Notebook shows how to: * reload better-wfp-00001 data pipeline results previously stored in a pickle file * Create a new dataframe with data values cropped over the area of interest * Plot an RGB * Create a geotif

Import needed modules

In [1]:
import pandas as pd
from geopandas import GeoDataFrame
import gdal
import numpy as np
from shapely.geometry import Point
from shapely.geometry import Polygon
import matplotlib
import matplotlib.pyplot as plt
from PIL import Image
%matplotlib inline
from shapely.wkt import loads
from shapely.geometry import box
from urlparse import urlparse
import requests
import gc

Read picke data file

In [2]:
pickle_filename = 'better-wfp-00001_validation_Sigma0_all_Pol2.pkl'
In [3]:
results = GeoDataFrame(pd.read_pickle(pickle_filename))
In [4]:
results
Out[4]:
enclosure enddate identifier self startdate title wkt
0 https://store.terradue.com/better-wfp-00001/_r... 2017-10-10 03:33:29.573586 7D9FD84BD60A843F26FDEA800E9ECF9D396151A2 https://catalog.terradue.com//better-wfp-00001... 2017-10-10 03:33:00.563755 Reproducibility notebook used for generating S... POLYGON((35.3446002755045 10.6382850413833,35....
1 https://store.terradue.com/better-wfp-00001/_r... 2017-10-10 03:33:29.573586 7F3A3ACED0B5C7591BB1FDD7E6B27C6635369091 https://catalog.terradue.com//better-wfp-00001... 2017-10-10 03:33:00.563755 Reproducibility stage-in notebook for Sentinel... POLYGON((35.3446002755045 10.6382850413833,35....
2 https://store.terradue.com/better-wfp-00001/_r... 2017-10-10 03:33:29.573586 1F7C3F9E8C413A4873EC941EAD3490FB5E66E2F2 https://catalog.terradue.com//better-wfp-00001... 2017-10-10 03:33:00.563755 S1A_IW_GRDH_1SDV_20171010T033300_20171010T0333... POLYGON((32.7205219811478 10.6297848454969,35....
3 https://store.terradue.com/better-wfp-00001/_r... 2017-09-28 03:33:29.319777 01EA46331E2C43284B6994522631DB593C40102A https://catalog.terradue.com//better-wfp-00001... 2017-09-28 03:33:00.320367 Reproducibility stage-in notebook for Sentinel... POLYGON((35.3446346180086 10.6382893347105,35....
4 https://store.terradue.com/better-wfp-00001/_r... 2017-09-28 03:33:29.319777 F5340A56D58BE30CE0913C22469A0722FE9FF2CC https://catalog.terradue.com//better-wfp-00001... 2017-09-28 03:33:00.320367 Reproducibility notebook used for generating S... POLYGON((35.3446346180086 10.6382893347105,35....
5 https://store.terradue.com/better-wfp-00001/_r... 2017-09-28 03:33:29.319777 E10022E5B194098307D61C5D7ABE689D3A6C8CDD https://catalog.terradue.com//better-wfp-00001... 2017-09-28 03:33:00.320367 S1A_IW_GRDH_1SDV_20170928T033300_20170928T0333... POLYGON((32.7205563094316 10.6297888529464,35....
6 https://store.terradue.com/better-wfp-00001/_r... 2017-09-16 03:33:29.058816 95D1BC38792C53F8DEE87134DC442DDEF8FFA32D https://catalog.terradue.com//better-wfp-00001... 2017-09-16 03:33:00.063819 Reproducibility stage-in notebook for Sentinel... POLYGON((35.3445828113387 10.6383094087658,35....
7 https://store.terradue.com/better-wfp-00001/_r... 2017-09-16 03:33:29.058816 A0ADF0C22B48289666FFA6A2F1D7EF803E9F4FB1 https://catalog.terradue.com//better-wfp-00001... 2017-09-16 03:33:00.063819 Reproducibility notebook used for generating S... POLYGON((35.3445828113387 10.6383094087658,35....
8 https://store.terradue.com/better-wfp-00001/_r... 2017-09-16 03:33:29.058816 3F8DCF751414E4F426C3BFF9190010080C881DD9 https://catalog.terradue.com//better-wfp-00001... 2017-09-16 03:33:00.063819 S1A_IW_GRDH_1SDV_20170916T033300_20170916T0333... POLYGON((32.7205042492142 10.6298093385874,35....
9 https://store.terradue.com/better-wfp-00001/_r... 2017-09-04 03:33:28.570829 0AFAA7C073D70F419739D633EE575D4E0FD2DF05 https://catalog.terradue.com//better-wfp-00001... 2017-09-04 03:32:59.565436 Reproducibility notebook used for generating S... POLYGON((35.3446598171093 10.6382861514311,35....
10 https://store.terradue.com/better-wfp-00001/_r... 2017-09-04 03:33:28.570829 5073743AE4405DE679A286C43F32985DD11ED9FD https://catalog.terradue.com//better-wfp-00001... 2017-09-04 03:32:59.565436 Reproducibility stage-in notebook for Sentinel... POLYGON((35.3446598171093 10.6382861514311,35....
11 https://store.terradue.com/better-wfp-00001/_r... 2017-09-04 03:33:28.570829 A598CE0F561110AA054642A452F6EE3A6E2876D2 https://catalog.terradue.com//better-wfp-00001... 2017-09-04 03:32:59.565436 S1A_IW_GRDH_1SDV_20170904T033259_20170904T0333... POLYGON((32.7204894118455 10.6297855453323,35....

Credentials for ellip platform access

  • Provide here your ellip username and api key for platform access
In [5]:
import getpass

user = getpass.getpass("Enter you ellip username:")
api_key = getpass.getpass("Enter the API key:")

Define filter parameters

Time of interest

In [6]:
mydates = ['2017-10-10 03:33:00.563755','2017-09-16 03:33:00.063819Z','2017-09-28 03:33:00.320367Z','2017-09-04 03:32:59.565436Z']

Area of interest (two approaches to determine VOI:)

  • The user can choose to define an AOI selecting a Point and a buffer size used to build a squared polygon around that point
In [7]:
point_of_interest=Point(32.98295,11.59465)
In [8]:
buffer_size = 0.1
In [9]:
aoi_wkt1 = box(*point_of_interest.buffer(buffer_size).bounds)
In [10]:
aoi_wkt1.wkt
Out[10]:
'POLYGON ((33.08295 11.49465, 33.08295 11.69465, 32.88295 11.69465, 32.88295 11.49465, 33.08295 11.49465))'
  • Or creating a Polygon from a points list (in this case this is a point inside the intersect of all results’ polygons)
In [11]:
aoi_wkt2 = Polygon([(32.0572, 12.4549), (33.9087, 12.4549), (33.9087, 10.7344), (32.0572 ,10.7344), (32.0572, 12.4549)])

In [12]:
aoi_wkt2.wkt

Out[12]:
'POLYGON ((32.0572 12.4549, 33.9087 12.4549, 33.9087 10.7344, 32.0572 10.7344, 32.0572 12.4549))'

Create a new dataframe with data values

  • Get the subframe data values related to selected tiles and the selected band, and create a new GeoDataFrame having the original metadata stack with the specific band data extended info (data values, size, and geo projection and transformation).

Define auxiliary methods to create new dataframe

  • The first method gets download reference, band number, cropping flag, AOI cropping area and returns the related band data array with related original geospatial infos
  • If crop = False the original band extent is returned
In [13]:

def get_band_as_array(url,band_name,crop,bbox):

    output = '/vsimem/clip.tif'

    ds = gdal.Open('/vsicurl/%s' % url)


    if crop == True:
        ulx, uly, lrx, lry = bbox[0], bbox[3], bbox[2], bbox[1]
        ds = gdal.Translate(output, ds, projWin = [ulx, uly, lrx, lry], projWinSRS = 'EPSG:4326')
        print 'data cropping : DONE'
    else:

        ds = gdal.Translate(output, ds)
    ds = None
    ds = gdal.Open(output)
    w = ds.GetRasterBand(1).XSize
    h = ds.GetRasterBand(1).YSize
    geo_transform = ds.GetGeoTransform()
    projection = ds.GetProjection()


    data = ds.GetRasterBand(1).ReadAsArray(0, 0, w, h).astype(np.float)

    data[data==-9999] = np.nan



    band = None

    print 'band %s value got!' %band_name
    ds = None
    del ds
    del band

    gdal.Unlink(output)
    gc.collect()
    return data,geo_transform,projection,w,h
  • The second one selects the data to be managed (only the actual results related to the filtered metadata) and returns a new GeoDataFrame containing the requested bands extended info with the original metadata set
In [14]:
def get_GDF_with_datavalues(row, user, api_key, band_name, crop=False, bbox=None):


    bands_name = ['Sigma0_VH_db','Sigma0_VV_db']
    if band_name not in bands_name:
        raise ValueError('Selected band is not defined!')


    parsed_url = urlparse(row['enclosure'])

    url = '%s://%s:%s@%s/api%s' % (list(parsed_url)[0], user, api_key, list(parsed_url)[1], list(parsed_url)[2])
    print url
    data,geo_transform,projection,w,h = get_band_as_array(url,band_name,crop,bbox)

    extended_info = dict()


    extended_info=dict(row)
    extended_info['band'] = band_name
    extended_info['data'] = data
    extended_info['geo_transform'] = geo_transform
    extended_info['projection'] = projection
    extended_info['xsize'] = w
    extended_info['ysize'] = h


    print 'Get data values for %s : DONE!' %row['title']
    return extended_info
  • Select from metadataframe a subframe containing the geotiff results of the datetimes of interest
In [15]:
mydate_results = results[(results.apply(lambda row: 'tif' in row['title'], axis=1)) & (results.apply(lambda row: row['startdate'] in pd.to_datetime(mydates) , axis=1))]
In [16]:
mydate_results
Out[16]:
enclosure enddate identifier self startdate title wkt
2 https://store.terradue.com/better-wfp-00001/_r... 2017-10-10 03:33:29.573586 1F7C3F9E8C413A4873EC941EAD3490FB5E66E2F2 https://catalog.terradue.com//better-wfp-00001... 2017-10-10 03:33:00.563755 S1A_IW_GRDH_1SDV_20171010T033300_20171010T0333... POLYGON((32.7205219811478 10.6297848454969,35....
5 https://store.terradue.com/better-wfp-00001/_r... 2017-09-28 03:33:29.319777 E10022E5B194098307D61C5D7ABE689D3A6C8CDD https://catalog.terradue.com//better-wfp-00001... 2017-09-28 03:33:00.320367 S1A_IW_GRDH_1SDV_20170928T033300_20170928T0333... POLYGON((32.7205563094316 10.6297888529464,35....
8 https://store.terradue.com/better-wfp-00001/_r... 2017-09-16 03:33:29.058816 3F8DCF751414E4F426C3BFF9190010080C881DD9 https://catalog.terradue.com//better-wfp-00001... 2017-09-16 03:33:00.063819 S1A_IW_GRDH_1SDV_20170916T033300_20170916T0333... POLYGON((32.7205042492142 10.6298093385874,35....
11 https://store.terradue.com/better-wfp-00001/_r... 2017-09-04 03:33:28.570829 A598CE0F561110AA054642A452F6EE3A6E2876D2 https://catalog.terradue.com//better-wfp-00001... 2017-09-04 03:32:59.565436 S1A_IW_GRDH_1SDV_20170904T033259_20170904T0333... POLYGON((32.7204894118455 10.6297855453323,35....

*PARAMETERS*

  • bands_list = all|the list of the bands names

list of bands names can be: [‘Sigma0_VH_db’] or [‘Sigma0_VV_db’]

  • crop = True|False

if crop=False the bbox can be omitted

In [17]:
myGDF = GeoDataFrame()
for row in mydate_results.iterrows():
    myGDF = myGDF.append(get_GDF_with_datavalues(row[1], user, api_key, 'Sigma0_VH_db', True, bbox=aoi_wkt1.bounds), ignore_index=True)
https://better-wfp-00001:AKCp5bAisopxtSEvkgNryzYzxT6UBv7ahyBnyszSbb6dZtct3ceRfSrieyznjjUsNynvT2XuK@store.terradue.com/api/better-wfp-00001/_results/workflows/ec_better_ewf_wfp_01_01_01_ewf_wfp_01_01_01_1_20/run/e62b29fe-3c67-11e9-8e34-0242ac11000f/0022790-181221095105003-oozie-oozi-W/1b88f7b8-b7b1-47ee-912a-cad205971825/S1A_IW_GRDH_1SDV_20171010T033300_20171010T033329_018745_01FA27_E136_Sigma0_all_bands.tif
data cropping : DONE
band Sigma0_VH_db value got!
Get data values for S1A_IW_GRDH_1SDV_20171010T033300_20171010T033329_018745_01FA27_E136_Sigma0_all_bands.tif : DONE!
https://better-wfp-00001:AKCp5bAisopxtSEvkgNryzYzxT6UBv7ahyBnyszSbb6dZtct3ceRfSrieyznjjUsNynvT2XuK@store.terradue.com/api/better-wfp-00001/_results/workflows/ec_better_ewf_wfp_01_01_01_ewf_wfp_01_01_01_1_20/run/a0ad6744-3df6-11e9-84e8-0242ac11000f/0023507-181221095105003-oozie-oozi-W/3f34d075-1cca-4b14-be3b-ec3a060dd9f1/S1A_IW_GRDH_1SDV_20170928T033300_20170928T033329_018570_01F4D2_039B_Sigma0_all_bands.tif
data cropping : DONE
band Sigma0_VH_db value got!
Get data values for S1A_IW_GRDH_1SDV_20170928T033300_20170928T033329_018570_01F4D2_039B_Sigma0_all_bands.tif : DONE!
https://better-wfp-00001:AKCp5bAisopxtSEvkgNryzYzxT6UBv7ahyBnyszSbb6dZtct3ceRfSrieyznjjUsNynvT2XuK@store.terradue.com/api/better-wfp-00001/_results/workflows/ec_better_ewf_wfp_01_01_01_ewf_wfp_01_01_01_1_20/run/9f807bcc-3df6-11e9-a53a-0242ac11000f/0023505-181221095105003-oozie-oozi-W/6218ff5f-99bf-45eb-9886-fc28eacc94e2/S1A_IW_GRDH_1SDV_20170916T033300_20170916T033329_018395_01EF7C_4CEA_Sigma0_all_bands.tif
data cropping : DONE
band Sigma0_VH_db value got!
Get data values for S1A_IW_GRDH_1SDV_20170916T033300_20170916T033329_018395_01EF7C_4CEA_Sigma0_all_bands.tif : DONE!
https://better-wfp-00001:AKCp5bAisopxtSEvkgNryzYzxT6UBv7ahyBnyszSbb6dZtct3ceRfSrieyznjjUsNynvT2XuK@store.terradue.com/api/better-wfp-00001/_results/workflows/ec_better_ewf_wfp_01_01_01_ewf_wfp_01_01_01_1_20/run/a076f330-3df6-11e9-95c4-0242ac11000f/0023506-181221095105003-oozie-oozi-W/acf888f7-0b41-475c-a83b-30f6b9203766/S1A_IW_GRDH_1SDV_20170904T033259_20170904T033328_018220_01EA08_4C18_Sigma0_all_bands.tif
data cropping : DONE
band Sigma0_VH_db value got!
Get data values for S1A_IW_GRDH_1SDV_20170904T033259_20170904T033328_018220_01EA08_4C18_Sigma0_all_bands.tif : DONE!
In [18]:
myGDF
Out[18]:
band data enclosure enddate geo_transform identifier projection self startdate title wkt xsize ysize
0 Sigma0_VH_db [[-19.8972873688, -20.4339332581, -21.05051803... https://store.terradue.com/better-wfp-00001/_r... 2017-10-10 03:33:29.573586 (487241.991408, 10.0, 0.0, 1292798.45915, 0.0,... 1F7C3F9E8C413A4873EC941EAD3490FB5E66E2F2 PROJCS["WGS 84 / UTM zone 36N",GEOGCS["WGS 84"... https://catalog.terradue.com//better-wfp-00001... 2017-10-10 03:33:00.563755 S1A_IW_GRDH_1SDV_20171010T033300_20171010T0333... POLYGON((32.7205219811478 10.6297848454969,35.... 2180.0 2212.0
1 Sigma0_VH_db [[-21.0368480682, -20.3179759979, -19.9485569,... https://store.terradue.com/better-wfp-00001/_r... 2017-09-28 03:33:29.319777 (487235.717139, 10.0, 0.0, 1292798.93053, 0.0,... E10022E5B194098307D61C5D7ABE689D3A6C8CDD PROJCS["WGS 84 / UTM zone 36N",GEOGCS["WGS 84"... https://catalog.terradue.com//better-wfp-00001... 2017-09-28 03:33:00.320367 S1A_IW_GRDH_1SDV_20170928T033300_20170928T0333... POLYGON((32.7205563094316 10.6297888529464,35.... 2180.0 2212.0
2 Sigma0_VH_db [[-20.7813339233, -19.9149856567, -19.65115356... https://store.terradue.com/better-wfp-00001/_r... 2017-09-16 03:33:29.058816 (487240.070102, 10.0, 0.0, 1292801.15515, 0.0,... 3F8DCF751414E4F426C3BFF9190010080C881DD9 PROJCS["WGS 84 / UTM zone 36N",GEOGCS["WGS 84"... https://catalog.terradue.com//better-wfp-00001... 2017-09-16 03:33:00.063819 S1A_IW_GRDH_1SDV_20170916T033300_20170916T0333... POLYGON((32.7205042492142 10.6298093385874,35.... 2180.0 2212.0
3 Sigma0_VH_db [[-19.2709789276, -19.2511940002, -19.48127746... https://store.terradue.com/better-wfp-00001/_r... 2017-09-04 03:33:28.570829 (487238.457204, 10.0, 0.0, 1292798.58505, 0.0,... A598CE0F561110AA054642A452F6EE3A6E2876D2 PROJCS["WGS 84 / UTM zone 36N",GEOGCS["WGS 84"... https://catalog.terradue.com//better-wfp-00001... 2017-09-04 03:32:59.565436 S1A_IW_GRDH_1SDV_20170904T033259_20170904T0333... POLYGON((32.7204894118455 10.6297855453323,35.... 2180.0 2212.0
  • Show data values of Sigma0_VV_db band
In [19]:
list(myGDF[myGDF['band'] == 'Sigma0_VH_db']['data'].values)
Out[19]:
[array([[-19.89728737, -20.43393326, -21.05051804, ..., -20.11592102,
         -19.82681656, -19.54923248],
        [-19.52859116, -20.04211998, -20.68341446, ..., -19.55697632,
         -19.28798485, -19.23924065],
        [-19.14238739, -19.62953186, -20.27329063, ..., -18.90191269,
         -18.69957352, -18.82041359],
        ...,
        [-18.62215614, -18.22598839, -17.35720253, ..., -21.83201218,
         -21.23521042, -20.91604996],
        [-17.27622795, -17.30352211, -16.78775787, ..., -22.56566429,
         -22.07219315, -21.67514992],
        [-16.94901848, -16.9168396 , -16.55544662, ..., -22.59022522,
         -22.09902954, -21.72182083]]),
 array([[-21.03684807, -20.317976  , -19.9485569 , ..., -20.84201241,
         -21.07246208, -21.05217552],
        [-20.94291878, -20.42994499, -19.96503639, ..., -20.76138878,
         -20.77115631, -20.38811684],
        [-19.78959846, -19.98815918, -20.04399872, ..., -20.63464928,
         -20.59660149, -20.19120407],
        ...,
        [-20.14224815, -20.24729919, -19.85492516, ..., -19.22263336,
         -19.46568871, -20.52402496],
        [-19.45087433, -21.00897598, -19.69797134, ..., -19.34489632,
         -19.97622871, -20.96645164],
        [-17.77784729, -19.55450249, -19.51256561, ..., -19.61638641,
         -20.36925507, -21.44485283]]),
 array([[-20.78133392, -19.91498566, -19.65115356, ..., -22.24902344,
         -22.42221642, -22.4185009 ],
        [-21.05017662, -20.24550629, -19.95476723, ..., -21.49064064,
         -21.66612625, -21.70490074],
        [-22.52168274, -20.77989006, -20.33024979, ..., -20.90826797,
         -20.97175026, -20.99912453],
        ...,
        [-16.94146919, -17.79265404, -18.01414108, ..., -18.74625206,
         -18.54232597, -18.68274307],
        [-16.91208839, -17.78502274, -17.94313049, ..., -18.85035324,
         -18.75607109, -18.80696106],
        [-16.90267372, -17.87512207, -18.0754509 , ..., -18.78975105,
         -18.79716682, -18.87958527]]),
 array([[-19.27097893, -19.251194  , -19.48127747, ..., -16.43613815,
         -17.14703369, -17.98468781],
        [-19.93078995, -19.82196236, -20.37692833, ..., -16.10210609,
         -16.87669945, -17.85347939],
        [-20.19284439, -20.05238914, -20.34448051, ..., -16.05489731,
         -16.7249279 , -17.60933685],
        ...,
        [-16.78384972, -16.91290474, -17.24762154, ..., -21.23555374,
         -20.40947151, -19.81291199],
        [-16.70056343, -17.1126461 , -17.5055027 , ..., -20.89575958,
         -20.09100151, -19.65869904],
        [-16.72885895, -17.47348404, -17.89417267, ..., -20.5076046 ,
         -19.91125679, -19.73308563]])]
In [20]:

bands =  myGDF[(myGDF['band'] == 'Sigma0_VH_db')]['data'].values

numbands = bands.size

for i in range(numbands):
    bmin = bands[i].min()
    bmax = bands[i].max()
    if bmin != bmax:
        bands[i] = (bands[i] - bmin)/(bmax - bmin) * 255
In [21]:
bands[0]

Out[21]:
array([[ 147.05844625,  141.44091619,  134.98659763, ...,  144.76982141,
         147.7961243 ,  150.70183349],
       [ 150.91790385,  145.54235983,  138.82938376, ...,  150.62077216,
         153.43653522,  153.94678233],
       [ 154.96062794,  149.86127144,  143.1224995 , ...,  157.47788166,
         159.59593829,  158.33100222],
       ...,
       [ 160.40633194,  164.5533576 ,  173.64767989, ...,  126.80603217,
         133.053265  ,  136.39418966],
       [ 174.49530985,  174.20959861,  179.60854261, ...,  119.12626999,
         124.2918532 ,  128.44804318],
       [ 177.92049037,  178.25733413,  182.04034252, ...,  118.86916981,
         124.01093377,  127.95949893]])
In [22]:
fig = plt.figure(figsize=(20,20))

for i in range(numbands):
    a = fig.add_subplot(1, numbands, i+1)

    imgplot = plt.imshow(bands[i].astype(np.uint8),
                         cmap='gray');

plt.tight_layout()
fig = plt.gcf()
plt.show()

fig.clf()
plt.close()
../../../../_images/pipelines_WFP_wfp-01-01-01_exploitation_wfp-00001_exploitation_from_pickle_38_0.png

Exporting geotif

In [23]:
band_number = 2
rg_bands=(bands[0],bands[1])
cols = int(myGDF['xsize'].values[0])
rows = int(myGDF['ysize'].values[0])

print (cols,rows)

geo_transform = myGDF['geo_transform'].values[0]
projection = myGDF['projection'].values[0]

drv = gdal.GetDriverByName('GTiff')

ds = drv.Create('export.tif', cols, rows, band_number, gdal.GDT_Float32)

ds.SetGeoTransform(geo_transform)
ds.SetProjection(projection)

ds.GetRasterBand(1).WriteArray(rg_bands[0], 0, 0)
ds.GetRasterBand(2).WriteArray(rg_bands[1], 0, 0)

ds.FlushCache()
(2180, 2212)

Download functionalities

Download a product

  • Define the download function
In [24]:
def get_product(url, dest, api_key):

    request_headers = {'X-JFrog-Art-Api': api_key}

    r = requests.get(url, headers=request_headers)

    open(dest, 'wb').write(r.content)

    return r.status_code
  • Get the reference download endpoint for the product related to the first date
In [25]:
enclosure = myGDF[(myGDF['startdate'] == mydates[0])]['enclosure'].values[0]

enclosure
Out[25]:
'https://store.terradue.com/better-wfp-00001/_results/workflows/ec_better_ewf_wfp_01_01_01_ewf_wfp_01_01_01_1_20/run/e62b29fe-3c67-11e9-8e34-0242ac11000f/0022790-181221095105003-oozie-oozi-W/1b88f7b8-b7b1-47ee-912a-cad205971825/S1A_IW_GRDH_1SDV_20171010T033300_20171010T033329_018745_01FA27_E136_Sigma0_all_bands.tif'
In [26]:
output_name = myGDF[(myGDF['startdate'] == mydates[0])]['title'].values[0]

output_name
Out[26]:
'S1A_IW_GRDH_1SDV_20171010T033300_20171010T033329_018745_01FA27_E136_Sigma0_all_bands.tif'
In [ ]:
get_product(enclosure,
            output_name,
            api_key)

Bulk Download

  • Define the bulk download function
In [27]:
def get_product_bulk(row, api_key):

    return get_product(row['enclosure'],
                       row['title'],
                       api_key)
  • Download all the products related to the chosen dates
In [ ]:
myGDF.apply(lambda row: get_product_bulk(row, api_key), axis=1)