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.