Sen4et "structural_params.py" produces ERROR:list index out of range

Hi everyone,

I am trying to implement the sen4et (http://esa-sen4et.org/) product. So far I have been able to:

  • Download a test image using “sentinel_data_download.py” in Python 3.6
  • Run “Biophysical processor” in SNAP GUI
  • Run the graphs “add_elevation.xml” and “add_landcover.xml” in SNAP Command-Line
  • Run “leaf_spectra.py” and “frac_green.py” in Python 3.6

The images produced by the above mentioned processes appear to be adequate in range and extension.

However, when trying to run “structural_params.py” an error occurs…

C:\Users\SNMACIAS.snap\auxdata\sen-et-conda-Win64>python C:\Users\SNMACIAS.snap\auxdata\sen-et-conda-Win64\sen-et-snap-scripts\structural_params.py --landcover_map C:\Users\SNMACIAS\Downloads\sen-et\obr\landcover.dim --lai_map C:\Users\SNMACIAS\Downloads\sen-et\obr\200102_bio.dim --fgv_map C:\Users\SNMACIAS\Downloads\sen-et\obr\200102_fgv.dim --landcover_band land_cover_CCILandCover-2015 --lookup_table C:\Users\SNMACIAS.snap\auxdata\sen-et-conda-Win64\sen-et-snap-scripts\auxdata\LUT\ESA_CCI_LUT.csv --produce_vh N --produce_fc N --produce_chwr N --produce_lw N --produce_lid N --produce_igbp N --output_file C:\Users\SNMACIAS\Downloads\sen-et\obr\200102_str.dim
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
INFO: org.hsqldb.persist.Logger: dataFileCache open start
ERROR:list index out of range

I used the default “ESA_CCI_LUT.csv” file which separates entries by semi-colon (:wink: rather than comma (,). I have checked the land use map (landcover.dim) and it includes the classes as expected (e.g. 0 to 220) and that are included in the *.csv file. I also tried to replace semi-colon by commas but I got a different error.

Can some give me a hand? please

Thanks

Hi,

I don’t think that the sen4et developers are around in this forum. And it seems that the problem is in their python script.
I suggested already someone else to ask the consortium directly.

Unfortunately, they don’t provide proper contacts on their web page.
I guess mailing to gras@dhigroup.com is a good starting point.

Hi,
It sounds like there is a landcover class (pixel value) in your landcover file which is not in the look-up table. Could you please double check if this is the case. Also, do you get the same error when executing the operator from within SNAP GUI?

1 Like

This error basically means you are trying to access a value at a List index which is out of bounds i.e greater than the last index of the list or less than the least index in the list. So the first element is 0, second is 1, so on. So if there are n elements in a python list, the last element is n-1 . If you try to access the empty or None element by pointing available index of the list, then you will get the "List index out of range " error. To solve this error, you should make sure that you’re not trying to access a non-existent item in a list.