2

I am coding a simple script to obtain some SENTINEL products using the Sentinelsat´s Python API

Then I would like to download some of the products to a diferent directory than the script is.

I don´t know how to do it.

My script

api = SentinelAPI('xxxxxx', 'xxxx','https://scihub.copernicus.eu/dhus')
footprint = geojson_to_wkt(read_geojson('search_polygon.geojson'))
products = api.query(footprint,
                     platformname = "Sentinel-1",
                     beginposition =  ["2019-{}-{}T00:00:00.000Z".format(month_start,day_start),"2019-{}-{}T00:00:00.000Z".format(mont_stop,day_stop)],producttype='GRD')
gdf = api.to_geodataframe(products)
[api.download(item) for item in gdf["uuid"]]

bu i´d like to download the products in a diferente directory. For example

./data

kamome
  • 828
  • 3
  • 11
  • 27

2 Answers2

3

You can set the directory you want the data to be downloaded within api.download

directory = 'data'
[api.download(item, directory_path= directory) for item in gdf["uuid"]]
Ioannis Nasios
  • 8,292
  • 4
  • 33
  • 55
0

It is as simple as this just add Disk name://your directory/file

with open("D://map/dimo.json") as obj:
    import json
    json.dump("sss",obj)

But the file should be created