This forum is shutting down! Please post new discussions at community.naturalcapitalproject.org

Crop Pollination ValueError: bins must be monotonically increasing or decreasing

I'm currently using InVEST Version 3.3.0 (32bit). I have my land use/land cover raster map and CSV files on land use attribute and pollinators. I keep getting this error regarding bins. Below is the transcript:

Initializing...

04/20/2016 23:10:35 root DEBUG Loading <module 'natcap.invest.pollination.pollination' from 'C:\INVEST~1.0_X\INVEST~1\natcap\invest\pollination\pollination.pyc'> in frozen environment

Arguments:

ag_classes

do_valuation False

guilds_uri D:/20150921 Map/March Map/Final/pollinator_species.csv

half_saturation 0.125

landuse_attributes_uri D:/20150921 Map/March Map/Final/landcover_attributes.csv

landuse_cur_uri D:/20150921 Map/March Map/Final/lulc_guimarasb.img

results_suffix

wild_pollination_proportion 1.0

workspace_dir C:\Users\Flying/Documents/pollination_workspace



04/20/2016 23:10:35 root INFO Logging will be saved to natcap.invest.pollination.pollination-log-2016-04-20--23_10_35.txt

04/20/2016 23:10:35 root DEBUG Loaded the model from natcap.invest.pollination.pollination

04/20/2016 23:10:35 root INFO Executing the loaded model

04/20/2016 23:10:35 root INFO Running InVEST version "3.3.0"

04/20/2016 23:10:35 root INFO Python architecture: ('32bit', 'WindowsPE')

04/20/2016 23:10:35 root INFO Disk space remaining for workspace: 180.28 GB

04/20/2016 23:10:35 root INFO Pointing temporary directory at the workspace at C:\Users\Flying/Documents/pollination_workspace

04/20/2016 23:10:36 root INFO Updating os.environ["TMP"]=C:\Users\Flying\AppData\Local\Temp to C:\Users\Flying/Documents/pollination_workspace

04/20/2016 23:10:36 root INFO Updating os.environ["TEMP"]=C:\Users\Flying\AppData\Local\Temp to C:\Users\Flying/Documents/pollination_workspace

04/20/2016 23:10:36 root INFO Setting os.environ["TMPDIR"]=C:\Users\Flying/Documents/pollination_workspace

04/20/2016 23:10:36 root INFO Setting tempfile.tempdir to C:\Users\Flying/Documents/pollination_workspace\tmp

04/20/2016 23:10:36 root INFO Starting natcap.invest.pollination.pollination

04/20/2016 23:10:36 natcap.invest.pollination.pollination INFO Starting pollination model for the cur scenario

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG Opening landuse raster from D:/20150921 Map/March Map/Final/lulc_guimarasb.img

04/20/2016 23:10:36 natcap.invest.pollination.pollination INFO Opening landuse attributes table

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG Parsed nesting fields: ['cavity', 'ground']

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG Parsed floral fields: ['allyear']

04/20/2016 23:10:36 natcap.invest.pollination.pollination INFO Opening guilds table

04/20/2016 23:10:36 natcap.invest.pollination.pollination INFO Processing agricultural classes

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG Parsed ag classes: []

04/20/2016 23:10:36 natcap.invest.pollination.pollination INFO Creating top-level raster URIs

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG foraging_total: C:\Users\Flying/Documents/pollination_workspace\output\frm_tot_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG foraging_average: C:\Users\Flying/Documents/pollination_workspace\output\frm_avg_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG farm_value_sum: C:\Users\Flying/Documents/pollination_workspace\intermediate\frm_val_sum_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG service_value_sum: C:\Users\Flying/Documents/pollination_workspace\output\sup_val_sum_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG abundance_total: C:\Users\Flying/Documents/pollination_workspace\output\sup_tot_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG ag_map: C:\Users\Flying/Documents/pollination_workspace\intermediate\agmap_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination INFO Creating species-specific raster URIs

