What is the issue or question you have?
I am trying to run the NDR model in InVEST, but it ultimately fails by returning this error code: “ValueError: cannot convert float NaN to integer.” By going through the intermediate outputs, my best guess is that it fails because the “fill pits” procedure creates a filled DEM with basically one elevation value, even though the terrain should have a varied range. Attached are summary tables of the intermediate DEMs output by the NDR model (I will try to attach images below). The first is “aligned_dem,” which looks as expected and has a varied range. The next output, “filled_dem,” does not reflect the terrain of the aligned DEM, with most pixels assigned a value of 2124.
Summary of data:
aligned_dem
Min. : 663.0
1st Qu.: 817.0
Median : 899.0
Mean : 924.4
3rd Qu.: 968.0
Max. :2083.0
NA's :41671
filled_dem
Min. : 693
1st Qu.:2124
Median :2124
Mean :2123
3rd Qu.:2124
Max. :2124
NA's :37845
Any suggestions on why this might be happening and how I can correct it would be greatly appreciated!
What do you expect to happen?
I expect the filled DEM to have a similar range of values to the aligned DEM. I believe the NDR model is failing to make streams because of the uniformity of the filled DEM.
What have you tried so far?
I have tried running this model with a larger and smaller (shown here) spatial range. I’ve tried coarse (1km) and finer (100m, shown here) resolution inputs. I’ve tried an unfilled DEM, a filled DEM (using InVEST’s DelineateIt tool), a pre-processed filled DEM (from WWF Hydrosheds Hydrologically Conditioned DEMs, shown here), and burning lakes/rivers into the DEM as NAs using my land use classification (shown here). All these had similar intermediate outputs to the example shown here.
Attach the logfile here:
InVEST-natcap.invest.ndr.ndr-log-2023-01-10–09_33_57.txt (11.7 KB)