S2 resampling error

When resampling a S2 product using the S2 resampling Processor, I get an error and the processing fails.


messages.log (164.9 KB)

resampling to 10 resolution
all other parameters are default

Your two screen captures seem to indicate different problems - one reading a tif file and one writing a BEAM DIMAP file.

You should provide the messages.log file, which will have more complete error messages. SNAP saves a couple older logs in case you have run SNAP after encountering a error. It is good practice to provide enough detail so that others can reproduce the error (OS, SNAP version and update status, input data, processing steps). Please study the FAQ before posting.

Thank you for pointing out my problems. This is my first time to post on the forum and I have uploaded the log file. The errors listed above are the ones I received when I did S2 resampling.

The S2 Resampling operator needs original Sentinel-2 products. In your error message I see a file called 4538e243_31_0.tif which looks strange to me. Can you please confirm that you use data retrieved from here: https://scihub.copernicus.eu/dhus/

Actually the tif file is a decompressed tile, the naming is like that in order to have shorter paths. So this is not the problem here. Actually none of the problems are really related with S2 Resampling operator, but with auxiliary actions needed in the processing (e.g. reading the input product and writing the target product).

I managed to reproduce the second one (with product number 6 from the screenshot)

This error is followed by the next one (there are 2 errors in the right bottom corner):

It seems to come from the underlying TIFF reader from GeoSolutions library.

Which seems pretty similar with:

1 Like

oh, thank you for clarifying - didn’t see that. :+1:

1 Like

Thank you very much. Problem solved. The reason may be that I clipppd S2 data before S2 resampling ,did not keep the integrity of input S2 data, and the output data name was complex,which led to such error.

1 Like

And how you solved it?

The only way I could escape from the error was to edit s2tbx.properties (located under C:\Users\your_username.snap\etc) by adding
This way the S2 Resampling worked

I just changed the name of the output a little bit more succinct, and then I did S2 resampling before I took the subset, and it worked

1 Like

I added use.openjp2.jna=true, but still got the same error, this error is a bit strange, I think this error and that TIFF read error seem to indicate different problems, my TIFF read error inexplicably disappeared :rofl:, may have been solved, the error may still be related to the file name I output.

From your messages.log:

INFO [org.esa.snap]: Executing tool 'Sen2Cor290' with command line: 'C:\Users\Jason\.snap\auxdata\Sen2Cor-02.09.00-win64\L2A_Process.bat D:\TurbTurbid_waters\data\testdata\S2B_MSIL1C_20220309T230339_N0400_R101_T59NPG_20220310T001223\S2B_MSIL1C_20220309T230339_N0400_R101_T59NPG_20220310T001223.SAFE --GIP_L2A C:\Users\Jason\.snap\auxdata\Sen2Cor-02.09.00-win64\L2A-GIPP29-custom.xml'
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: C:\Users\Jason\.snap\auxdata\Sen2Cor-02.09.00-win64\Lib\site-packages\sen2cor\cfg\L2A_GIPP.xml -> C:\Users\Jason\Documents\sen2cor\2.9\cfg\L2A_GIPP.xml
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: ¸´ÖÆÁË 1 ¸öÎļþ
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: wrong identifier for xml structure.
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: unspecific error in metadata
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: Syntax error in metadata, see report file for details.
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: Schema file: L2A_GIPP.xsd
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: Details: Element 'Nr_Threads': This element is not expected. Expected is ( Region_Of_Interest ).
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: Traceback (most recent call last):
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]:   File "C:\Users\Jason\.snap\auxdata\Sen2Cor-02.09.00-win64\\Lib\site-packages\sen2cor\L2A_Process.py", line 541, in <module>
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]:     sys.exit(main())
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]:   File "C:\Users\Jason\.snap\auxdata\Sen2Cor-02.09.00-win64\\Lib\site-packages\sen2cor\L2A_Process.py", line 387, in main
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]:     if not config.readPreferences():
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]:   File "C:\Users\Jason\.snap\auxdata\Sen2Cor-02.09.00-win64\Lib\site-packages\sen2cor\L2A_Config.py", line 4654, in readPreferences
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]:     subnode = node.Region_Of_Interest
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]:   File "src/lxml/lxml.objectify.pyx", line 229, in lxml.objectify.ObjectifiedElement.__getattr__ (src\lxml\lxml.objectify.c:3835)
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]:   File "src/lxml/lxml.objectify.pyx", line 450, in lxml.objectify._lookupChildOrRaise (src\lxml\lxml.objectify.c:6539)
SEVERE [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: AttributeError: no such child: Region_Of_Interest
INFO [org.esa.snap.core.gpf.operators.tooladapter.ProcessExecutor]: Finished tool execution in 3 seconds

There seems to be a problem (typo?) with your C:\Users\Jason\Documents\sen2cor\2.9\cfg\L2A_GIPP.xml file.

We also created a ticket for this issue, for further investigation and possible workaround: SIITBX-501