04/20/2016 23:10:36 natcap.invest.pollination.pollination INFO Creating rasters for Apis dorsata

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG nesting: C:\Users\Flying/Documents/pollination_workspace\intermediate\hn_Apis dorsata_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG floral: C:\Users\Flying/Documents/pollination_workspace\intermediate\hf_Apis dorsata_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG species_abundance: C:\Users\Flying/Documents/pollination_workspace\intermediate\sup_Apis dorsata_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG farm_abundance: C:\Users\Flying/Documents/pollination_workspace\intermediate\frm_Apis dorsata_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG farm_value: C:\Users\Flying/Documents/pollination_workspace\intermediate\frm_val_Apis dorsata_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG value_abundance_ratio: C:\Users\Flying/Documents/pollination_workspace\intermediate\val_sup_ratio_Apis dorsata_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG value_abundance_ratio_blur: C:\Users\Flying/Documents/pollination_workspace\intermediate\val_sup_ratio_blur_Apis dorsata_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG service_value: C:\Users\Flying/Documents/pollination_workspace\intermediate\sup_val_Apis dorsata_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination INFO Creating rasters for Apis cerana

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG nesting: C:\Users\Flying/Documents/pollination_workspace\intermediate\hn_Apis cerana_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG floral: C:\Users\Flying/Documents/pollination_workspace\intermediate\hf_Apis cerana_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG species_abundance: C:\Users\Flying/Documents/pollination_workspace\intermediate\sup_Apis cerana_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG farm_abundance: C:\Users\Flying/Documents/pollination_workspace\intermediate\frm_Apis cerana_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG farm_value: C:\Users\Flying/Documents/pollination_workspace\intermediate\frm_val_Apis cerana_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG value_abundance_ratio: C:\Users\Flying/Documents/pollination_workspace\intermediate\val_sup_ratio_Apis cerana_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG value_abundance_ratio_blur: C:\Users\Flying/Documents/pollination_workspace\intermediate\val_sup_ratio_blur_Apis cerana_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG service_value: C:\Users\Flying/Documents/pollination_workspace\intermediate\sup_val_Apis cerana_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination INFO Creating rasters for Tetragonula biroi

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG nesting: C:\Users\Flying/Documents/pollination_workspace\intermediate\hn_Tetragonula biroi_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG floral: C:\Users\Flying/Documents/pollination_workspace\intermediate\hf_Tetragonula biroi_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG species_abundance: C:\Users\Flying/Documents/pollination_workspace\intermediate\sup_Tetragonula biroi_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG farm_abundance: C:\Users\Flying/Documents/pollination_workspace\intermediate\frm_Tetragonula biroi_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG farm_value: C:\Users\Flying/Documents/pollination_workspace\intermediate\frm_val_Tetragonula biroi_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG value_abundance_ratio: C:\Users\Flying/Documents/pollination_workspace\intermediate\val_sup_ratio_Tetragonula biroi_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG value_abundance_ratio_blur: C:\Users\Flying/Documents/pollination_workspace\intermediate\val_sup_ratio_blur_Tetragonula biroi_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.pollination DEBUG service_value: C:\Users\Flying/Documents/pollination_workspace\intermediate\sup_val_Tetragonula biroi_cur.tif

04/20/2016 23:10:36 natcap.invest.pollination.core DEBUG Starting pollination calculations

04/20/2016 23:10:36 natcap.invest.pollination.core DEBUG Using nodata value of -1.0 for internal rasters

04/20/2016 23:10:36 natcap.invest.pollination.core INFO Starting to create an ag raster at C:\Users\Flying/Documents/pollination_workspace\intermediate\agmap_cur.tif. Nodata=-1.0

04/20/2016 23:10:36 natcap.invest.pollination.core DEBUG Agricultural reclass map={0.0: 1.0, 1.0: 1.0, 2.0: 1.0, 3.0: 1.0, 4.0: 1.0, 5.0: 1.0, 7.0: 1.0, 8.0: 1.0, 9.0: 1.0, 10.0: 1.0, 11.0: 1.0, 12.0: 1.0, 13.0: 1.0, 14.0: 1.0, 15.0: 1.0, 16.0: 1.0, 17.0: 1.0, 18.0: 1.0, 19.0: 1.0, 20.0: 1.0, 21.0: 1.0, 22.0: 1.0, 23.0: 1.0, 24.0: 1.0, 25.0: 1.0, 26.0: 1.0, 27.0: 1.0, 28.0: 1.0, 29.0: 1.0}

