# Habitat Q. Error

**URL:** <https://community.naturalcapitalalliance.org/t/habitat-q-error/431>\
**Category:** Software Support\
**Tags:** habitat-quality\
**Created:** [September 2, 2019, 3:09am UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431 "2019-09-02T03:09:09Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhamma57](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@dhamma57](https://community.naturalcapitalalliance.org/u/dhamma57)\
**Post date:** [September 2, 2019, 3:09am UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/1 "2019-09-02T03:09:09Z")

</div>

Hi  
what is the error for this message…  
Initializing…  
Showing messages with level INFO and higher  
09/02/2019 09:53:47 natcap.invest.utils INFO Writing log messages to X:\KKC\_Threat2\invest\run1\InVEST-Habitat-Quality-log-2019-09-02–09\_53\_47.txt  
09/02/2019 09:53:47 natcap.invest.ui.model Level 100 Starting model with parameters:  
Arguments for InVEST natcap.invest.habitat\_quality 3.6.0:  
half\_saturation\_constant 0.5  
lulc\_cur\_path X:/KKC\_Threat2/invest/landuse\_tiff/lu2015\_4.tif  
n\_workers -1  
sensitivity\_table\_path X:/KKC\_Threat2/invest/sensitivity5\_kkc.csv  
suffix T2  
threat\_raster\_folder X:\KKC\_Threat2\invest\Threat\_tiff  
threats\_table\_path X:/KKC\_Threat2/invest/KKC\_Threat4.csv  
workspace\_dir X:\KKC\_Threat2\invest\run1

09/02/2019 09:53:47 natcap.invest.ui.model ERROR Exception while executing \<function execute at 0x137FE3F0\>  
Traceback (most recent call last):  
File “C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\env\lib\site-packages\natcap\invest\ui\model.py”, line 1579, in \_logged\_target  
File “C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\env\lib\site-packages\natcap\invest\habitat\_quality.py”, line 178, in execute  
ValueError: The following land cover codes were found in the sensitivity table. Check your sensitivity table to see if they are missing: -128.

09/02/2019 09:53:47 natcap.invest.ui.model INFO Execution finished  
09/02/2019 09:53:47 natcap.invest.utils INFO Elapsed time: 0.27s  
09/02/2019 09:53:47 natcap.invest.ui.execution ERROR Target \<function \_logged\_target at 0x17224B30\> failed with exception  
Traceback (most recent call last):  
File “C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\env\lib\site-packages\natcap\invest\ui\execution.py”, line 68, in run  
File “C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\env\lib\site-packages\natcap\invest\ui\model.py”, line 1579, in \_logged\_target  
File “C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\env\lib\site-packages\natcap\invest\habitat\_quality.py”, line 178, in execute  
ValueError: The following land cover codes were found in the sensitivity table. Check your sensitivity table to see if they are missing: -128.

09/02/2019 09:53:47 natcap.invest.ui.execution INFO Execution finished  
09/02/2019 09:53:57 natcap.invest.ui.inputs INFO Opening file explorer to workspace directory  
09/02/2019 09:53:57 natcap.invest.ui.inputs INFO Using windows explorer to view files  
09/02/2019 10:06:24 natcap.invest.ui.inputs INFO Opening file explorer to workspace directory  
09/02/2019 10:06:24 natcap.invest.ui.inputs INFO Using windows explorer to view files

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [September 3, 2019, 5:02pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/2 "2019-09-03T17:02:52Z")

</div>

Hi @dhamma57, I believe we’ve fixed this issue in a more recent version of InVEST. Could you try this development build and see if the issue is fixed?

Here’s the download link: [https://storage.googleapis.com/releases.naturalcapitalproject.org/invest/3.6.0.post525%2Bh31b10cfee0d4/InVEST\_3.6.0.post525%2Bh31b10cfee0d4\_x86\_Setup.exe](https://storage.googleapis.com/releases.naturalcapitalproject.org/invest/3.6.0.post525%2Bh31b10cfee0d4/InVEST_3.6.0.post525%2Bh31b10cfee0d4_x86_Setup.exe)

Let us know if the issue persists using this version of InVEST.  
James

---

<div class="post-metadata">

**Author:** ![dhamma57](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@dhamma57](https://community.naturalcapitalalliance.org/u/dhamma57)\
**Post date:** [September 3, 2019, 5:38pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/3 "2019-09-03T17:38:39Z")

</div>

Dear Sir.  
It run to a new ERROR,  
Initializing…  
Showing messages with level INFO and higher  
2019-09-04 00:35:16,947 utils.prepare\_workspace(109) INFO Writing log messages to X:\KKC\_Threat2\invest\run1\InVEST-Habitat-Quality-log-2019-09-04–00\_35\_16.txt  
2019-09-04 00:35:16,953 model.\_logged\_target(1634) Level 100 Starting model with parameters:  
Arguments for InVEST natcap.invest.habitat\_quality 3.6.0.post525+h31b10cfee0d4:  
half\_saturation\_constant 0.5  
lulc\_cur\_path X:/KKC\_Threat2/invest/landuse\_tiff/lu2015\_4.tif  
n\_workers -1  
sensitivity\_table\_path X:/KKC\_Threat2/invest/sensitivity5\_kkc.csv  
suffix T2  
threat\_raster\_folder X:\KKC\_Threat2\invest\Threat\_tiff  
threats\_table\_path X:/KKC\_Threat2/invest/KKC\_Threat4.csv  
workspace\_dir X:\KKC\_Threat2\invest\run1

2019-09-04 00:35:17,186 habitat\_quality.execute(193) INFO Starting aligning and resizing land cover and threat rasters  
2019-09-04 00:35:17,194 geoprocessing.align\_and\_resize\_raster\_stack(729) INFO n\_workers \> 1 (2) so starting a processes pool.  
2019-09-04 00:35:18,477 geoprocessing.align\_and\_resize\_raster\_stack(779) INFO 1 of 7 aligned: lu2015\_4\_aligned.tif  
2019-09-04 00:35:19,089 geoprocessing.align\_and\_resize\_raster\_stack(779) INFO 2 of 7 aligned: ntfp\_c\_aligned.tif  
2019-09-04 00:35:19,181 geoprocessing.align\_and\_resize\_raster\_stack(779) INFO 3 of 7 aligned: poaching\_c\_aligned.tif  
2019-09-04 00:35:19,578 geoprocessing.align\_and\_resize\_raster\_stack(779) INFO 4 of 7 aligned: logging\_c\_aligned.tif  
2019-09-04 00:35:19,670 geoprocessing.align\_and\_resize\_raster\_stack(779) INFO 5 of 7 aligned: slash\_c\_aligned.tif  
2019-09-04 00:35:20,134 geoprocessing.align\_and\_resize\_raster\_stack(779) INFO 6 of 7 aligned: camp\_c\_aligned.tif  
2019-09-04 00:35:20,272 geoprocessing.align\_and\_resize\_raster\_stack(779) INFO 7 of 7 aligned: human\_c\_aligned.tif  
2019-09-04 00:35:20,414 geoprocessing.align\_and\_resize\_raster\_stack(788) INFO aligned all 7 rasters.  
2019-09-04 00:35:20,414 habitat\_quality.execute(207) INFO Finished aligning and resizing land cover and threat rasters  
2019-09-04 00:35:20,414 habitat\_quality.execute(221) INFO Starting habitat\_quality biophysical calculations  
2019-09-04 00:35:20,414 habitat\_quality.execute(228) INFO Handling Access Shape  
2019-09-04 00:35:20,753 habitat\_quality.execute(241) INFO No Access Shape Provided, access raster filled with 1s.  
2019-09-04 00:35:20,757 habitat\_quality.execute(253) INFO Calculating habitat quality for landuse: X:\KKC\_Threat2\invest\run1\intermediate\lu2015\_4\_aligned.tif  
2019-09-04 00:35:20,757 habitat\_quality.map\_raster\_to\_dict\_values(640) INFO Starting map\_raster\_to\_dict\_values  
2019-09-04 00:35:20,778 geoprocessing.raster\_calculator(366) INFO starting stats\_worker  
2019-09-04 00:35:20,789 geoprocessing.raster\_calculator(372) INFO started stats\_worker \<Thread(Thread-25, started daemon 3472)\>  
2019-09-04 00:35:20,838 geoprocessing.raster\_calculator(477) INFO Waiting for raster stats worker result.  
2019-09-04 00:35:20,838 threading.run(754) WARNING No valid pixels were received, sending None.  
2019-09-04 00:35:20,842 model.\_logged\_target(1640) ERROR Exception while executing \<function execute at 0x10EBC270\>  
Traceback (most recent call last):  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1637, in \_logged\_target  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\habitat\_quality.py”, line 260, in execute  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\habitat\_quality.py”, line 647, in map\_raster\_to\_dict\_values  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 1766, in reclassify\_raster  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 415, in raster\_calculator  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 1762, in \_map\_dataset\_to\_value\_op  
IndexError: index 17 is out of bounds for axis 0 with size 17  
2019-09-04 00:35:20,842 model.\_logged\_target(1643) INFO Execution finished  
2019-09-04 00:35:20,842 utils.prepare\_workspace(115) INFO Elapsed time: 3.89s  
2019-09-04 00:35:20,845 execution.run(78) ERROR Target \<function \_logged\_target at 0x13A94030\> failed with exception  
Traceback (most recent call last):  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\execution.py”, line 68, in run  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1637, in \_logged\_target  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\habitat\_quality.py”, line 260, in execute  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\habitat\_quality.py”, line 647, in map\_raster\_to\_dict\_values  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 1766, in reclassify\_raster  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 415, in raster\_calculator  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 1762, in \_map\_dataset\_to\_value\_op  
IndexError: index 17 is out of bounds for axis 0 with size 17  
2019-09-04 00:35:20,845 execution.run(83) INFO Execution finished  
2019-09-04 00:35:20,858 inputs.open\_workspace(99) INFO Opening file explorer to workspace directory  
2019-09-04 00:35:20,858 inputs.open\_workspace(103) INFO Using windows explorer to view files

I am sure, i am not run with the pipeline data,  
Thank you

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [September 3, 2019, 6:04pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/4 "2019-09-03T18:04:48Z")

</div>

Ah, I can’t believe I attached the wrong download link. Sorry about that! Here’s the actual latest development build: [https://storage.googleapis.com/releases.naturalcapitalproject.org/invest/3.7.0.post366+hc94dfedffddd/InVEST\_3.7.0.post366+hc94dfedffddd\_x86\_Setup.exe](https://storage.googleapis.com/releases.naturalcapitalproject.org/invest/3.7.0.post366+hc94dfedffddd/InVEST_3.7.0.post366+hc94dfedffddd_x86_Setup.exe)

Could you try this one and let us know if this works?  
Thanks!  
James

---

<div class="post-metadata">

**Author:** ![dhamma57](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@dhamma57](https://community.naturalcapitalalliance.org/u/dhamma57)\
**Post date:** [September 4, 2019, 6:08am UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/5 "2019-09-04T06:08:35Z")

</div>

Dear Sir;  
It still error by the pipeline data;  
Initializing…  
Showing messages with level INFO and higher  
2019-09-04 13:06:23,216 utils.prepare\_workspace(115) INFO Writing log messages to X:\KKC\_Threat2\invest\run2\InVEST-Habitat-Quality-log-2019-09-04–13\_06\_23.txt  
2019-09-04 13:06:23,220 model.\_logged\_target(1653) Level 100 Starting model with parameters:  
Arguments for InVEST natcap.invest.habitat\_quality 3.7.0.post366+hc94dfedffddd:  
half\_saturation\_constant 0.5  
lulc\_cur\_path X:/KKC\_Threat2/invest/landuse\_tiff/lu2015\_4.tif  
n\_workers -1  
sensitivity\_table\_path X:/KKC\_Threat2/invest/sensitivity5\_kkc.csv  
suffix T3  
threat\_raster\_folder X:\KKC\_Threat2\invest\Threat\_tiff  
threats\_table\_path X:/KKC\_Threat2/invest/KKC\_Threat4.csv  
workspace\_dir X:\KKC\_Threat2\invest\run2

2019-09-04 13:06:23,263 model.\_logged\_target(1659) ERROR Exception while executing \<function execute at 0x13F7E330\>  
Traceback (most recent call last):  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1656, in \_logged\_target  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\habitat\_quality.py”, line 94, in execute  
KeyError: 0  
2019-09-04 13:06:23,263 model.\_logged\_target(1662) INFO Execution finished  
2019-09-04 13:06:23,267 utils.prepare\_workspace(121) INFO Elapsed time: 0.05s  
2019-09-04 13:06:23,279 execution.run(78) ERROR Target \<function \_logged\_target at 0x13F7E8B0\> failed with exception  
Traceback (most recent call last):  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\execution.py”, line 68, in run  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1656, in \_logged\_target  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\habitat\_quality.py”, line 94, in execute  
KeyError: 0  
2019-09-04 13:06:23,279 execution.run(83) INFO Execution finished

Cheers;

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [September 4, 2019, 8:42pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/6 "2019-09-04T20:42:01Z")

</div>

Ah, interesting. This error makes it sound like the model couldn’t effectively parse the sensitivity table ( X:/KKC\_Threat2/invest/sensitivity5\_kkc.csv) correctly. This is usually die to a formatting issue such as the use of an unsupported delimiter. Could you post your sensitivity table so we can take a look?

Thanks!  
James

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [September 5, 2019, 10:15pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/7 "2019-09-05T22:15:00Z")

</div>

Hi @dhamma57, actually, another user on the forums just reported the same error and if it is indeed the same, I’m hoping that this development build will address the issue for you. Could you try it out and let us know how it goes?

[https://storage.googleapis.com/natcap-dev-build-artifacts/invest/jdouglass/3.7.0.post367+h11eff01a4d13/InVEST\_3.7.0.post367+h11eff01a4d13\_x86\_Setup.exe](https://storage.googleapis.com/natcap-dev-build-artifacts/invest/jdouglass/3.7.0.post367+h11eff01a4d13/InVEST_3.7.0.post367+h11eff01a4d13_x86_Setup.exe)

Thanks!  
James

---

<div class="post-metadata">

**Author:** ![glo](https://avatars.discourse-cdn.com/v4/letter/g/dec6dc/32.png) [@glo](https://community.naturalcapitalalliance.org/u/glo)\
**Post date:** [September 7, 2019, 8:39pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/8 "2019-09-07T20:39:12Z")

</div>

Dear jdouglass,  
I have tried running a model for about a week now without success. It has kept flagging an error. I am using the latest version of the software. The log is as follows:

2019-09-07 22:35:36,664 utils.prepare\_workspace(109) INFO Writing log messages to C:\Users\DR. ENARUVBE\Documents\habitat\_quality\_workspace\InVEST-Habitat-Quality-log-2019-09-07–22\_35\_36.txt  
2019-09-07 22:35:37,117 model.\_logged\_target(1633) Level 100 Starting model with parameters:  
Arguments for InVEST natcap.invest.habitat\_quality 3.7.0:  
half\_saturation\_constant 0.5  
lulc\_bas\_path E:/Google Drive/Research/Ecosystem services Ile-Ife/Opa Reservior/2000raw.tif  
lulc\_cur\_path E:/Google Drive/Research/Ecosystem services Ile-Ife/Opa Reservior/2018raw.tif  
lulc\_fut\_path E:/Google Drive/Research/Ecosystem services Ile-Ife/Opa Reservior/2030a.tif  
n\_workers -1  
sensitivity\_table\_path E:/Google Drive/Research/Ecosystem services Ile-Ife/Opa Reservior/Threats/sensitivity.csv  
suffix  
threat\_raster\_folder E:\Google Drive\Research\Ecosystem services Ile-Ife\Opa Reservior\Threats  
threats\_table\_path E:/Google Drive/Research/Ecosystem services Ile-Ife/Opa Reservior/Threats/threats.csv  
workspace\_dir C:\Users\DR. ENARUVBE\Documents\habitat\_quality\_workspace

2019-09-07 22:35:37,164 model.\_logged\_target(1639) ERROR Exception while executing \<function execute at 0x10F0C3F0\>  
Traceback (most recent call last):  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1636, in \_logged\_target  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\habitat\_quality.py”, line 112, in execute  
ValueError: Threat “Farmland” does not match any column in the sensitivity table. Possible columns: set([‘Farmland’, ‘Built-up’])  
2019-09-07 22:35:37,164 model.\_logged\_target(1642) INFO Execution finished  
2019-09-07 22:35:37,164 utils.prepare\_workspace(115) INFO Elapsed time: 0.5s

Please assist  
Glory

---

<div class="post-metadata">

**Author:** ![dhamma57](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@dhamma57](https://community.naturalcapitalalliance.org/u/dhamma57)\
**Post date:** [September 9, 2019, 1:32pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/9 "2019-09-09T13:32:13Z")

</div>

Hi.  
It’ still error but with this message,  
Initializing…  
Showing messages with level INFO and higher  
2019-09-09 20:30:29,979 utils.prepare\_workspace(115) INFO Writing log messages to X:\KKC\_Threat2\invest\run2\InVEST-Habitat-Quality-log-2019-09-09–20\_30\_29.txt  
2019-09-09 20:30:29,979 model.\_logged\_target(1653) Level 100 Starting model with parameters:  
Arguments for InVEST natcap.invest.habitat\_quality 3.7.0.post367+h11eff01a4d13:  
half\_saturation\_constant 0.5  
lulc\_cur\_path X:/KKC\_Threat2/invest/landuse\_tiff/lu2015\_4.tif  
n\_workers -1  
sensitivity\_table\_path X:/KKC\_Threat2/invest/sensitivity5\_kkc.csv  
suffix T3  
threat\_raster\_folder X:\KKC\_Threat2\invest\Threat\_tiff  
threats\_table\_path X:/KKC\_Threat2/invest/KKC\_Threat4.csv  
workspace\_dir X:\KKC\_Threat2\invest\run2

2019-09-09 20:30:30,306 habitat\_quality.execute(193) INFO Starting aligning and resizing land cover and threat rasters  
2019-09-09 20:30:30,315 geoprocessing.align\_and\_resize\_raster\_stack(730) INFO n\_workers \> 1 (2) so starting a processes pool.  
2019-09-09 20:30:31,852 geoprocessing.align\_and\_resize\_raster\_stack(780) INFO 1 of 7 aligned: lu2015\_4\_aligned.tif  
2019-09-09 20:30:32,490 geoprocessing.align\_and\_resize\_raster\_stack(780) INFO 2 of 7 aligned: ntfp\_c\_aligned.tif  
2019-09-09 20:30:32,678 geoprocessing.align\_and\_resize\_raster\_stack(780) INFO 3 of 7 aligned: poaching\_c\_aligned.tif  
2019-09-09 20:30:33,171 geoprocessing.align\_and\_resize\_raster\_stack(780) INFO 4 of 7 aligned: logging\_c\_aligned.tif  
2019-09-09 20:30:33,344 geoprocessing.align\_and\_resize\_raster\_stack(780) INFO 5 of 7 aligned: slash\_c\_aligned.tif  
2019-09-09 20:30:33,727 geoprocessing.align\_and\_resize\_raster\_stack(780) INFO 6 of 7 aligned: camp\_c\_aligned.tif  
2019-09-09 20:30:34,029 geoprocessing.align\_and\_resize\_raster\_stack(780) INFO 7 of 7 aligned: human\_c\_aligned.tif  
2019-09-09 20:30:34,109 geoprocessing.align\_and\_resize\_raster\_stack(789) INFO aligned all 7 rasters.  
2019-09-09 20:30:34,109 habitat\_quality.execute(207) INFO Finished aligning and resizing land cover and threat rasters  
2019-09-09 20:30:34,109 habitat\_quality.execute(221) INFO Starting habitat\_quality biophysical calculations  
2019-09-09 20:30:34,109 habitat\_quality.execute(228) INFO Handling Access Shape  
2019-09-09 20:30:34,503 habitat\_quality.execute(241) INFO No Access Shape Provided, access raster filled with 1s.  
2019-09-09 20:30:34,503 habitat\_quality.execute(253) INFO Calculating habitat quality for landuse: X:\KKC\_Threat2\invest\run2\intermediate\lu2015\_4\_aligned.tif  
2019-09-09 20:30:34,503 habitat\_quality.map\_raster\_to\_dict\_values(641) INFO Starting map\_raster\_to\_dict\_values  
2019-09-09 20:30:34,525 geoprocessing.raster\_calculator(367) INFO starting stats\_worker  
2019-09-09 20:30:34,529 geoprocessing.raster\_calculator(373) INFO started stats\_worker \<Thread(Thread-5, started daemon 2188)\>  
2019-09-09 20:30:34,536 geoprocessing.raster\_calculator(478) INFO Waiting for raster stats worker result.  
2019-09-09 20:30:34,536 threading.run(754) WARNING No valid pixels were received, sending None.  
2019-09-09 20:30:34,540 model.\_logged\_target(1659) ERROR Exception while executing \<function execute at 0x149DE330\>  
Traceback (most recent call last):  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1656, in \_logged\_target  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\habitat\_quality.py”, line 260, in execute  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\habitat\_quality.py”, line 648, in map\_raster\_to\_dict\_values  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 1770, in reclassify\_raster  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 416, in raster\_calculator  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 1766, in \_map\_dataset\_to\_value\_op  
IndexError: index 17 is out of bounds for axis 0 with size 17  
2019-09-09 20:30:34,540 model.\_logged\_target(1662) INFO Execution finished  
2019-09-09 20:30:34,540 utils.prepare\_workspace(121) INFO Elapsed time: 4.56s  
2019-09-09 20:30:34,545 execution.run(78) ERROR Target \<function \_logged\_target at 0x149DE8B0\> failed with exception  
Traceback (most recent call last):  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\execution.py”, line 68, in run  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1656, in \_logged\_target  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\habitat\_quality.py”, line 260, in execute  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\habitat\_quality.py”, line 648, in map\_raster\_to\_dict\_values  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 1770, in reclassify\_raster  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 416, in raster\_calculator  
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 1766, in \_map\_dataset\_to\_value\_op  
IndexError: index 17 is out of bounds for axis 0 with size 17  
2019-09-09 20:30:34,545 execution.run(83) INFO Execution finished

Cheers,

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [September 10, 2019, 6:56pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/10 "2019-09-10T18:56:55Z")

</div>

Hi @glo, I’m not completely sure what’s going on here. Could you attach or send your inputs so we can take a closer look?

Thanks!  
James

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [September 10, 2019, 6:59pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/11 "2019-09-10T18:59:16Z")

</div>

@dhamma57, could you attach or send your inputs so we can take a closer look? It isn’t immediately clear what’s going on here.

Thanks!  
James

---

<div class="post-metadata">

**Author:** ![dhamma57](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@dhamma57](https://community.naturalcapitalalliance.org/u/dhamma57)\
**Post date:** [September 18, 2019, 6:10pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/12 "2019-09-18T18:10:56Z")

</div>

Hi,

These are the set of files,

Cheers

ในวันที่ พ. 11 ก.ย. 2019 เวลา 02:09 James Douglass via Natural Capital Project Online Community [naturalcapitalproject@discoursemail.com](mailto:naturalcapitalproject@discoursemail.com) เขียนว่า:

(Attachment invest.rar is missing)

---

<div class="post-metadata">

**Author:** ![dhamma57](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@dhamma57](https://community.naturalcapitalalliance.org/u/dhamma57)\
**Post date:** [September 18, 2019, 6:12pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/13 "2019-09-18T18:12:58Z")

</div>

Hi

I send the files to your mail box,  
But i have some surprise, these files could run by version 3.4.4

Thammanoon

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [September 18, 2019, 6:16pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/14 "2019-09-18T18:16:43Z")

</div>

Ok, good to know that these inputs will run in InVEST 3.4.4 … we’ll take a look at why they aren’t running in the latest version yet. You can send them to my email, jdouglass@stanford.edu since it looks like they’re too big to upload here.

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [September 19, 2019, 5:44pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/15 "2019-09-19T17:44:14Z")

</div>

HI @dhamma57, it looks like `invest.rar` wasn’t attached to the discussion (probably because the file is too large for the forum 🙂 )

> [@dhamma57](#):
>
> (Attachment invest.rar is missing)

Could you send your inputs directly to my email address (`jdouglass@stanford.edu`) so I can take a look?

Thanks,  
James

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [October 3, 2019, 9:36pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/16 "2019-10-03T21:36:09Z")

</div>

Hi @dhamma57 I’m so sorry about the delay on this, and thanks for sending your inputs!!

So, the issue here is that a reclassification operation within the InVEST Habitat Quality model isn’t handling your landcover raster correctly because its format is a signed byte. While ArcGIS supports signed byte rasters no problem, the library we use to read and write rasters (GDAL) does not. I’ve converted your landcover to an Unsigned Int16 (and set the nodata value to 128) and the model completes successfully. I’ve emailed you the revised landcover raster so you can try this out for yourself in the short term. In the longer term, we’ll see about the best way to resolve this on our end and include the fix in a future release of InVEST.

Thanks for your patience on this and again, so sorry about the delay!  
James

---

<div class="post-metadata">

**Author:** ![lisuxiao](https://avatars.discourse-cdn.com/v4/letter/l/f6c823/32.png) [@lisuxiao](https://community.naturalcapitalalliance.org/u/lisuxiao)\
**Post date:** [April 5, 2021, 1:33pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/17 "2021-04-05T13:33:08Z")

</div>

[sensitivity\_JJJ.csv](https://community.naturalcapitalalliance.org/uploads/short-url/ntxj3VDfgIwBaoGXSJJdHKkDN99.csv) (972 Bytes) [threats\_JJJ.csv](https://community.naturalcapitalalliance.org/uploads/short-url/gw2OSizMqVnAnO9xvvxxTujHtJk.csv) (268 Bytes)  
Dear jdouglass,  
\*\*I run the HQ, encounter the following problem, please see attached CSV and the log . could you please give me an email so I can provide the input data for your check, which is big to upload here.  
Regards,  
Su

---

<div class="post-metadata">

**Author:** ![dave](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dave/32/70_2.png) [@dave](https://community.naturalcapitalalliance.org/u/dave)\
**Post date:** [April 5, 2021, 1:58pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/18 "2021-04-05T13:58:19Z")

</div>

We’re addressing this new problem in a different thread. I’m closing this one so we don’t duplicate efforts.

---

<div class="post-metadata">

**Author:** ![dave](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dave/32/70_2.png) [@dave](https://community.naturalcapitalalliance.org/u/dave)\
**Post date:** [April 5, 2021, 1:58pm UTC](https://community.naturalcapitalalliance.org/t/habitat-q-error/431/19 "2021-04-05T13:58:26Z")

</div>

Closed on April 5, 2021, 1:58pm UTC


