我正在编写一个简单的脚本来使用Sentinelsat的Python获得一些哨兵产品
然后,我想将一些产品下载到一个不同于脚本的目录中。
我不知道怎么做。
我的剧本
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"]]但是我想在一个不同的目录中下载这些产品。例如
./数据
发布于 2019-04-15 08:41:09
您可以设置希望在api.download中下载数据的目录。
directory = 'data'
[api.download(item, directory_path= directory) for item in gdf["uuid"]]发布于 2019-04-13 11:34:04
它很简单,只需添加磁盘名://您的目录/文件
with open("D://map/dimo.json") as obj:
import json
json.dump("sss",obj)但是文件应该被创建
https://stackoverflow.com/questions/55664833
复制相似问题