The model can run, but the output results are all -1 or nan

Running the NDR module in version 3.14.1 of the InVEST model, the data used can produce normal results in modules like water yield and sediment delivery ratio. In the TIFF files outputted by the NDR module, although images are present, the values are all -1.#IND. Tried to run the model in version 3.11.0, but it encountered an error midway.

In version 3.11, the error message was as follows:
01/17/2024 18:40:52 pygeoprocessing. geoprocessing INFO
01/17/2024 18:40:52 pygeoprocessing. geoprocessing ERROR
started stats_worker
Traceback (most recent call last):
exception encountered in raster_calculator
File “pygeoprocessing \geoprocessing.py”, line 443, in raster_calculator
File “natcap linvest \ndr\ndr. py”, line 956, in _map_load_op
TypeError: can’t multiply sequence by non-int of type ‘numpy.float64’
01/17/2024 18:40:52 pygeoprocessing. geoprocessing INFO
Waiting for raster stats worker result.
01/17/2024 18:40:52 taskgraph. Task
ERROR
Something went wrong when adding task n load (17),
terminating taskgraph.
Traceback (most recent call last):
File “taskgraph\Task.py”, line 674, in add_task
File “taskgraph\Task.py”, line 1093, in _call
File “natcap \invest\ndr\ndr.py”, line 964, in _calculate_load
File “pygeoprocessing \geoprocessing. py”, line 443, in raster_calculator
File “natcap linvest \ndr \ndr.py”, line 956, in _map_load_op
TypeError: can’t multiply sequence by non-int of type ‘numpy. float64’
01/17/2024 18:40:52 natcap. invest. utils ERROR
Exception while executing natcap. invest. ndr. ndr
Traceback (most recent cal1 last):
File “natcap \investlutils. py”, line 165, in prepare_workspace
File “natcap\invest\cli.py”, line 486, in main
File “natcap \invest \ndr\ndr. py”, line 544, in execute
File “taskgraph\Task.py”, line 674, in add_task
File “taskgraph\Task. py”, line 1093, in _call
File “natcap \invest\ndr\ndr.py”, line 964, in _calculate _load
File “pygeoprocessing \geoprocessing. py”, line 443, in raster_calculator
File “natcap linvest \ndr\ndr.py”, line 956, in _map_load_op
TypeError: can’t multiply sequence by non-int of type ‘numpy. float64’
01/17/2024 18:40:52
natcap. invest.utils INFO
Elapsed time: 12m 49.549999999999955s
01/17/2024 18:40:52
natcap.invest.utils INFO
Execution finished

InVEST-natcap.invest.ndr.ndr-log-2024-01-16–09_53_05.txt (28.5 KB)

Hi @AndreZ , we would like to help debug the problem with the 3.14.1 version. It will probably require sharing your input data with us. Can you do that via google drive, dropbox, etc? You may send it in a private message to me if you prefer.

Thank you,

Of course,please tell me what should I do.

You may share a link to your data here, in a private message, or in an email davefisher@stanford.edu

Thank you, I have attached the input data in the form of a link to the reply and named the sub folder as the corresponding input item. Please check.

Thanks for sharing, I requested permission to access this folder.

Ok, I apologize for neglecting this point. I have agreed to your sharing permission application.

No problem. Thanks for sharing your data. I was able to reproduce the problem with version 3.14.1.

The problem was the existence of pixels with a value of nan in your runoff proxy raster. Those pixels are different than the nodata pixels. I have replaced them with the nodata value you used and created a new raster called “runoff.tif” which you may use instead. “runoff_nan_mask.tif” shows the location of all those nan pixels, if you are curious.

runoff.zip (155.8 KB)

Thank you for your help. The model can now run normally. Wishing you all the best in your work.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.