Command line iCOR 2.0 failing for S2 data


We have recently installed iCOR 2.0 to process Landsat 8 and Sentinel 2 data (ubuntu 18.04 LTS). We are mainly insterested on batch processing. Some time ago we worked with iCOR previous version, and after a iCOR developers feedback we used a command line call to in order to process the data.

Currently, these command line call is working correctly por Landsat 8, however are failing for Sentinel 2. We show an example of the S2-iCOR call and their output:

/usr/bin/python /opt/vito/icor/src/ --keep_intermediate true --cloud_average_threshold 0.19 --cloud_low_band B01 --cloud_low_threshold 0.25 --cirrus true --aot true --aot_window_size 500 --simec true --watervapor true --bg_window 1 --cirrus_threshold 0.01 --aot_override 0.1 --ozone_override 0.33 --wv_override 2.0 --water_band B08 --water_threshold 0.05 --data_type S2 --output_file /media/seasnet/ext10tb_02/sentinel2/procesamiento/canarias/20190312_S2A/S2A_20190312_T28RBS.tif /media/seasnet/ext10tb_02/sentinel2/procesamiento/canarias/20190312_S2A/S2A_MSIL1C_20190312T115211_N0207_R123_T28RBS_20190312T151823.SAFE/MTD_MSIL1C.xml
parsing arguments
icor installation folder /opt/vito/icor
running icor for Sentinel2 …
reading config /opt/vito/icor/src/config/local_sentinel2_simec.ini
output path = /media/seasnet/ext10tb_02/sentinel2/procesamiento/canarias/20190312_S2A/S2A_20190312_T28RBS.tif
iCOR temp folder : /tmp/icor_ttCvEv_proc
workflow = simec
Traceback (most recent call last):
File "/opt/vito/icor/src/", line 45, in process_product
icor.sentinel2.process_saf(context, product,working_folder)
File "/opt/vito/icor/src/icor/", line 72, in process_saf
granules = sentinel2_metadata.parse(path,bandList)
File "/opt/vito/icor/src/icor/", line 310, in parse
raise Exception("Something went wrong while parsing the S2 metadata file: %s" % str(e))
Exception: Something went wrong while parsing the S2 metadata file: coercing to Unicode: need string or buffer, NoneType found

Due to that I have test the SNAP plugin to interactively run iCOR fo S2 data and it works on our system. Please find enclosed the succesful SNAP interactive iCOR usage “Display Execution Output” in the attached file S2_SNAP_interactive_iCOR.txt. Why is not working from command line call?


S2_SNAP_interactive_iCOR.txt (6.4 KB)


the quick solution to this problem is to provide the link to an image file in the ‘IMAGE_DATA’ folder as the input file.
In stead of

you can provide


as an administrator, change a line code in
line 162
if str(input_file).find(“GRANULE”):
if str(input_file).find(“GRANULE”) != -1:

this bug will be fixed in a next release/patch.

Hope this works out for you.
Stefan Adriaensen



Thank you very much for the support. Following your instructions I have changed the line 162 in and currently the processing is working