I am working on a script that let's me connect to the Sentinel satellite database to download the requested map files.
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,
)
My problem is depending on what kind of "satellite" input I am going to use will change what other arguments are necessary, required or even allowed. Some won't need "sensormode" and other maybe need "cloudcoverage". How would i go about writing a clean code with variable/optional arguments in a function within a function? Do I have to list every possible argument?