Sen2Cor 2.10 source code issues

Hi all,

Related to the “global name ‘CogConverter’ is not defined” when using Sen2Cor 2.10. I found some errors in the source code.

In Sen2Cor-02.10.01-win64\Lib\site-packages\sen2cor\L2A_Tables.py line 2818, it used tif_file = CogConverter() but lacking of importing the CogConverter from L2A_CogConverter.py.

However, if I import the L2A_CogConverter.py into the L2A_Tables.py, It will arrive with some other errors as below:

no such child: Granule
Traceback (most recent call last):
  File "/Users/xxx/Downloads/Sen2Cor-02.10.01-Darwin64/lib/python2.7/site-packages/sen2cor/L2A_Process.py", line 692, in main
    if tile.process() == True:
  File "/Users/xxx/Downloads/Sen2Cor-02.10.01-Darwin64/lib/python2.7/site-packages/sen2cor/L2A_ProcessTileToolbox.py", line 117, in process
    if not self.process_resolution(20):
  File "/Users/xxx/Downloads/Sen2Cor-02.10.01-Darwin64/lib/python2.7/site-packages/sen2cor/L2A_ProcessTileToolbox.py", line 147, in process_resolution
    return self._process()
  File "/Users/xxx/Downloads/Sen2Cor-02.10.01-Darwin64/lib/python2.7/site-packages/sen2cor/L2A_ProcessTileToolbox.py", line 197, in _process
    if self.postprocess() == False:
  File "/Users/xxx/Downloads/Sen2Cor-02.10.01-Darwin64/lib/python2.7/site-packages/sen2cor/L2A_ProcessTileToolbox.py", line 273, in postprocess
    res = self.tables.downsampleBandList_20to60_andExport()
  File "/Users/xxx/Downloads/Sen2Cor-02.10.01-Darwin64/lib/python2.7/site-packages/sen2cor/L2A_Tables.py", line 3097, in downsampleBandList_20to60_andExport
    Granule = pi.Product_Organisation.Granule_List.Granule
  File "src/lxml/lxml.objectify.pyx", line 229, in lxml.objectify.ObjectifiedElement.__getattr__
  File "src/lxml/lxml.objectify.pyx", line 450, in lxml.objectify._lookupChildOrRaise
AttributeError: no such child: Granule
Progress[%]: 100.00 : Application terminated with at least one error.

I have tested both Windows and macOS versions. They have the same errors.

Can anybody help me? Many thanks.

2 Likes

Dear user,

This --tiff option issue has been fixed in Sen2Cor 2.11.

Please be aware of point 7) of Sen2Cor FAQ if you plan to install Sen2Cor version 2.11 on Linux recent distributions.

Cheers,

@Sen2cor_dev_team