Habitat quality model - help about string and float...

Hello, 
This is my problem...
I don't understand in which file it does not recognize the decimal numbers (float)?
I checked the value column of my threat raster and these are decimal numbers...
Thank you for your response!

Initializing...

Showing messages with level INFO and higher

04/24/2018 11:24:07 natcap.invest.utils INFO Writing log messages to C:\Users\Elsa\Desktop\PostDoc\INVEST\Habitat_quality\InVEST-Habitat-Quality-log-2018-04-24--11_24_07.txt

04/24/2018 11:24:07 osgeo ERROR [errno 4] `C:\Users\Elsa\Desktop\PostDoc\INVEST\Habitat_quality\Input\Threat_raster' not recognised as a supported file format.

04/24/2018 11:24:07 natcap.invest.ui.usage._log_model WARNING an exception encountered when logging AttributeError("'NoneType' object has no attribute 'ExportToWkt'",)

04/24/2018 11:24:07 natcap.invest.ui.model Level 100 Starting model with parameters:

Arguments for InVEST natcap.invest.habitat_quality 3.4.2:

half_saturation_constant

landuse_cur_uri C:/Users/Elsa/Desktop/PostDoc/BiodiverCité/SIG/CLC/CLC12_D033_RGF_TIF/CLC12_D033_RGF.tif

results_suffix

sensitivity_uri C:/Users/Elsa/Desktop/PostDoc/INVEST/Habitat_quality/Input/sensitivity_samp_BM.csv

threat_raster_folder C:\Users\Elsa\Desktop\PostDoc\INVEST\Habitat_quality\Input\Threat_raster

threats_uri C:/Users/Elsa/Desktop/PostDoc/INVEST/Habitat_quality/Input/threats_samp_BM.csv

workspace_dir C:\Users\Elsa\Desktop\PostDoc\INVEST\Habitat_quality


04/24/2018 11:24:07 natcap.invest.ui.model ERROR Exception while executing <function execute at 0x0BA33B70>

Traceback (most recent call last):

File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\model.py", line 1504, in _logged_target

File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\habitat_quality.py", line 101, in execute

ValueError: could not convert string to float:

04/24/2018 11:24:07 natcap.invest.ui.model INFO Execution finished

04/24/2018 11:24:07 natcap.invest.utils INFO Elapsed time: 0.03s

04/24/2018 11:24:07 natcap.invest.ui.execution ERROR Target <function _logged_target at 0x026CCFB0> failed with exception

Traceback (most recent call last):

File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\execution.py", line 68, in run

File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\model.py", line 1504, in _logged_target

File "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\habitat_quality.py", line 101, in execute

ValueError: could not convert string to float:

04/24/2018 11:24:07 natcap.invest.ui.execution INFO Execution finished



Comments

  • swolnyswolny Member, NatCap Staff
    Hi @Elsa -

    Did you also check your sensitivity table, threat tables and your LULC raster? (I think that the LULC Value should be integer, but still, not a string.) 

    ~ Stacie
  • ElsaElsa Member
    Thank you Stacie,
    I think the problem comes from the fact that I use French software that does not convert float properly...
    Can I send you my files for verification on your behalf?
    Thank you!
  • ElsaElsa Member
    I tried with the default settings and it seems like the same error occurs. Would not there be a problem in the code?
  • swolnyswolny Member, NatCap Staff
    As you mentioned about French and floating point numbers, we have seen issues when floating point values use commas instead of periods for their separators. If yours use commas, can you try using periods? Another thing to try is setting your computer environment to English and use periods for decimal separators, and see if that helps. 

    You can also send me the .csv to check out: swolny at stanford.edu.

    ~ Stacie
  • swolnyswolny Member, NatCap Staff
    Elsa and I have been working on this offline, and in the end the problem seems to be that she did not enter a half-saturation constant into the model interface. The interface did not give an error that the input was required, but then gave these sorts of errors at runtime, which made it hard to troubleshoot. I know that the software team is working to bring back error-checking into the user interface, and here's another vote for that effort. 

    ~ Stacie
This discussion has been closed.