[Create spectral indices algo] not working correctly with FORCE BOA input

Issue #1389 resolved
Andreas Rabe created an issue

Reported by @Florian Katerndahl .

  1. Automatic band matching is not working:

Algorithm 'Create spectral indices' starting
Input parameters:
{ 'A' : None, 'B' : None, 'C1' : 6, 'C2' : 7.5, 'G' : None, 'L' : 1, 'N' : None, 'R' : None, 'RE1' : None, 'RE2' : None, 'RE3' : None, 'RE4' : None, 'S1' : None, 'S2' : None, 'T1' : None, 'T2' : None, 'alpha' : 0.1, 'cexp' : 1.16, 'g' : 2.5, 'gamma' : 1, 'indices' : 'NDVI', 'nexp' : 2, 'outputVrt' : 'TEMPORARY_OUTPUT', 'raster' : 'D:/data/issues/problematisches TIFF/20200928_LEVEL2_LND08_BOA.tif', 'scale' : None, 'sla' : 1, 'slb' : 0 }

Traceback (most recent call last):
File "C:\Users/Andreas/AppData/Roaming/QGIS/QGIS3\profiles\EnMAP-Box Develop/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 903, in wrapper
retval = func(*args, **kwargs)
File "C:\Users/Andreas/AppData/Roaming/QGIS/QGIS3\profiles\EnMAP-Box Develop/python/plugins\enmapboxplugin\enmapboxprocessing\algorithm\createspectralindicesalgorithm.py", line 180, in processAlgorithm
code = self.deriveParameters(short_name, formula, bands, bandList, reader, scale)
File "C:\Users/Andreas/AppData/Roaming/QGIS/QGIS3\profiles\EnMAP-Box Develop/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 902, in wrapper
check_argument_types(memo)
File "C:\Users/Andreas/AppData/Roaming/QGIS/QGIS3\profiles\EnMAP-Box Develop/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 748, in check_argument_types
raise exc from None
File "C:\Users/Andreas/AppData/Roaming/QGIS/QGIS3\profiles\EnMAP-Box Develop/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 746, in check_argument_types
check_type(description, value, expected_type, memo)
File "C:\Users/Andreas/AppData/Roaming/QGIS/QGIS3\profiles\EnMAP-Box Develop/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 641, in check_type
checker_func(argname, value, expected_type, memo)
File "C:\Users/Andreas/AppData/Roaming/QGIS/QGIS3\profiles\EnMAP-Box Develop/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 348, in check_list
check_type('{}[{}]'.format(argname, i), v, value_type, memo)
File "C:\Users/Andreas/AppData/Roaming/QGIS/QGIS3\profiles\EnMAP-Box Develop/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 668, in check_type
raise TypeError(
TypeError: type of argument "bandList"[0] must be int; got NoneType instead

Execution failed after 0.12 seconds

Loading resulting layers
Algorithm 'Create spectral indices' finished
QGIS version: 3.26.0-Buenos Aires
QGIS code revision: 0aece2818e
Qt version: 5.15.3
Python version: 3.9.5
GDAL version: 3.5.1
GEOS version: 3.10.3-CAPI-1.16.1
PROJ version: Rel. 9.0.1, June 15th, 2022
PDAL version: 2.3.0 (git-version: 988ee3)
Algorithm started at: 2022-07-14T08:41:59
Algorithm 'Create spectral indices' starting…
Input parameters:
{ 'A' : None, 'B' : None, 'C1' : 6, 'C2' : 7.5, 'G' : None, 'L' : 1, 'N' : None, 'R' : None, 'RE1' : None, 'RE2' : None, 'RE3' : None, 'RE4' : None, 'S1' : None, 'S2' : None, 'T1' : None, 'T2' : None, 'alpha' : 0.1, 'cexp' : 1.16, 'g' : 2.5, 'gamma' : 1, 'indices' : 'NDVI', 'nexp' : 2, 'outputVrt' : 'TEMPORARY_OUTPUT', 'raster' : 'D:/data/issues/problematisches TIFF/20200928_LEVEL2_LND08_BOA.tif', 'scale' : None, 'sla' : 1, 'slb' : 0 }

Traceback (most recent call last):
File "C:\Users/Andreas/AppData/Roaming/QGIS/QGIS3\profiles\EnMAP-Box Develop/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 903, in wrapper
retval = func(*args, **kwargs)
File "C:\Users/Andreas/AppData/Roaming/QGIS/QGIS3\profiles\EnMAP-Box Develop/python/plugins\enmapboxplugin\enmapboxprocessing\algorithm\createspectralindicesalgorithm.py", line 180, in processAlgorithm
code = self.deriveParameters(short_name, formula, bands, bandList, reader, scale)
File "C:\Users/Andreas/AppData/Roaming/QGIS/QGIS3\profiles\EnMAP-Box Develop/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 902, in wrapper
check_argument_types(memo)
File "C:\Users/Andreas/AppData/Roaming/QGIS/QGIS3\profiles\EnMAP-Box Develop/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 748, in check_argument_types
raise exc from None
File "C:\Users/Andreas/AppData/Roaming/QGIS/QGIS3\profiles\EnMAP-Box Develop/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 746, in check_argument_types
check_type(description, value, expected_type, memo)
File "C:\Users/Andreas/AppData/Roaming/QGIS/QGIS3\profiles\EnMAP-Box Develop/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 641, in check_type
checker_func(argname, value, expected_type, memo)
File "C:\Users/Andreas/AppData/Roaming/QGIS/QGIS3\profiles\EnMAP-Box Develop/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 348, in check_list
check_type('{}[{}]'.format(argname, i), v, value_type, memo)
File "C:\Users/Andreas/AppData/Roaming/QGIS/QGIS3\profiles\EnMAP-Box Develop/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 668, in check_type
raise TypeError(
TypeError: type of argument "bandList"[0] must be int; got NoneType instead

Execution failed after 0.10 seconds

2. After manually selecting NIR and Red bands, the NDVI output is not correctly scaled

Comments (7)

  1. Andreas Rabe reporter

    Note that both, the input BOA and the output NDVI have a scale factor of 0.0001. In case of BOA this is correct, in case of NDVI it is wrong.

  2. Andreas Rabe reporter

    Band matching isn’t working because FORCE uses the key Wavelength_unit instead of wavelength_units. We now support this as well.

  3. Florian Katerndahl

    Thank you @Andreas Janz for the quick fix. Unfortunately, I won’t be able to check it out this week.

  4. Log in to comment