Ucm KeyError "nan"


While driving the urban cooling model I had a key error “nan”. I was guessing it was a problem with the “no data” value of the LULC raster, but after changing it the error appeared again… any ideas? Log file attached: InVEST-Urban-Cooling-Model-log-2021-08-30–17_17_29.txt (3.3 KB)


Hi @carson , is it possible there are pixel values in the raster with no actual value - not even the nodata value? I’m not sure how this would appear in GIS, but maybe as NULL or NaN.

Here are some related topics:

If you can’t figure it out, please share your LULC raster and associated table and we can take a look.


I was trying to extract values from the raster to see if there is NA, NaN or NULL but couldn’t figure this out properly, so here is link to download the files: msc_ucm_files - Google Drive

thank you @dave in advance for all the support.

After reading properly the log I saw it was a problem with a values in the biophysical table. I don’t know exacly what was the problem but I had to rewrite the biophysical table values to a new csv file.

Thank you again

Glad you figured it out! I don’t have permission to view the files, but sounds like I don’t need to.

Yep! I was able to run the model properly

My bad! I think you now have access to the files. So if you want to check them out msc_ucm_files - Google Drive

Cool, thanks. In case other people come here with a similar problem, I’m guessing it’s the last line of the CSV that is the problem:

17;Private Arboreal;1;1;0.15;1;0
18;Private Scrub/Shrub;0.4;1;0.25;1;0
171;Public Arboreal;1;1;0.15;1;0
181;Public Scrub/Shrub;0.4;1;0.25;1;0
; ;;;;;

In particular the fact that there is a space character in one of those cells in the last line might prevent that line from being ignored, and it’s values end up loading as nan.

That’s my speculation since I haven’t tested this.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.