Sen2Three: ValueError

L3_Process returns TypeError when I try to process L2A files.

I peeked into the file which generated the TypeError message. I found that it uses the environment variable SEN2THREE_HOME to set the path to the config file L3_GIPP.xml. My enviroment variable was not activated, I had to restart Windows. Then L3_Process runs.

I discovered that the program tries to read L3_GIPP.xml from the scripts directory when SEN2THREE_HOME is not set. But it uses a wrong location for that file and therefor fails with an IOError. This is catched in a try-except block and the print message in the except block generates the TypeError.

The error message is:

  C:\Users\akg>L3_process N:\S2\akg_test --resolution=20

Traceback (most recent call last):
File “C:\Users\akg\AppData\Local\Continuum\Anaconda2\Scripts\”, line 11, in
load_entry_point(‘sen2three==1.1.0’, ‘console_scripts’, ‘L3_Process’)()
File “c:\Users\akg\AppData\Local\Continuum\Anaconda2\lib\site-packages\sen2three-1.1.0-py2.7.egg\sen2three\”, line 264, in main
File “c:\Users\akg\AppData\Local\Continuum\Anaconda2\lib\site-packages\sen2three-1.1.0-py2.7.egg\sen2three\”, line 1391, in init
File “c:\Users\akg\AppData\Local\Continuum\Anaconda2\lib\site-packages\sen2three-1.1.0-py2.7.egg\sen2three\”, line 2083, in setSchemes
self.logger.fatal('wrong identifier for xml structure: ’ + product)
TypeError: cannot concatenate ‘str’ and ‘function’ objects

The command was: >L3_process N:\S2\T33WXT\R008\2017 --resolution=10

In the directory are L2A products created with Sen2Cor 2.4.0.

I did install Sen2Three exactly as described in the manual. The program tries to concatenate a non-string object with a string object. This must be a bug in the program. But it seems others still can run the program. What is the trick?


you write: “to set SEN2THREE_HOME to the path to the config file.” This is not correct. SEN2THREE_HOME should be set to the home directory of Sen2Three, which is e.g in your case c:\users\akg\sentthree. Your Environment probably points to c:\users\akg\sen2three\cfg, as this is the path where the L3_GIPP.xml is located. If I set the environment as you stated, ( SEN2THREE_HOME points to sen2three\cfg then I get exacty the same error you described.
Even if you work on windows, it is worth to have a look at the script L3_Bashrc, as it gives you an example how the environments should be set properly.

At the installation guide, it says:

You can call this script automatically via your .bashrc or .profile script (OS dependent). For this purpose, add the line “source /L3_Bashrc” to your script.

You can call this script also manually via “source L3_Bashrc” every time before starting the processor. However this is not recommended, as it may be forgotten.