# Habitat Quality TypeError: ufunc 'isfinite'

**URL:** <https://community.naturalcapitalalliance.org/t/habitat-quality-typeerror-ufunc-isfinite/1168>\
**Category:** Software Support\
**Tags:** habitat-quality\
**Created:** [July 18, 2020, 9:53am UTC](https://community.naturalcapitalalliance.org/t/habitat-quality-typeerror-ufunc-isfinite/1168 "2020-07-18T09:53:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mag813](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@mag813](https://community.naturalcapitalalliance.org/u/mag813)\
**Post date:** [July 18, 2020, 9:53am UTC](https://community.naturalcapitalalliance.org/t/habitat-quality-typeerror-ufunc-isfinite/1168/1 "2020-07-18T09:53:18Z")

</div>

Hi everyone,

I am trying to run the ‘Habitat Quality’ model and an error occured. I am using InVEST 3.8.5 x86 on Win10. I have projected all the rasters into linear units and resampled them to the same resolution (maybe not neccesary), but I still got the error as presented in the log file. [InVEST-Habitat-Quality-log-2020-07-18–15\_49\_46.txt](https://community.naturalcapitalalliance.org/uploads/short-url/tQmtK2Olan1DIAoHPpDjoeqH1L2.txt) (3.4 KB)

Since I am using two rasters of “GDP” and “population”, with values ranging from 0-1 instead of binary rasters, I wonder if the error has something to do with it? I have successfully ran the model using all binary rasters with only 1s and 0s. I am not sure whether this model works for threat rasters with continous values. All the relevant files are uploaded for your information. Thanks.

> **[HQ.zip](https://drive.google.com/file/d/18Qt6JCIGBOGW64lPPJFAtuE1t5AVx_bD/view?usp=sharing)**
>
> Google Drive file.

---

<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:** [July 20, 2020, 11:50am UTC](https://community.naturalcapitalalliance.org/t/habitat-quality-typeerror-ufunc-isfinite/1168/2 "2020-07-20T11:50:11Z")

</div>

Hi @mag813,

Thanks for posting. Could you check and make sure that your threat rasters and LULC rasters have a defined nodata value? We’ve seen this error before when a threat raster had an undefined nodata value. See this forum post: [TypeError: ufunc 'isfinite' in HQ model](https://community.naturalcapitalalliance.org/t/typeerror-ufunc-isfinite-in-hq-model/874).

In the future we will handle undefined nodata values correctly. If this error still occurs let us know!

Doug
