Hi,
I have managed to create an evalscript that works in both Playground and Request builder, however, when I copy the sh_py text and try to run it using API, this does not produce the same result.
I have checked and my sentinelhub python package is 3.5.2, and the Request Builder states that the code should work for versions greater than 3.4.0.
Can someone please explain why the code cannot be used?
Also, the evalscript evaluation fails with this line :
let AvBefore = (samples[1].VV+samples[2].VV+samples[3].VV+samples[4].VV)/4;
The error I get is:
400 Client Error: Bad Request for url: https://services.sentinel-hub.com/api/v1/process
Server response: “{“error”:{“status”:400,“reason”:“Bad Request”,“message”:“Failed to evaluate script!\nevalscript.js:39: TypeError: Cannot read property ‘VV’ of undefined\n let AvBefore = (samples[1].VV+samples[2].VV+samples[3].VV+samples[4].VV)/4;\n ^\nTypeError: Cannot read property ‘VV’ of undefined\n at evaluatePixel (evalscript.js:39:29)\n at executeForMultipleScenes (:1153:14)\n”,“code”:“RENDERER_EXCEPTION”}}”
However this works fine in the Request Builder and returns the expected output.
Ideally I want to replicate the code in an API request so that I can pull the requests locally, but I am very confused as to why this isn’t working. Can someone please advise.