Resample operator does not behave the same when calling it from desktop or from gpt cli


I am having issues using the Resample operator provided by Snap.

I want to run a Resampling of about 10% on S1 imagery using ‘Mean’ downsampling and ‘FlagAnd’ flagDownsampling.
The operators works fine if I input my desired width and height and parameters from the desktop application but if I try to run the same operator using GPT tools the result is completely different (much more pixelated).

I use this xml file to call gpt:

<graph id="resample">
  <node id="resample">
      <!-- <referenceBand>string</referenceBand> -->
      <!-- <targetResolution>integer</targetResolution> -->
      <!-- <upsampling>Nearest</upsampling> -->
      <!-- <resampleOnPyramidLevels>boolean</resampleOnPyramidLevels> -->

My properties file only contains desired width and height:


And the command I use with gpt is something like this:

gpt resample.xml -t target_file.dim -f BEAM-DIMAP -p -e input_file.dim

Even though my targetWidth and targetHeight are exactly the same as those I input in desktop application the resulting data is very much different (it seems that it ignores the downsampling parameters). Do you have any ideas what might be causing this issue?

Thank you very much in advance for your help.


I’ve tried this but with Sentinel-2 data.
The result is exactly the same with gpt and in the desktop application.
I validated this by using the Band Math and subtracting one result from the other.The pixel values of the resulting band were all zero.
Then I tried with Sentinel-3 data and could observe some differences.
The following image shows them. Yellow pixels mean same value in both results. Strange is that first the result is good and then suddenly it diverges.

Are the S1 images somehow pre-processed? What kind of S1 data are you using as input?
Do you see the same behaviour?

Hello and thank you for your assistance,

I have tried this on Sentinel-1 data obtained from the copernicus website
Before applying the resampling I am using the following operators on the image:

It seems you have identified the same problem with S3 images.

I ended up implementing my own solution for the resampling but it would have been easier without the workaround.