【发布时间】:2021-02-16 16:15:33
【问题描述】:
我正在编写一个脚本,让我可以连接到 Sentinel 卫星数据库以下载请求的地图文件。
from sentinelsat import SentinelAPI, read_geojson, geojson_to_wkt
def get_available(input_geojson, user, password, date_start, date_end, satellite, sensormode, product_type):
# LogIn
api = SentinelAPI(user, password , 'https://scihub.copernicus.eu/dhus')
# Input parameter of the search
footprint = geojson_to_wkt(read_geojson(input_geojson)) # irrelevant to the question
products = api.query(footprint,
date = (date_start, date_end),
platformname = satellite,
sensoroperationalmode = sensormode,
producttype = product_type,
)
我的问题取决于我将使用哪种“卫星”输入,这将改变哪些其他参数是必要的、必需的甚至是允许的。有些不需要“sensormode”,有些可能需要“cloudcoverage”。我将如何在函数内的函数中编写带有变量/可选参数的干净代码?我必须列出所有可能的论点吗?
【问题讨论】:
-
“函数中的函数”是什么意思?是什么决定了需要哪些参数?
标签: python function arguments sentinel1 sentinelsat