Hello.
Using SentinelHubInputTask, I want to retrieve S-1 data for a time period in multiple bboxes. I am requesting IW, descending, VV+VH, sigma0 backscatter coefficient, output in Float32.
I get the following Error:
sentinelhub.exceptions.DownloadFailedException: During execution of task SentinelHubInputTask: Failed to download from:
https://services.sentinel-hub.com/api/v1/process
with HTTPError:
400 Client Error: Bad Request for url: https://services.sentinel-hub.com/api/v1/process
Server response: "{"error":{"status":400,"reason":"Bad Request","message":"Output custom requested but missing from function setup()","code":"COMMON_BAD_PAYLOAD"}}"
If create a request without the evalscript, it works (but I need dB conversion and I am also not sure that i get Sigma0 coef.).
I guess something is missing in my evalscript? The code I am using:
data_collection = DataCollection.SENTINEL1_IW_DES # name of data source
res = 10 # resolution of EOPatches in meters
evalscript = """
//VERSION=3
function setup() {
return {
input: ["VV", "VH"],
output: {bands: 2,
sampleType: "FLOAT32"}
}
}
// apply "toDb" function on input bands
function evaluatePixel(samples) {
var VVdB = toDb(samples.VV)
var VHdB = toDb(samples.VH)
return [VVdB, VHdB]
}
// definition of "toDb" function
function toDb(linear) {
var log = 10 * Math.log(linear) / Math.LN10 // VV and VH linear to decibels
var val = Math.max(Math.min(log, 5), -30)
return val
}
"""
add_data = SentinelHubInputTask(evalscript=evalscript,
data_collection=data_collection,
bands_feature=(FeatureType.DATA, 'BANDS_S1'),
resolution=res,
time_difference=datetime.timedelta(minutes=120),
config=config,
aux_request_args={"processing":{"backCoeff": "SIGMA0_ELLIPSOID"}}
)
save = SaveTask(output_folder_eopatches_S1, overwrite_permission=OverwritePermission.OVERWRITE_PATCH)
workflow = LinearWorkflow(
add_data,
save)
execution_args = []
for bbox_id, bbox_coords in list_of_bboxes:
execution_args.append({
add_data: {'bbox': BBox(bbox_coords, crs=crs), 'time_interval': time_interval},
save: {'eopatch_folder': 'eopatch_{}'.format(bbox_id)},
#export_tiff: {'filename': '{}eopatch_{}/BANDS_S1_VV_VH.tiff'.format(output_tiff_location, bbox_id)},
})
executor = EOExecutor(workflow, execution_args, save_logs=True, logs_folder=reports_folder)
executor.run(workers=5, multiprocess=False)