Habitat Risk Assessment error

LuinilLuinil Member
edited January 2015 in Marine Models
Hello,

Please excuse my English, I am French and I will try my best to make it clear!

I am trying to run the habitat risk assessment model on InVEST 3 0 1 and I have got an error I can't solve. Running the preprocessor is OK but for the processor, it's written "IndexError encountered: List of index out of range"

Any idea of where my mistake can be?

Thanks in advance!

Comments

  • DougDoug Administrator, NatCap Staff
    Hi,

    That error could be relating to a few things. Is it possible that you could attach the output log generated by the model? That way we can get a more full and clear picture about where the error is being generated and how to handle it!

    Each model, after it runs, should generate a log file with a long name that includes the date and time. Let me know if you can't find it and/or post it!

    Doug
  • Hi Doug,

    Here is the log generated.

    Thanks for helping!
    Arguments:
    aoi_tables C:/InVEST_3_0_1_x86/HabitatRiskAssess/Input/subregions.shp
    csv_uri C:\InVEST_3_0_1_x86\HabitatRiskAssess\habitat_stressor_ratings_sample
    decay_eq None
    grid_size 500
    max_rating 3
    max_stress 10
    risk_eq Euclidean
    workspace_dir C:\InVEST_3_0_1_x86\HabitatRiskAssess


    01/15/2015 23:27:15 root INFO Logging will be saved to hra-log-2015-01-15--23_27_15.txt
    01/15/2015 23:27:15 root DEBUG Loaded the model from invest_natcap.habitat_risk_assessment.hra
    01/15/2015 23:27:15 root INFO Executing the loaded model
    01/15/2015 23:27:15 root INFO Running InVEST version "3.0.1"
    01/15/2015 23:27:15 root INFO Python architecture: ('32bit', 'WindowsPE')
    01/15/2015 23:27:15 root INFO Disk space remaining for workspace: 162.04 GB
    01/15/2015 23:27:18 root INFO Pointing temporary directory at the workspace at C:\InVEST_3_0_1_x86\HabitatRiskAssess
    01/15/2015 23:27:18 root INFO Updating os.environ["TMP"]=C:\Users\ADMINI~1\AppData\Local\Temp to C:\InVEST_3_0_1_x86\HabitatRiskAssess
    01/15/2015 23:27:18 root INFO Updating os.environ["TEMP"]=C:\Users\ADMINI~1\AppData\Local\Temp to C:\InVEST_3_0_1_x86\HabitatRiskAssess
    01/15/2015 23:27:18 root INFO Setting os.environ["TMPDIR"]=C:\InVEST_3_0_1_x86\HabitatRiskAssess
    01/15/2015 23:27:18 root INFO Starting hra
    01/15/2015 23:27:18 HRA_PREPROCESSOR DEBUG ['"PPH",1000']
    01/15/2015 23:27:18 root ERROR ---------------------------------------------------
    01/15/2015 23:27:18 root ERROR ---------------------- ERROR ----------------------
    01/15/2015 23:27:18 root ERROR ---------------------------------------------------
    01/15/2015 23:27:18 root ERROR Error: exception found while running hra
    01/15/2015 23:27:18 root DEBUG
    01/15/2015 23:27:18 root DEBUG Build details
    01/15/2015 23:27:18 root DEBUG System
    01/15/2015 23:27:18 root DEBUG OS : Windows-7-6.1.7601-SP1
    01/15/2015 23:27:18 root DEBUG Processor architecture: AMD64
    01/15/2015 23:27:18 root DEBUG FS encoding : mbcs
    01/15/2015 23:27:18 root DEBUG
    01/15/2015 23:27:18 root DEBUG Python
    01/15/2015 23:27:18 root DEBUG Version : 2.7.3
    01/15/2015 23:27:18 root DEBUG Build : ('default', 'Apr 10 2012 23:31:26')
    01/15/2015 23:27:18 root DEBUG Compiler : MSC v.1500 32 bit (Intel)
    01/15/2015 23:27:18 root DEBUG Implementation : CPython
    01/15/2015 23:27:18 root DEBUG Architecture : 32bit
    01/15/2015 23:27:18 root DEBUG Linkage format : WindowsPE
    01/15/2015 23:27:18 root DEBUG
    01/15/2015 23:27:18 root DEBUG Packages
    01/15/2015 23:27:18 root DEBUG Cython : 0.19.2
    01/15/2015 23:27:18 root DEBUG Numpy : 1.7.0
    01/15/2015 23:27:18 root DEBUG Scipy : 0.11.0
    01/15/2015 23:27:18 root DEBUG OSGEO : 1.10.1
    01/15/2015 23:27:18 root DEBUG Shapely : 1.2.18
    01/15/2015 23:27:18 root DEBUG InVEST : 3.0.1
    01/15/2015 23:27:18 root DEBUG
    01/15/2015 23:27:18 root DEBUG
    01/15/2015 23:27:18 root DEBUG Exception not environment-related
    01/15/2015 23:27:18 root DEBUG Printing traceback
    Traceback (most recent call last):
    File "invest_natcap\iui\executor.pyc", line 523, in runModel
    File "invest_natcap\habitat_risk_assessment\hra.pyc", line 224, in execute
    File "invest_natcap\habitat_risk_assessment\hra.pyc", line 972, in unpack_over_dict
    File "invest_natcap\habitat_risk_assessment\hra_preprocessor.pyc", line 536, in parse_hra_tables
    File "invest_natcap\habitat_risk_assessment\hra_preprocessor.pyc", line 954, in parse_stress_buffer
    IndexError: list index out of range
    None

    01/15/2015 23:27:18 root ERROR Exiting due to failures
    01/15/2015 23:27:18 root INFO Elapsed time: 4.88s
  • DougDoug Administrator, NatCap Staff
    We have done a little bit of work on HRA recently, fixing a few bugs, do you think you could download the latest and greatest version of InVEST here:

    http://data.naturalcapitalandresilienceplatform.org/nightly-build/InVEST_dev164_3_1_0b1 [1be79e9bd900]_x86_Setup.exe

    And give it another run? If the same issue appears, could you re-post the error log you get? Thanks for your patience and helping us debug these issues!

    Cheers,

    Doug

  • Hi Doug,

    I have tried again and I have got the same error. Here is the log


  • LuinilLuinil Member
    edited January 2015
    Hi Doug,

    I have removed all the quotation marks in my files and finally I have got a new error!

    DatasetUnprojected encountered
    Post edited by Luinil on
  • DougDoug Administrator, NatCap Staff
    Glad we're making progress! One error down, hopefully only one more to go!

    Do you think you could post the log with the new, DatasetUnprojected, error?

    The model calls for all the Stressor Layers and Habitat/Species Layers to be projected in the same projection. Can you check to make sure all your layers are projected?

    Also, it would be great to know where you had quotes and where you removed them to get it to work. Maybe we can add some checking or logic to produce a better error message if someone does it in the future.

    Thanks!
  • LuinilLuinil Member
    edited January 2015
    Hi Doug,

    I have succeeded in making HRA run! Thank you for all your advice. To make it run, I have changed the projection of the shapefiles in lambert IV but with that the processor stops responding and closes (windows error). Then I have changed all the projections for WSG 84 UTM 32N, and it worked.

    About the quotes, at the begining I have created all the csv files like the eelgrass example, I had a string or comma error, so I added quotes (the double ones > ") around each strings, then I had the index error, I started to remove the quotes in the buffer csv, but it didn't work then I removed it in the habitat csv and it worked.

    I have got one more question, I don't really understand what is the subregion shape. For now, I have just drawn 3 big potatoes but not sure it's good.

    Let me now if I can help sending some error log!

    Thanks!

    Post edited by Luinil on
  • DougDoug Administrator, NatCap Staff
    Excellent! Glad to hear you've got it running.

    I'll try and get one of our HRA developers to answer the question on the subregion shape. I also might post it to a new question to keep threads clean! I'll keep you posted.

    Thanks!
  • LuinilLuinil Member
    edited February 2015
    Hi Doug,

    Thank you for the other discussion. I have got another question, do you know the difference between the files in the habitat_stressor_ratings_sample folder and habitat_stressor_ratings_sample_spatial forlder? Currently, it's the same files.
    Moreover, after the preprocessor run, there is the creation of a new folder and new files, do we have to change something in these files?

    Thanks so much, I won't forget to acknowledge you in my report!
    Post edited by Luinil on
  • DougDoug Administrator, NatCap Staff
    Hi,

    I'm not certain I'm the best to clarify and answer that question. But I just made a new thread with your question and tagged a few of our team members who own that model. Hopefully they get back soon, here's the new question!

This discussion has been closed.