Hello, Forum!
A strange behavior of the SH - ProcessingAPI, by execution of particular request that ran via another account successfully.
After sending the request, the execution is terminated, without any error message to be output at the UI!
Herewith is the request that I’m trying to execute:
curl -X POST https://services.sentinel-hub.com/api/v1/process
-H 'Content-Type: application/json'
-H 'Authorization: Bearer <YourAccessToken>'
-d '{
"input": {
"bounds": {
"bbox": [
2571918.724798,
5330792.24621,
2581426.967785,
5341025.201693
],
"properties": {
"crs": "http://www.opengis.net/def/crs/EPSG/0/3857"
}
},
"data": [
{
"dataFilter": {
"timeRange": {
"from": "2020-06-07T00:00:00Z",
"to": "2020-08-31T23:59:59Z"
},
"orbitDirection": "DESCENDING"
},
"processing": {
"orthorectify": "true",
"backCoeff": "GAMMA0_TERRAIN",
"demInstance": "COPERNICUS_30"
},
"type": "sentinel-1-grd"
}
]
},
"output": {
"resx": 10,
"resy": 10,
"responses": [
{
"identifier": "s1_sarddi",
"format": {
"type": "image/tiff"
}
}
]
},
"evalscript": "//VERSION=3.3 (auto-converted from 1)\n//\n// SENTINEL-1 SAR Deforestation Detection Index\n// ---------------------------------------------\n// 2019 - Antonio Carlon Paredes.\n// 2022 - Updated by: Zlatomir Dimitrov, SRTI-BAS.\n// License: CC BY 4.0\n// https://creativecommons.org/licenses/by/4.0/\n//\nfunction setup() {\n /*return {\n input: [{\n bands: [\n \"VV\",\n \"VH\"\n ]\n }],\n output: { id: \"s1_sardd\", bands: 3 }\n }*/\n return {\n input: [\"VH\", \"VV\", \"dataMask\"],\n output: { id: \"s1_sarddi\", bands: 3, sampleType: SampleType.FLOAT32 },\n mosaicking: Mosaicking.ORBIT\n }\n}\n\n// VH:\nfunction calculateAverage_VH(samples) {\n var sum = 0\n var nValid = 0\n for (let sample of samples) {\n if (sample.dataMask != 0) {\n nValid++\n sum += sample.VH\n }\n }\n return sum/nValid\n}\n// VV:\nfunction calculateAverage_VV(samples) {\n var sum = 0\n var nValid = 0\n for (let sample of samples) {\n if (sample.dataMask != 0) {\n nValid++\n sum += sample.VV\n }\n }\n return sum/nValid\n}\n\n\nconst GAIN = 2.5;\nconst WATER_LIMIT = 0.0005; //0.1\nconst FOREST_LIMIT = 0.19; //0.2\nconst INVERSE_FACTOR = 25;\n\nconst GREEN_GRADIENT = [\n [1.000, 0x80F300],\n [0.500, 0x406600],\n [0.000, 0x003300]\n]\n\nconst RED_GRADIENT = [\n [1.000, 0xFFFFFF],\n [0.525, 0xFF8600],\n [0.300, 0xFF6E00],\n [0.250, 0xAE0000],\n [0.000, 0x000000]\n];\n\nconst GREEN_VIZ = new ColorGradientVisualizer(GREEN_GRADIENT, 0, 1);\nconst RED_VIZ = new ColorGradientVisualizer(RED_GRADIENT, 0, 1);\n\nconst evaluatePixel = function (samples, scenes) {\n\t//let vv = samples.VV;\n\t//let vh = samples.VH;\n let vv = calculateAverage_VV(samples);\n let vh = calculateAverage_VH(samples);\n\n let v_area = vv * vh;\n\tlet v_len = Math.sqrt(vv * vv + vh * vh);\n let v_angle_weighted = 0;\n\tif (vv > 0) {\n\t\tv_angle_weighted = Math.atan(vh/vv) / (Math.PI / 2);\n\t}\n\n return [v_len, v_angle_weighted, v_area]\n/*\n\tlet v_len_inverse = 0;\n \tif (v_len > 0) {\n\t\tv_len_inverse = 1 / (INVERSE_FACTOR * v_len);\n }\n\n \tif (area < WATER_LIMIT ) {\n \treturn [0];\n } else if (v_len > FOREST_LIMIT || v_angle_weighted > 0.2 ) {\n \tlet index = GAIN * v_len - v_angle_weighted;\n return GREEN_VIZ.process(index);\n } else {\n let index = GAIN * v_len_inverse + v_angle_weighted;\n return RED_VIZ.process(index);\n }\n*/ \n};"
}'
Will try it out via PostMan and will report with headers provided.
Thanks for the suggestions in advance!
Zlatomir.