04/20/2016 23:10:36 pygeoprocessing.geoprocessing WARNING Warning the nodata value in D:/20150921 Map/March Map/Final/lulc_guimarasb.img is not set

04/20/2016 23:10:36 pygeoprocessing.geoprocessing WARNING

Items are not equal to 7 significant digits:

ACTUAL: 15.00065811593588

DESIRED: 14.997972987492414

04/20/2016 23:10:36 root ERROR ---------------------------------------------------

04/20/2016 23:10:36 root ERROR ---------------------- ERROR ----------------------

04/20/2016 23:10:36 root ERROR ---------------------------------------------------

04/20/2016 23:10:36 root ERROR Error: exception found while running natcap.invest.pollination.pollination

04/20/2016 23:10:36 root DEBUG

04/20/2016 23:10:36 root DEBUG Build details

04/20/2016 23:10:36 root DEBUG Interpreter

04/20/2016 23:10:36 root DEBUG Current temp dir: C:\Users\Flying/Documents/pollination_workspace\tmp

04/20/2016 23:10:36 root DEBUG tempfile.tempdir: C:\Users\Flying/Documents/pollination_workspace\tmp

04/20/2016 23:10:36 root DEBUG

04/20/2016 23:10:36 root DEBUG System

04/20/2016 23:10:36 root DEBUG OS : Windows-8-6.2.9200

04/20/2016 23:10:36 root DEBUG Processor architecture: AMD64

04/20/2016 23:10:36 root DEBUG FS encoding : mbcs

04/20/2016 23:10:36 root DEBUG Preferred encoding: cp1252

04/20/2016 23:10:36 root DEBUG

04/20/2016 23:10:36 root DEBUG Python

04/20/2016 23:10:36 root DEBUG Version : 2.7.9

04/20/2016 23:10:36 root DEBUG Build : ('default', 'Dec 10 2014 12:24:55')

04/20/2016 23:10:36 root DEBUG Compiler : MSC v.1500 32 bit (Intel)

04/20/2016 23:10:36 root DEBUG Implementation : CPython

04/20/2016 23:10:36 root DEBUG Architecture : 32bit

04/20/2016 23:10:36 root DEBUG Linkage format : WindowsPE

04/20/2016 23:10:36 root DEBUG

04/20/2016 23:10:36 root DEBUG Packages

04/20/2016 23:10:36 root DEBUG Cython : ?

04/20/2016 23:10:36 root DEBUG Numpy : 1.10.2rc1

04/20/2016 23:10:36 root DEBUG Scipy : 0.16.0b2

04/20/2016 23:10:36 root DEBUG OSGEO : 1.11.3

04/20/2016 23:10:36 root DEBUG Shapely : 1.5.5

04/20/2016 23:10:36 root DEBUG InVEST : 3.3.0

04/20/2016 23:10:36 root DEBUG

04/20/2016 23:10:36 root DEBUG

04/20/2016 23:10:36 root DEBUG Exception not environment-related

04/20/2016 23:10:36 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.pollination.pollination", line 248, in execute

File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\natcap.invest.pollination.pollination_core", line 73, in execute_model

File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\natcap.invest.pollination.pollination_core", line 364, in reclass_ag_raster

File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\pygeoprocessing.geoprocessing", line 1623, in reclassify_dataset_uri

File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\pygeoprocessing.geoprocessing", line 2410, in vectorize_datasets

File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\pygeoprocessing.geoprocessing", line 1614, in map_dataset_to_value

ValueError: bins must be monotonically increasing or decreasing



04/20/2016 23:10:37 root ERROR Exiting due to failures


---------------


I hope someone could help me with this. Thanks.

