semiautomaticgit/SemiAutomaticClassificationPlugin

Issue with band calc -

Closed this issue · 2 comments

I'm having problems with Band Calc, in fact, it could be a problem with Python. The script starts to calculate and gives an error, which is below.

Um erro ocorreu enquanto executava o código Python:

TypeError: 'NoneType' object is not subscriptable
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "C:\PROGRA1\QGIS321.10\apps\Python39\lib\multiprocessing\pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "C:\Users/joao.jptm/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\core\utils.py", line 4953, in processRasterDev
cfg.utls.logToFile(str(name) + '-' + str(cfg.inspectSCP.stack()[0][3])+ ' ' + cfg.utls.lineOfCode(), 'a[0, 0] ' + str(a[0, 0] ) )
TypeError: 'NoneType' object is not subscriptable
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users/joao.jptm/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\maininterface\bandcalcTab.py", line 505, in calculateButton
cfg.bCalc.calculate()
File "C:\Users/joao.jptm/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\maininterface\bandcalcTab.py", line 1118, in calculate
o = cfg.utls.multiProcessRaster(rasterPath = tPMD, functionBand = 'No', functionRaster = cfg.utls.bandCalculation, outputRasterList = [out], nodataValue = useNoDataValue, functionBandArgument = e, functionVariable = variableList, progressMessage = cfg.QtWidgetsSCP.QApplication.translate('semiautomaticclassificationplugin', 'Calculation ') + str(e), skipReplaceNoData = skipReplaceNoDT, virtualRaster = vrtR, compress = cfg.rasterCompression, compressFormat = 'LZW', outputNoDataValue = outputNoData, dataType = rasterDataType, scale = useScale, offset = useOffset, calcDataType = calcDataType, nodataMask = nodataMask)
File "C:\Users/joao.jptm/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\core\utils.py", line 5385, in multiProcessRaster
res = r[0].get()
File "C:\PROGRA1\QGIS321.10\apps\Python39\lib\multiprocessing\pool.py", line 771, in get
raise self._value
TypeError: 'NoneType' object is not subscriptable

Versão do Python: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
Versão do QGIS: 3.28.10-Firenze Firenze, e2edb9c468

Caminho do Python:
C:\Users\joao.jptm\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\planet_explorer\extlibs
C:/PROGRA1/QGIS321.10/apps/qgis-ltr/./python
C:/Users/joao.jptm/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/joao.jptm/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA1/QGIS321.10/apps/qgis-ltr/./python/plugins
C:\PROGRA1\QGIS321.10\apps\grass\grass83\etc\python
C:\Users\joao.jptm\Documents
C:\Program Files\QGIS 3.28.10\bin\python39.zip
C:\PROGRA1\QGIS321.10\apps\Python39\DLLs
C:\PROGRA1\QGIS321.10\apps\Python39\lib
C:\Program Files\QGIS 3.28.10\bin
C:\Users\joao.jptm\AppData\Roaming\Python\Python39\site-packages
C:\PROGRA1\QGIS321.10\apps\Python39
C:\PROGRA1\QGIS321.10\apps\Python39\lib\site-packages
C:\PROGRA1\QGIS321.10\apps\Python39\lib\site-packages\win32
C:\PROGRA1\QGIS321.10\apps\Python39\lib\site-packages\win32\lib
C:\PROGRA1\QGIS321.10\apps\Python39\lib\site-packages\Pythonwin
C:/Users/joao.jptm/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\joao.jptm\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\ee_plugin\extlibs_windows
C:\Users/joao.jptm/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages
C:\Users/joao.jptm/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin
C:\Users\joao.jptm\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\qgispluginsupport\qps\pyqtgraph
C:\Users\joao.jptm\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\site-packages
C:\Users\joao.jptm\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\apps
C:\Users\joao.jptm\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\coreapps
C:\Users\joao.jptm\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\eo4qapps
.
C:\Users\joao.jptm\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\HCMGIS/forms

Hello, it could be an issue related to input data.
Please copy the log file following these steps https://semiautomaticclassificationmanual.readthedocs.io/en/latest/faq.html#how-can-i-report-an-error

I'm closing this because of the new version 8 of SCP.
Please reopen it if it is still relevant in the new version.
Thank you!