AssertionError when opening a spectral library from ENVI (.sli)

Issue #1383 resolved
María Angélica Prieto created an issue

I just installed ENMAP (3.9.20211123T125541.master version / QGIS version 3.22.7-Białowieża) and I’m triying to open a .sli file from Open spectral library window. I got the following message about the python process:

2022-06-21T16:58:10     INFO    Please add / activate spectral processing algorithms

2022-06-21T16:58:17     WARNING    Error de Python : Ha ocurrido un error mientras se ejecutaba el código de Python: Vea el registro de mensajes (Error de Python) para más detalles.

Also, got this in the error traceback:

2022-06-21T16:58:17     WARNING    Traceback (most recent call last):
File "C:\Users/mange/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\externals\qps\speclib\gui\spectrallibrarywidget.py", line 600, in onImportProfiles
SpectralLibraryImportDialog.importProfiles(self.speclib(), parent=self)
File "C:\Users/mange/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\externals\qps\speclib\core\spectrallibraryio.py", line 542, in importProfiles
profiles = io.importProfiles(source, settings, feedback)
File "C:\Users/mange/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\externals\qps\speclib\io\envi.py", line 475, in importProfiles
ds = esl2vrt(pathESL, tmpVrt)
File "C:\Users/mange/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\externals\qps\speclib\io\envi.py", line 736, in esl2vrt
assert hdr is not None and hdr['file type'] == 'ENVI Spectral Library'
AssertionError

Which complement or package am I missing? Thank you in advance.

Comments (5)

  1. Benjamin Jakimow

    @María Angélica Prieto please check the “file type” in the hdr file of your spectral library. It need to be “file type = ENVI Spectral Library”. However, with the changes commited above, this is now handled a bit more flexibe to allow “file type = Spectral Library” as well.

  2. Log in to comment