Comments

  • jdouglassjdouglass Administrator, NatCap Staff
    Hi @WSSHolmes, this looks really interesting ... could you send your data stack to jdouglass@stanford.edu so I can take a look?

    Thanks,
    James
  • Done. Hope we could figure this out. Thank you.
  • jdouglassjdouglass Administrator, NatCap Staff
    Hi @WSSHolmes, having taken a look at the data you sent me (thanks for that, by the way!), it looks like this issue is happening because the LULC raster does not have a nodata value defined, causing some unexpected behavior in the reclassification.  A workaround for the time being would be to define a nodata value in the raster.

    This definitely is a bug in our reclassification, though, so we'll fix it on our end and release it with the next version of InVEST.  Here's a link to the issue, as we're working on it.
  • When I first run the program, that was the error identified: nodata value defined. I addressed that in ERDAS Imagine using this: https://www.researchgate.net/post/How_can_I_change_0_value_pixels_to_NoValue_in_Erdas_Imagine

    Afterwards, I ended up with the ValueError: bins must be monotonically increasing or decreasing.

    Hope the bug gets fixed soon. Thank you for your help.
  • jdouglassjdouglass Administrator, NatCap Staff
    Hi @WSSHolmes, thanks for sending your inputs.  So, it looks like your raster does not have a nodata value set, which is causing the error.  Based on the values of the raster, it looks like the value of 0 is supposed to represent pixels that do not have a value, so running this GDAL command:

    $ gdal_translate -of HSA -a_nodata 0 lulc_guimarasb.img lulc_guimarasb_nodata.img

    allows the model to continue.  I'm sending you the revised raster, and you'll see that the raster now does have a nodata value set to 0.
  • Hi @jdouglass, thank you for the revised raster. I tried running the model again, and there was a different error this time as you can see in the screenshot attached.
    1920 x 1080 - 106K
  • RichRich Administrator, NatCap Staff
    Hi @WSSHolmes, is it possible the "landcover_attributes.csv" table is missing the landcover codes mentioned in the error message?
  • TAIAPFTAIAPF Member
    edited September 2016
    Hello

    Mabe I am facing the same problem.
    I am runnig the SDR model Invest 3.3.1.

    Could you help?
    Thanks in advance

    Arguments:

    biophysical_table_path     
    C:/Users/N/Dropbox/DOUTORADO/TESE/Dados_Georreferenciados/PRH_PARANAIBA_OUTPUT_DADOS/BUILD/INPUT/Uso_Solo/Biophysical_table.csv

    dem_path                   
    C:/Users/N/Dropbox/DOUTORADO/TESE/Dados_Georreferenciados/PRH_PARANAIBA_OUTPUT_DADOS/BUILD/OUTPUT/DEM_PrepDEM_Invest/Output/dem_prep.tif

    drainage_path              

    erodibility_path            C:/Users/N/Dropbox/DOUTORADO/TESE/Dados_Georreferenciados/PRH_PARANAIBA_OUTPUT_DADOS/BUILD/Teste_novaprojecao/solo.tif

    erosivity_path             
    C:/Users/N/Dropbox/DOUTORADO/TESE/Dados_Georreferenciados/PRH_PARANAIBA_OUTPUT_DADOS/BUILD/OUTPUT/Erosividade_R/erosividade_SAD69.tif

    ic_0_param                  0.5

    k_param                     2

    lulc_path                  
    C:/Users/N/Dropbox/DOUTORADO/TESE/Dados_Georreferenciados/PRH_PARANAIBA_OUTPUT_DADOS/BUILD/Teste_novaprojecao/landuse.tif

    results_suffix              sdr_5

    sdr_max                     1

    threshold_flow_accumulation
    5000

    watersheds_path            
    C:/Users/N/Dropbox/DOUTORADO/TESE/Dados_Georreferenciados/PRH_PARANAIBA_OUTPUT_DADOS/BUILD/OUTPUT/Watershed_deliniation/Watershedcorumba.shp

    workspace_dir               C:\Users\N\Desktop\SDR_run5

     

     

    09/27/2016
    12:51:48  root               INFO     Logging will be saved to
    natcap.invest.sdr-log-2016-09-27--12_51_48.txt

    09/27/2016
    12:51:48  root               DEBUG    Loaded the model from natcap.invest.sdr

    09/27/2016
    12:51:48  root               INFO     Executing the loaded model

    09/27/2016
    12:51:48  root               INFO     Running InVEST version "3.3.1"

    09/27/2016
    12:51:48  root               INFO     Python architecture: ('32bit',
    'WindowsPE')

    09/27/2016
    12:51:48  root               INFO    
    Disk space remaining for workspace: 269.21 GB

    09/27/2016
    12:51:48  root               INFO     Pointing temporary directory at the
    workspace at C:\Users\N\Desktop\SDR_run5

    09/27/2016
    12:51:48  root               INFO     Updating os.environ["TMP"]=C:\Users\N\AppData\Local\Temp
    to C:\Users\N\Desktop\SDR_run5

    09/27/2016
    12:51:48  root               INFO     Updating
    os.environ["TEMP"]=C:\Users\N\AppData\Local\Temp to
    C:\Users\N\Desktop\SDR_run5

    09/27/2016
    12:51:48  root               INFO     Setting
    os.environ["TMPDIR"]=C:\Users\N\Desktop\SDR_run5

    09/27/2016
    12:51:48  root               INFO     Setting tempfile.tempdir to
    C:\Users\N\Desktop\SDR_run5\tmp

    09/27/2016
    12:51:48  root               INFO     Starting natcap.invest.sdr

    09/27/2016
    12:51:49  pygeoprocessing.geoprocessing
    WARNING 

    Items are
    not equal to 7 significant digits:

     ACTUAL: 29.399999999999984

     DESIRED: 30.80000000000001

    09/27/2016
    12:52:04  pygeoprocessing.geoprocessing
    INFO     ReprojectImage 50.0% complete
    C:\Users\N\Desktop\SDR_run5\aligned_erosivity_sdr_5.tif, psz_message

    09/27/2016
    12:52:04  pygeoprocessing.geoprocessing
    INFO     ReprojectImage 100.0% complete
    C:\Users\N\Desktop\SDR_run5\aligned_erosivity_sdr_5.tif, psz_message

    09/27/2016
    12:52:04  pygeoprocessing.geoprocessing
    INFO     align_dataset_list aligning
    dataset 3 of 4

    09/27/2016
    12:52:06  natcap.invest.sdr  INFO    
    calculating slope

    09/27/2016
    12:52:08  natcap.invest.sdr  INFO    
    calculating flow direction

    09/27/2016
    12:52:14 
    pygeoprocessing.routing.routing_core INFO     flow_direction_inf 93.8% complete

    09/27/2016
    12:52:16 
    pygeoprocessing.routing.routing_core INFO     labeling flats

    09/27/2016
    12:52:16 
    pygeoprocessing.routing.routing_core INFO     draining away from higher

    09/27/2016
    12:52:16  pygeoprocessing.routing.routing_core
    INFO     draining towards lower

    09/27/2016
    12:52:17  pygeoprocessing.routing
    DEBUG    flats exist, calculating flow
    direction for them

    09/27/2016
    12:52:18 
    pygeoprocessing.routing.routing_core INFO     labeling flats

    09/27/2016
    12:52:18 
    pygeoprocessing.routing.routing_core INFO     draining away from higher

    09/27/2016
    12:52:18 
    pygeoprocessing.routing.routing_core INFO     draining towards lower

    09/27/2016
    12:52:18  pygeoprocessing.routing
    INFO     flats exist on second pass, must
    be flat areas that abut the raster edge

    09/27/2016
    12:52:19  natcap.invest.sdr  INFO    
    calculating flow accumulation

    09/27/2016
    12:52:19  pygeoprocessing.routing
    DEBUG    starting flow accumulation

    09/27/2016
    12:52:26  natcap.invest.sdr  INFO    
    calculate ls term

    C:\PROGRA~2\INVEST~1.1_X\INVEST~1\natcap\invest\sdr.py:368:
    RuntimeWarning: invalid value encountered in power

    C:\PROGRA~2\INVEST~1.1_X\INVEST~1\natcap\invest\sdr.py:378:
    RuntimeWarning: invalid value encountered in power

    C:\PROGRA~2\INVEST~1.1_X\INVEST~1\natcap\invest\sdr.py:379:
    RuntimeWarning: invalid value encountered in power

    C:\PROGRA~2\INVEST~1.1_X\INVEST~1\natcap\invest\sdr.py:384:
    RuntimeWarning: invalid value encountered in greater

    09/27/2016
    12:52:29  natcap.invest.sdr  INFO    
    classifying streams from flow accumulation raster

    09/27/2016
    12:52:30  natcap.invest.sdr  INFO    
    calculate per pixel W

    09/27/2016
    12:52:30  root               ERROR   
    ---------------------------------------------------

    09/27/2016
    12:52:30  root               ERROR    ---------------------- ERROR
    ----------------------

    09/27/2016
    12:52:30  root               ERROR   
    ---------------------------------------------------

    09/27/2016
    12:52:30  root               ERROR    Error: exception found while running
    natcap.invest.sdr

    09/27/2016
    12:52:30  root               DEBUG   

    09/27/2016
    12:52:30  root               DEBUG    Build details

    09/27/2016
    12:52:30  root               DEBUG    Interpreter

    09/27/2016
    12:52:30  root               DEBUG    Current temp dir: C:\Users\N\Desktop\SDR_run5\tmp

    09/27/2016
    12:52:30  root               DEBUG    tempfile.tempdir:
    C:\Users\N\Desktop\SDR_run5\tmp

    09/27/2016
    12:52:30  root               DEBUG   

    09/27/2016
    12:52:30  root               DEBUG    System

    09/27/2016
    12:52:30  root               DEBUG    OS              : Windows-7-6.1.7600-SP1

    09/27/2016
    12:52:30  root               DEBUG    Processor architecture: AMD64

    09/27/2016
    12:52:30  root               DEBUG    FS encoding     : mbcs

    09/27/2016
    12:52:30  root               DEBUG    Preferred encoding: cp1252

    09/27/2016
    12:52:30  root               DEBUG   

    09/27/2016
    12:52:30  root               DEBUG    Python

    09/27/2016
    12:52:30  root               DEBUG    Version         : 2.7.9

    09/27/2016
    12:52:30  root               DEBUG    Build           : ('default', 'Dec 10 2014
    12:24:55')

    09/27/2016
    12:52:30  root               DEBUG    Compiler        : MSC v.1500 32 bit (Intel)

    09/27/2016
    12:52:30  root               DEBUG    Implementation  : CPython

    09/27/2016
    12:52:30  root               DEBUG    Architecture    : 32bit

    09/27/2016
    12:52:30  root               DEBUG    Linkage format  : WindowsPE

    09/27/2016
    12:52:30  root               DEBUG   

    09/27/2016
    12:52:30  root               DEBUG    Packages

    09/27/2016
    12:52:30  root               DEBUG    Cython          : ?

    09/27/2016
    12:52:30  root               DEBUG    Numpy           : 1.11.0

    09/27/2016
    12:52:30  root               DEBUG    Scipy           : 0.16.0b2

    09/27/2016
    12:52:30  root               DEBUG    OSGEO           : 1.11.3

    09/27/2016
    12:52:30  root               DEBUG    Shapely         : 1.5.5

    09/27/2016
    12:52:30  root               DEBUG    InVEST          : 3.3.1

    09/27/2016
    12:52:30  root               DEBUG   

    09/27/2016
    12:52:30  root               DEBUG   

    09/27/2016
    12:52:30  root               DEBUG    Exception not environment-related

    09/27/2016
    12:52:30  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.sdr",
    line 201, in execute

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

      File
    "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\pygeoprocessing.geoprocessing",
    line 1625, in reclassify_dataset_uri

      File
    "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\pygeoprocessing.geoprocessing",
    line 2412, in vectorize_datasets

      File
    "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\pygeoprocessing.geoprocessing",
    line 1615, in map_dataset_to_value

    ValueError:
    There was not a value for at least the following codes [ 4.  4.  4.]
    for this file C:\Users\N\Desktop\SDR_run5\aligned_lulc_sdr_5.tif.

    Nodata value
    is: -1.7e+308

     

     

    09/27/2016
    12:52:30  root               ERROR    Exiting due to failures

    09/27/2016 12:52:30  root               INFO     Elapsed time: 42.07s

     

     

    Post edited by TAIAPF on
  • jdouglassjdouglass Administrator, NatCap Staff
    hi @TAIAPF, it looks like there might be something strange going on in your biophysical table.  Could you dropbox your data stack to jdouglass@stanford.edu so I might take a look?
  • RichRich Administrator, NatCap Staff
    Hi @TAIAPF, is it possible the "landcover_attributes.csv" table is missing an entry for landcover code 4?
  • TAIAPFTAIAPF Member
    edited September 2016
    Hello

    No, I have in the "landcover_attributes.csv" table  an entry for landcover code 4

    I've  changed the value 0 (zero) related to water resources to 0.001 in my biophysical table and didn't work.

    I've notice some "holes" in the output raster file "aligned_lulc_sdr_6".

    I will dropbox you my data @jdouglass

    Thank you so much!!!
    Post edited by TAIAPF on
  • jdouglassjdouglass Administrator, NatCap Staff
    Hi @TAIAPF, I've taken a look at your inputs, and I believe the landcover raster is the part that's causing issues.  While the landcover raster does have large groups of pixels that match the entries in your biophysical table, there are 23,198 unique pixel values at the boundaries between these large groups that have other floating-point values.  Since these other values are not in the biophysical table, the error occurred.

    So given this information, I'd recommend processing your landcover raster a bit more to ensure that the only pixel values in the raster are nodata, 1, 2, 3, 4, 5, 6, 7 or 8, and not anything else in between.

    Hope this helps!
  • Thank you so much @jdouglass

    I've converted my polygon to raster (again) and as you've recommended I've processed my landcouver to ensure the values are the same on my biophysical table.

    I've runned the SDR model and now it worked. BUT, there are some WARNING (s), as you can see below. Could suggest me what could be the problem?

     


    09/29/2016 09:37:40  root               INFO     Logging will be saved to natcap.invest.sdr-log-2016-09-29--09_37_40.txt
    09/29/2016 09:37:40  root               DEBUG    Loaded the model from natcap.invest.sdr
    09/29/2016 09:37:40  root               INFO     Executing the loaded model
    09/29/2016 09:37:40  root               INFO     Running InVEST version "3.3.1"
    09/29/2016 09:37:40  root               INFO     Python architecture: ('32bit', 'WindowsPE')
    09/29/2016 09:37:40  root               INFO     Disk space remaining for workspace: 267.96 GB
    09/29/2016 09:37:40  root               INFO     Pointing temporary directory at the workspace at C:\Users\N\Desktop\SDR_RUN6
    09/29/2016 09:37:41  root               INFO     Updating os.environ["TMP"]=C:\Users\N\AppData\Local\Temp to C:\Users\N\Desktop\SDR_RUN6
    09/29/2016 09:37:41  root               INFO     Updating os.environ["TEMP"]=C:\Users\N\AppData\Local\Temp to C:\Users\N\Desktop\SDR_RUN6
    09/29/2016 09:37:41  root               INFO     Setting os.environ["TMPDIR"]=C:\Users\N\Desktop\SDR_RUN6
    09/29/2016 09:37:41  root               INFO     Setting tempfile.tempdir to C:\Users\N\Desktop\SDR_RUN6\tmp
    09/29/2016 09:37:41  root               INFO     Starting natcap.invest.sdr
    09/29/2016 09:37:55  pygeoprocessing.geoprocessing INFO     align_dataset_list aligning dataset 3 of 4
    09/29/2016 09:38:00  natcap.invest.sdr  INFO     calculating slope
    09/29/2016 09:38:05  natcap.invest.sdr  INFO     calculating flow direction
    09/29/2016 09:38:11  pygeoprocessing.routing.routing_core INFO     labeling flats
    09/29/2016 09:38:11  pygeoprocessing.routing.routing_core INFO     draining away from higher
    09/29/2016 09:38:12  pygeoprocessing.routing.routing_core INFO     draining towards lower
    09/29/2016 09:38:12  pygeoprocessing.routing DEBUG    flats exist, calculating flow direction for them
    09/29/2016 09:38:14  pygeoprocessing.routing.routing_core INFO     labeling flats
    09/29/2016 09:38:14  pygeoprocessing.routing.routing_core INFO     draining away from higher
    09/29/2016 09:38:14  pygeoprocessing.routing.routing_core INFO     draining towards lower
    09/29/2016 09:38:14  pygeoprocessing.routing INFO     flats exist on second pass, must be flat areas that abut the raster edge
    09/29/2016 09:38:15  natcap.invest.sdr  INFO     calculating flow accumulation
    09/29/2016 09:38:15  pygeoprocessing.routing DEBUG    starting flow accumulation
    09/29/2016 09:38:20  natcap.invest.sdr  INFO     calculate ls term
    C:\PROGRA~2\INVEST~1.1_X\INVEST~1\natcap\invest\sdr.py:368: RuntimeWarning: invalid value encountered in power
    C:\PROGRA~2\INVEST~1.1_X\INVEST~1\natcap\invest\sdr.py:378: RuntimeWarning: invalid value encountered in power
    C:\PROGRA~2\INVEST~1.1_X\INVEST~1\natcap\invest\sdr.py:379: RuntimeWarning: invalid value encountered in power
    C:\PROGRA~2\INVEST~1.1_X\INVEST~1\natcap\invest\sdr.py:384: RuntimeWarning: invalid value encountered in greater
    09/29/2016 09:38:24  natcap.invest.sdr  INFO     classifying streams from flow accumulation raster
    09/29/2016 09:38:25  natcap.invest.sdr  INFO     calculate per pixel W
    09/29/2016 09:38:27  natcap.invest.sdr  INFO     calculate CP raster
    09/29/2016 09:38:27  natcap.invest.sdr  INFO     calculating RKLS
    09/29/2016 09:38:30  natcap.invest.sdr  INFO     calculating USLE
    09/29/2016 09:38:32  natcap.invest.sdr  INFO     calculating w_bar
    09/29/2016 09:38:44  natcap.invest.sdr  INFO     calculating d_up
    09/29/2016 09:38:46  natcap.invest.sdr  INFO     calculate WS factor
    09/29/2016 09:38:47  natcap.invest.sdr  INFO     calculating d_dn
    09/29/2016 09:38:53  natcap.invest.sdr  INFO     calculate ic
    09/29/2016 09:38:54  natcap.invest.sdr  INFO     calculate sdr
    C:\PROGRA~2\INVEST~1.1_X\INVEST~1\natcap\invest\sdr.py:801: RuntimeWarning: overflow encountered in exp
    09/29/2016 09:38:55  natcap.invest.sdr  INFO     calculate sed export
    09/29/2016 09:38:56  natcap.invest.sdr  INFO     calculate sediment retention index
    09/29/2016 09:38:58  natcap.invest.sdr  INFO     calculate sediment retention
    09/29/2016 09:38:58  natcap.invest.sdr  INFO     calculate S factor
    09/29/2016 09:38:59  natcap.invest.sdr  INFO     calculating d_dn bare soil
    09/29/2016 09:39:04  natcap.invest.sdr  INFO     calculating d_up bare soil
    09/29/2016 09:39:05  natcap.invest.sdr  INFO     calculate ic
    09/29/2016 09:39:10  natcap.invest.sdr  INFO     generating report
    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\logging", line 859, in emit
      File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\logging", line 732, in format
      File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\logging", line 471, in format
      File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\logging", line 335, in getMessage
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 21: ordinal not in range(128)
    Logged from file natcap.invest.sdr, line 306
    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\logging", line 859, in emit
      File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\logging", line 732, in format
      File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\logging", line 471, in format
      File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\logging", line 335, in getMessage
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 21: ordinal not in range(128)
    Logged from file natcap.invest.sdr, line 306
    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\logging", line 859, in emit
      File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\logging", line 732, in format
      File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\logging", line 471, in format
      File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\logging", line 335, in getMessage
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 21: ordinal not in range(128)
    Logged from file natcap.invest.sdr, line 306
    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\logging", line 859, in emit
      File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\logging", line 732, in format
      File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\logging", line 471, in format
      File "C:\Users\natcap-servers\jenkins-home\workspace\natcap.invest\label\GCE-windows-1\exe\build\invest\out00-PYZ.pyz\logging", line 335, in getMessage
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 21: ordinal not in range(128)
    Logged from file natcap.invest.sdr, line 306
    09/29/2016 09:39:16  root               INFO     Opening file explorer to workspace directory
    09/29/2016 09:39:16  root               INFO     Using windows explorer to view files
    09/29/2016 09:39:17  root               INFO     Disk space free: 267.89 GB
    09/29/2016 09:39:17  root               INFO     Elapsed time: 1m 36.14s
    09/29/2016 09:39:17  root               INFO     Finished.
    09/29/2016 09:39:17  root               INFO     Elapsed time: 1m 37.18s
    09/29/2016 09:39:17  root               INFO     Operations completed successfully

  • RichRich Administrator, NatCap Staff
    Hi, you can safely ignore those particular warnings; they don't otherwise affect your results.
  • Great! Thanks @Rich

Sign In or Register to comment.