Hi @miguel.castro ,
Note that the code you provided is not returning multiple responses. It is requesting the NDVI value of the latest acquisition in your collection, i.e., data from 2023-01-13.
You need to set up multiple outputs
in your Evalscript and multiple responses
in your request body to be able to get the NDVI time series and the visualisation for each timestamp in one single request.
An example request will look like below:
curl -X POST https://services.sentinel-hub.com/api/v1/process \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ' \
-H 'Accept: application/tar' \
-d '{
"input": {
"bounds": {
"bbox": [
-6.14191,
37.01578,
-6.11655,
36.99872
]
},
"data": [
{
"dataFilter": {
"timeRange": {
"from": "2023-01-01T00:00:00Z",
"to": "2023-01-14T23:59:59Z"
}
},
"type": "byoc-*******************1fb3"
}
]
},
"output": {
"width": 752,
"height": 633.42,
"responses": [
{
"identifier": "ndvi_time_series",
"format": {
"type": "image/tiff"
}
},
{
"identifier": "vis_03",
"format": {
"type": "image/png"
}
},
{
"identifier": "vis_04",
"format": {
"type": "image/png"
}
},
{
"identifier": "vis_06",
"format": {
"type": "image/png"
}
},
{
"identifier": "vis_11",
"format": {
"type": "image/png"
}
},
{
"identifier": "vis_12",
"format": {
"type": "image/png"
}
},
{
"identifier": "vis_13",
"format": {
"type": "image/png"
}
}
]
},
"evalscript": "//VERSION=3\n\nfunction setup() {\n return {\n input: [\"Red\", \"NIR\", \"dataMask\"],\n output: [\n {\n id: \"ndvi_time_series\",\n bands: 6,\n sampleType: SampleType.FLOAT32\n },\n {\n id: \"vis_03\",\n bands: 3,\n sampleType: SampleType.AUTO\n },\n {\n id: \"vis_04\",\n bands: 3,\n sampleType: SampleType.AUTO\n },\n {\n id: \"vis_06\",\n bands: 3,\n sampleType: SampleType.AUTO\n },\n {\n id: \"vis_11\",\n bands: 3,\n sampleType: SampleType.AUTO\n },\n {\n id: \"vis_12\",\n bands: 3,\n sampleType: SampleType.AUTO\n },\n {\n id: \"vis_13\",\n bands: 3,\n sampleType: SampleType.AUTO\n }\n ],\n mosaicking: \"ORBIT\"\n };\n}\n\nvar arr_map = {\n \"2023-01-03\": 0,\n \"2023-01-04\": 1,\n \"2023-01-06\": 2,\n \"2023-01-11\": 3,\n \"2023-01-12\": 4,\n \"2023-01-13\": 5\n}\n\nfunction evaluatePixel(samples, scenes) {\n let ndvi_arr = new Array(6).fill(NaN);\n let vis_map = {};\n samples.forEach((sample, pos) => {\n timestamp = scenes.orbits[pos].dateFrom.split(\"T\")[0];\n ndvi_val = index(samples[pos].NIR, samples[pos].Red);\n ndvi_arr[arr_map[timestamp]] = ndvi_val;\n vis_map[\"vis_\".concat(timestamp.split(\"-\")[2])] = valueInterpolate(\n ndvi_val,\n [0.0, 0.3, 1.0],\n [\n [1, 0, 0, samples[pos].dataMask],\n [1, 1, 0, samples[pos].dataMask],\n [0.1, 0.3, 0, samples[pos].dataMask],\n ]\n )\n\n });\n return {\n ndvi_time_series: ndvi_arr,\n vis_03: vis_map[\"vis_03\"],\n vis_04: vis_map[\"vis_04\"],\n vis_06: vis_map[\"vis_06\"],\n vis_11: vis_map[\"vis_11\"],\n vis_12: vis_map[\"vis_12\"],\n vis_13: vis_map[\"vis_13\"],\n }\n}"
}'
The script has 7 outputs (as you can see from the request body and the evalscript), which are the NDVI time series (a multi-band tiff containing NDVI values on 2023-01-03, 2023-01-04, 2023-01-06, 2023-01-11, 2023-01-12 and 2023-01-13) and the visualisation of each acquisition. You could copy this curl request to Requests Builder and translate it to sentinelhub-py code, which is a wrapper of our services.
You could also find basic examples in the documentation to learn more about the package.