S1GRD sentinel-hub processing api - terrain correction not always being executed

HI,

I am trying to download temporal tiles from sentinel-hub api and sometimes i noticed a pixel misalignment even if same orbit and same parameters just with different dates. It doesen’t always happen, but I noticed that sometimes the processing api doesen’t do the terrain correction. Not sure what does this depends on. But when I tried to download the non alignned image with same settings in requests builder the image was correctly aligned with the others.

I’m currently using as backscatter coefficient: gamma0 (terrain) and as orthorectification: yes MAPZEN DEM and I’m working with IW products in VV,VH channels. Not other settings are specified a part the width, height which is always the same for all the temporal products in that area.

Hi Sebastiano,

Thanks for your question. Please can you provide some examples of the issues you have been having. Screenshots and the code you used in your requests would be really helpful so that we can replicate and compare our results with yours. Thanks!

Hi, thanks very much for your quick response.

So, I’m using a custom python code with oauth to first search and then download images. You can see here the shub api to download image https://github.com/makovez/mmflood-cd/blob/main/mmflood_cd/shub.py and here the catalogue to search for products https://github.com/makovez/mmflood-cd/blob/main/mmflood_cd/catalog.py

By diving in more seems like the calling processing api and requests builder outputs two different products with same settings.

This example code should to replicate issue should work is here https://pastebin.com/raw/9HPeGm41 if you want to test it out. But really I’m not doing anything especial. You can use same bounding box and you should see that if you replicate same from requests builder you get pixel misalignment.

Also, I don’t understand why the search api catalogue returns 4 products which are basically the same identical products. Pair of them have same dates and orbits as well, just different end name. Just the bbox of products change. https://pastebin.com/raw/rwfVEXUS

Couldn insert more than two url so had to split message.

Ok so i basically tried to download all of those 4 products with same bounding box and same settings as specified in the code i provided, and they all look the same.

But when i specify same date range, bbox, and all same setttings from requests builder i get a similar product but different pixel alignment and distortion.

So i assume the processing api does not do his job in terrain correction…

Are you specifying any advanced options in the Request Builder like in the below screenshot?

Yes


You can see more details here with the images comparision https://file.io/FDd6XMx0b31M

OK please can you copy the Curl Request from Request Builder of your requests so we can examine the discrepancies between the two returns.

curl -X POST https://services.sentinel-hub.com/api/v1/process
-H ‘Content-Type: application/json’
-H ‘Authorization: Bearer <AUTH_TOKEN>’
-d ‘{
“input”: {
“bounds”: {
“bbox”: [
17.05670130900006,
48.45835188280866,
17.212196705000053,
48.57478991092886
]
},
“data”: [
{
“dataFilter”: {
“timeRange”: {
“from”: “2020-06-19T00:00:00Z”,
“to”: “2020-06-21T23:59:59Z”
},
“resolution”: “HIGH”,
“polarization”: “DV”,
“acquisitionMode”: “IW”
},
“processing”: {
“orthorectify”: true,
“demInstance”: “MAPZEN”,
“backCoeff”: “GAMMA0_TERRAIN”
},
“type”: “sentinel-1-grd”
}
]
},
“output”: {
“width”: 1146,
“height”: 1295,
“responses”: [
{
“identifier”: “default”,
“format”: {
“type”: “image/tiff”
}
}
]
},
“evalscript”: "//VERSION=3\n\nfunction setup() {\n return {\n input: [\n {\n bands: ["VV", "VH"],\n }\n ],\n output: [\n {\n id: "default",\n bands: 2,\n sampleType: "FLOAT32",\n }\n ],\n mosaicking: "Tile",\n };\n }\n \n function evaluatePixel(samples) {\n // Your JavaScript code here\n return {\n default: [samples[0].VV, samples[0].VH],\n };\n }\n "
}’

AND the evaluation script:

//VERSION=3

function setup() {
return {
input: [
{
bands: [“VV”, “VH”],
}
],
output: [
{
id: “default”,
bands: 2,
sampleType: “FLOAT32”,
}
],
mosaicking: “Tile”,
};
}

function evaluatePixel(samples) {
// Your JavaScript code here
return {
default: [samples[0].VV, samples[0].VH],
};
}

BTW it was in the zip i shared with you

Hi Sebastiano,

Thank you for the curl request. I don’t see any zip files that were shared though.

Here https://file.io/FDd6XMx0b31M

Are you able to see it?

Hi Sebastiano,

I’m not able to open the file as it is from an unknown source. If it is code, please either share it here/provide the steps to reproduce the errors you are having or you can send the relevant files to info@sentinel-hub.com

it’s not code, you already have all the info to reproduce the error I believe, if you need anything else let me know.

it just contains the images comparision from processing api and requests builder.

sorry, my bad it was my problem. I didn’t pass in the correct field the processing dict in the request. It works now.