Sen2Three error messages

I’ve been having various problems getting Sen2Three setup. On top of the fact that the program’s onexit procedures don’t seem to be set up properly (which causes the script to leave mostly-empty Level-3 SAFE archives behind when a run fails, which need to be manually deleted before a run can be reattempted), I’ve been getting some hard-to-follow error messages that I can’t figure out. I’m running Sen2Three version 1.0.0 in a Conda environment set up with Python 2.7.13 and all Sen2Three’s dependencies, and have sourced Sen2Three’s setup files before running the script. I am running it in a folder of six single-tile L2A products from 12/2016, processed by Sen2Cor.

When I try L3_Process at either 60m or 20m resolutions, I get the following error:

 $ L3_Process --resolution 20 .
Sentinel-2 Level 3 Prototype Processor (SEN2THREE), 1.0.0, created: 2016.07.07 started ...
Metadata file is invalid, see report file for details.
Metadata file is invalid, see report file for details.
Metadata file is invalid, see report file for details.
Traceback (most recent call last):
    File "/home/eli/anaconda3/envs/sen2three/bin/L3_Process", line 11, in <module>
    load_entry_point('sen2three==1.0.0', 'console_scripts', 'L3_Process')()
    File "/home/eli/anaconda3/envs/sen2three/lib/python2.7/site-packages/sen2three-1.0.0-py2.7.egg/sen2three/L3_Process.py", line 248, in main
    processor = doTheLoop(config)
    File "/home/eli/anaconda3/envs/sen2three/lib/python2.7/site-packages/sen2three-1.0.0-py2.7.egg/sen2three/L3_Process.py", line 176, in doTheLoop
    tables = L3_Tables(product)
    File "/home/eli/anaconda3/envs/sen2three/lib/python2.7/site-packages/sen2three-1.0.0-py2.7.egg/sen2three/L3_Tables.py", line 88, in __init__
    product.createL3_Tile(L2A_TILE_ID)
    File "/home/eli/anaconda3/envs/sen2three/lib/python2.7/site-packages/sen2three-1.0.0-py2.7.egg/sen2three/L3_Product.py", line 460, in createL3_Tile
    xp.export()
    File "/home/eli/anaconda3/envs/sen2three/lib/python2.7/site-packages/sen2three-1.0.0-py2.7.egg/sen2three/L3_XmlParser.py", line 193, in export
    objectify.deannotate(self._root, xsi_nil=True, cleanup_namespaces=True)
    File "src/lxml/lxml.objectify.pyx", line 1731, in lxml.objectify.deannotate (src/lxml/lxml.objectify.c:24548)
    File "src/lxml/cleanup.pxi", line 49, in lxml.etree.strip_attributes (src/lxml/lxml.etree.c:150273)
    File "src/lxml/apihelpers.pxi", line 63, in lxml.etree._rootNodeOrRaise (src/lxml/lxml.etree.c:15695)
TypeError: Invalid input object: NoneType

This looks like it is failing to parse the xml files in the SAFE archive, with Sen2Three is failing to catch the error, but I can’t figure out why lxml would be failing in the first place.

Bizzarely, if I try running it at 10m resolution, I get a different error:

$ L3_Process --resolution 10 .
Sentinel-2 Level 3 Prototype Processor (SEN2THREE), 1.0.0, created: 2016.07.07 started ...
Metadata file is invalid, see report file for details.
Metadata file is invalid, see report file for details.
Metadata file is invalid, see report file for details.
Procedure L3_Tables: start import, elapsed time[s]: 3.252
Progress[%]: 0.04 : Fatal error occurred, see report file for details.Closing remaining open files:/home/eli/data/S2A_USER_PRD_MSIL03_PDMC_20161004T180532_R137_V20150101T000000_20161231T235959.SAFE/GRANULE/S2A_USER_MSI_L03_TL_SGS__20161004T150647_A006712_T30UXD_N02.04/IMG_DATA/R10m/.database.h5...done

The error log, which I have hosted here makes it look as though L3_Process is failing to correctly read the Level-2 metadata. Is this a mismatch between what Sen2Three can deal with and the metadata in the latest version of Sen2Cor?

Any help would be appreciated.

Hi,

sen2three is still not ready to process the new format of Sentinel-2 products. Currently, it works properly only with the old products and in the future (I do not know when exactly) it should be able to process the new ones.

Dear troyhurts,

Does it work (sen2three) for old type names (before December 2016) in your case?

Regards
Wojtek

I have problem with running sen2three too. it said directory does not found as picture below. sen2three-error

any idea. pls,
Thanks

according to the screenshot you haven’t selected a source folder

The mandatory argument is the directory where the input files are located. The given path can either be absolute or relative. If a relative path is given, the processor expects to be called from the path where the input files are located. Otherwise it will show an error message, that the directory cannot be located. If an absolute path is given, it must point to the directory where the input product is located.

Source: http://step.esa.int/thirdparties/sen2three/1.1.0/sen2three-1.1.0.htmldoc/sum.html#operation

Thanks ABraun,
I have selected source folder.


It runs to L3, but the name is given differently compare with Level 2
3

But when i open MTD_MSIL3.xml. Error happens
4

Why SNAP didn’t save Level 3 like it does in Level 2? It gives a strange name. So, When I run another file
Level 2 and save in the same folder. it doesn’t run at all, just 1 second. nothing happens.
6

Is there any options for us to name the file before running sen2three?

Thanks,

I don’t know that, sorry.