# Habitat Quality IndexError: index 14 is out of bounds for axis 0 with size 14

**URL:** <https://community.naturalcapitalalliance.org/t/habitat-quality-indexerror-index-14-is-out-of-bounds-for-axis-0-with-size-14/860>\
**Category:** Software Support\
**Tags:** habitat-quality\
**Created:** [March 6, 2020, 3:28am UTC](https://community.naturalcapitalalliance.org/t/habitat-quality-indexerror-index-14-is-out-of-bounds-for-axis-0-with-size-14/860 "2020-03-06T03:28:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnRui2020](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@AnRui2020](https://community.naturalcapitalalliance.org/u/AnRui2020)\
**Post date:** [March 6, 2020, 3:28am UTC](https://community.naturalcapitalalliance.org/t/habitat-quality-indexerror-index-14-is-out-of-bounds-for-axis-0-with-size-14/860/1 "2020-03-06T03:28:29Z")

</div>

Dear partner,  
When I try to use Invest 3. 8. 0 with the Habitat quality index，something wrong come. Thank you very much. Running log is behind.

Initializing…

Showing messages with level INFO and higher

2020-03-06 11:16:13,466 utils.prepare\_workspace(115) INFO Writing log messages to G:/habitat\InVEST-Habitat-Quality-log-2020-03-06–11\_16\_13.txt

2020-03-06 11:16:13,476 model.\_logged\_target(1642) Level 100 Starting model with parameters:

Arguments for InVEST natcap.invest.habitat\_quality 3.8.0:

half\_saturation\_constant 0.5

lulc\_cur\_path G:/生境质量/landuse2015reclass.tif

n\_workers -1

results\_suffix

sensitivity\_table\_path G:/threatsnew/sensitivity.csv

threat\_raster\_folder G:/threatsnew

threats\_table\_path G:/threatsnew/threats.csv

workspace\_dir G:/habitat

2020-03-06 11:16:13,926 usage.\_log\_model(285) WARNING an exception encountered when logging TypeError(‘not a string’)

2020-03-06 11:16:14,716 habitat\_quality.execute(366) INFO Starting aligning and resizing land cover and threat rasters

2020-03-06 11:16:16,324 geoprocessing.align\_and\_resize\_raster\_stack(752) INFO 1 of 6 aligned: landuse2015reclass\_aligned.tif

2020-03-06 11:16:17,832 geoprocessing.align\_and\_resize\_raster\_stack(752) INFO 2 of 6 aligned: crop\_c\_aligned.tif

2020-03-06 11:16:19,363 geoprocessing.align\_and\_resize\_raster\_stack(752) INFO 3 of 6 aligned: wat\_c\_aligned.tif

2020-03-06 11:16:20,921 geoprocessing.align\_and\_resize\_raster\_stack(752) INFO 4 of 6 aligned: mine\_c\_aligned.tif

2020-03-06 11:16:22,493 geoprocessing.align\_and\_resize\_raster\_stack(752) INFO 5 of 6 aligned: ru\_c\_aligned.tif

2020-03-06 11:16:24,178 geoprocessing.align\_and\_resize\_raster\_stack(752) INFO 6 of 6 aligned: urb\_c\_aligned.tif

2020-03-06 11:16:24,178 geoprocessing.align\_and\_resize\_raster\_stack(754) INFO aligned all 6 rasters.

2020-03-06 11:16:24,178 habitat\_quality.execute(381) INFO Finished aligning and resizing land cover and threat rasters

2020-03-06 11:16:24,179 habitat\_quality.execute(402) INFO Preprocessing threat values for G:/habitat\intermediate\crop\_c\_aligned.tif

2020-03-06 11:16:25,594 habitat\_quality.execute(402) INFO Preprocessing threat values for G:/habitat\intermediate\wat\_c\_aligned.tif

2020-03-06 11:16:27,043 habitat\_quality.execute(402) INFO Preprocessing threat values for G:/habitat\intermediate\mine\_c\_aligned.tif

2020-03-06 11:16:28,584 habitat\_quality.execute(402) INFO Preprocessing threat values for G:/habitat\intermediate\ru\_c\_aligned.tif

2020-03-06 11:16:30,113 habitat\_quality.execute(402) INFO Preprocessing threat values for G:/habitat\intermediate\urb\_c\_aligned.tif

2020-03-06 11:16:31,947 habitat\_quality.execute(427) INFO Starting habitat\_quality biophysical calculations

2020-03-06 11:16:31,947 habitat\_quality.execute(434) INFO Handling Access Shape

2020-03-06 11:16:33,530 habitat\_quality.execute(447) INFO No Access Shape Provided, access raster filled with 1s.

2020-03-06 11:16:33,531 habitat\_quality.execute(459) INFO Calculating habitat quality for landuse: G:/habitat\intermediate\landuse2015reclass\_aligned.tif

2020-03-06 11:16:33,532 habitat\_quality.map\_raster\_to\_dict\_values(847) INFO Starting map\_raster\_to\_dict\_values

2020-03-06 11:16:33,618 geoprocessing.raster\_calculator(375) INFO starting stats\_worker

2020-03-06 11:16:33,622 geoprocessing.raster\_calculator(381) INFO started stats\_worker \<Thread(Thread-4, started daemon 16080)\>

2020-03-06 11:16:33,647 geoprocessing.raster\_calculator(486) INFO Waiting for raster stats worker result.

2020-03-06 11:16:33,648 threading.run(870) WARNING No valid pixels were received, sending None.

2020-03-06 11:16:33,649 model.\_logged\_target(1648) ERROR Exception while executing \<function execute at 0x0BA2D738\>

Traceback (most recent call last):

File “site-packages\natcap\invest\ui\model.py”, line 1645, in \_logged\_target

File “site-packages\natcap\invest\habitat\_quality.py”, line 466, in execute

File “site-packages\natcap\invest\habitat\_quality.py”, line 854, in map\_raster\_to\_dict\_values

File “site-packages\pygeoprocessing\geoprocessing.py”, line 1763, in reclassify\_raster

File “site-packages\pygeoprocessing\geoprocessing.py”, line 424, in raster\_calculator

File “site-packages\pygeoprocessing\geoprocessing.py”, line 1758, in \_map\_dataset\_to\_value\_op

IndexError: index 14 is out of bounds for axis 0 with size 14

2020-03-06 11:16:33,651 model.\_logged\_target(1651) INFO Execution finished

2020-03-06 11:16:33,658 utils.prepare\_workspace(121) INFO Elapsed time: 20.19s

2020-03-06 11:16:33,688 execution.run(78) ERROR Target \<function InVESTModel.execute\_model..\_logged\_target at 0x0CEB7B28\> failed with exception

Traceback (most recent call last):

File “site-packages\natcap\invest\ui\execution.py”, line 68, in run

File “site-packages\natcap\invest\ui\model.py”, line 1645, in \_logged\_target

File “site-packages\natcap\invest\habitat\_quality.py”, line 466, in execute

File “site-packages\natcap\invest\habitat\_quality.py”, line 854, in map\_raster\_to\_dict\_values

File “site-packages\pygeoprocessing\geoprocessing.py”, line 1763, in reclassify\_raster

File “site-packages\pygeoprocessing\geoprocessing.py”, line 424, in raster\_calculator

File “site-packages\pygeoprocessing\geoprocessing.py”, line 1758, in \_map\_dataset\_to\_value\_op

IndexError: index 14 is out of bounds for axis 0 with size 14

2020-03-06 11:16:33,690 execution.run(83) INFO Execution finished

2020-03-06 11:16:47,879 usage.\_log\_exit\_status(233) WARNING an exception encountered when \_log\_exit\_status Remote end closed connection without response

---

<div class="post-metadata">

**Author:** ![swolny](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/swolny/32/181_2.png) [@swolny](https://community.naturalcapitalalliance.org/u/swolny)\
**Post date:** [March 6, 2020, 3:29pm UTC](https://community.naturalcapitalalliance.org/t/habitat-quality-indexerror-index-14-is-out-of-bounds-for-axis-0-with-size-14/860/2 "2020-03-06T15:29:23Z")

</div>

Hi @AnRui2020 -

I see that you found another post that described a similar error. As noted there, please do make sure that your sensitivity table has rows and sensitivity data for all codes in your land use raster, and let us know if that helps.

~ Stacie

---

<div class="post-metadata">

**Author:** ![dcdenu4](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dcdenu4/32/544_2.png) [@dcdenu4](https://community.naturalcapitalalliance.org/u/dcdenu4)\
**Post date:** [March 6, 2020, 10:07pm UTC](https://community.naturalcapitalalliance.org/t/habitat-quality-indexerror-index-14-is-out-of-bounds-for-axis-0-with-size-14/860/3 "2020-03-06T22:07:35Z")

</div>

Hi @AnRui2020,

If this remains a problem, would it be possible to zip up your input files and share them with us so we could debug the issue on our end? A dropbox or google drive shared link usually works pretty well.

Best,

Doug
