Habitat Quality Model - KeyError: 'HABITAT'

chiararikchiararik Member
edited April 11 in Terrestrial Models
Hi,

I'm trying to run the Habitat Quality model, but it returns an error message and I can't understand where is the mistake.
Here there is the log message:

Initializing...

04/11/2017 12:58:05 root DEBUG Loading <module 'natcap.invest.habitat_quality' from 'C:\INVEST~1.2_X\INVEST~1\natcap\invest\habitat_quality.pyc'> in frozen environment

Arguments:

access_uri C:/Users/chiar/Desktop/Qgis tesi/Progetto tesi/InVEST model/Aree protette/aree_prot.shp

half_saturation_constant 0.5

landuse_cur_uri G:/Uni/BD3 2017/BD3 2017/InVEST/input/bd3.tif

sensitivity_uri G:/Uni/BD3 2017/BD3 2017/InVEST/input/Sensitivity.csv

threat_raster_folder G:\Uni\BD3 2017\BD3 2017\InVEST\input

threats_uri G:/Uni/BD3 2017/BD3 2017/InVEST/input/Threats.csv

workspace_dir G:\Uni\BD3 2017\BD3 2017\InVEST



04/11/2017 12:58:05 root INFO Logging will be saved to natcap.invest.habitat_quality-log-2017-04-11--12_58_05.txt

04/11/2017 12:58:05 root DEBUG Loaded the model from natcap.invest.habitat_quality

04/11/2017 12:58:05 root INFO Executing the loaded model

04/11/2017 12:58:05 root INFO Running InVEST version "3.3.2"

04/11/2017 12:58:05 root INFO Python architecture: ('32bit', 'WindowsPE')

04/11/2017 12:58:05 root INFO Disk space remaining for workspace: 142.99 GB

04/11/2017 12:58:05 root INFO Pointing temporary directory at the workspace at G:\Uni\BD3 2017\BD3 2017\InVEST

04/11/2017 12:58:06 root INFO Updating os.environ["TMP"]=G:\Uni\BD3 2017\BD3 2017\InVEST\tmp to G:\Uni\BD3 2017\BD3 2017\InVEST

04/11/2017 12:58:06 root INFO Updating os.environ["TEMP"]=G:\Uni\BD3 2017\BD3 2017\InVEST\tmp to G:\Uni\BD3 2017\BD3 2017\InVEST

04/11/2017 12:58:06 root INFO Updating os.environ["TMPDIR"]=G:\Uni\BD3 2017\BD3 2017\InVEST\tmp to G:\Uni\BD3 2017\BD3 2017\InVEST

04/11/2017 12:58:06 root INFO Setting tempfile.tempdir to G:\Uni\BD3 2017\BD3 2017\InVEST\tmp

04/11/2017 12:58:06 root INFO Starting natcap.invest.habitat_quality

04/11/2017 12:58:06 natcap.invest.habitat_quality DEBUG Starting habitat_quality biophysical calculations

04/11/2017 12:58:06 natcap.invest.habitat_quality DEBUG Handling Access Shape

04/11/2017 12:58:06 natcap.invest.habitat_quality DEBUG landuse_uri_dict : {'_c': u'G:/Uni/BD3 2017/BD3 2017/InVEST/input/bd3.tif'}

04/11/2017 12:58:06 natcap.invest.habitat_quality DEBUG Calculating results for landuse : _c

04/11/2017 12:58:06 natcap.invest.habitat_quality DEBUG Starting map_raster_to_dict_values

04/11/2017 12:58:06 root ERROR ---------------------------------------------------

04/11/2017 12:58:06 root ERROR ---------------------- ERROR ----------------------

04/11/2017 12:58:06 root ERROR ---------------------------------------------------

04/11/2017 12:58:06 root ERROR Error: exception found while running natcap.invest.habitat_quality

04/11/2017 12:58:06 root DEBUG

04/11/2017 12:58:06 root DEBUG Build details

04/11/2017 12:58:06 root DEBUG Interpreter

04/11/2017 12:58:06 root DEBUG Current temp dir: G:\Uni\BD3 2017\BD3 2017\InVEST\tmp

04/11/2017 12:58:06 root DEBUG tempfile.tempdir: G:\Uni\BD3 2017\BD3 2017\InVEST\tmp

04/11/2017 12:58:06 root DEBUG

04/11/2017 12:58:06 root DEBUG System

04/11/2017 12:58:06 root DEBUG OS : Windows-8-6.2.9200

04/11/2017 12:58:06 root DEBUG Processor architecture: AMD64

04/11/2017 12:58:06 root DEBUG FS encoding : mbcs

04/11/2017 12:58:06 root DEBUG Preferred encoding: cp1252

04/11/2017 12:58:06 root DEBUG

04/11/2017 12:58:06 root DEBUG Python

04/11/2017 12:58:06 root DEBUG Version : 2.7.9

04/11/2017 12:58:06 root DEBUG Build : ('default', 'Dec 10 2014 12:24:55')

04/11/2017 12:58:06 root DEBUG Compiler : MSC v.1500 32 bit (Intel)

04/11/2017 12:58:06 root DEBUG Implementation : CPython

04/11/2017 12:58:06 root DEBUG Architecture : 32bit

04/11/2017 12:58:06 root DEBUG Linkage format : WindowsPE

04/11/2017 12:58:06 root DEBUG

04/11/2017 12:58:06 root DEBUG Packages

04/11/2017 12:58:06 root DEBUG Cython : ?

04/11/2017 12:58:06 root DEBUG Numpy : 1.11.2rc1

04/11/2017 12:58:06 root DEBUG Scipy : 0.16.1

04/11/2017 12:58:06 root DEBUG OSGEO : 1.11.3

04/11/2017 12:58:06 root DEBUG Shapely : 1.5.5

04/11/2017 12:58:06 root DEBUG InVEST : 3.3.2

04/11/2017 12:58:06 root DEBUG

04/11/2017 12:58:06 root DEBUG

04/11/2017 12:58:06 root DEBUG Exception not environment-related

04/11/2017 12:58:06 root DEBUG Printing traceback

Traceback (most recent call last):

File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\natcap.invest.iui.executor", line 560, in runModel

File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\natcap.invest.habitat_quality", line 192, in execute

File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\natcap.invest.habitat_quality", line 569, in map_raster_to_dict_values

KeyError: 'HABITAT'


04/11/2017 12:58:06 root ERROR Exiting due to failures



Thanks for the help!


Post edited by chiararik on

Comments

  • jdouglassjdouglass Administrator, NatCap Staff
    Hello,  the error is saying that the model is expecting a column labeled "HABITAT" in your sensitivity table.  Is it possible that there's an extra space sneaking in after "HABITAT"?  If that doesn't make sense, could you send your inputs to jdouglass@stanford.edu so I can take a look?
  • Hello,
    thank you very much for your help! Yes, there was an error in typing that column name,
    after naming it correctly it worked properly,

    Thank you again!
This discussion has been closed.