No valid pixels received/Something went wrong with CN

I am running a seasonal water yield model and persistently get this error. I looked into other solutions and made sure that all of the NoData areas had a defined value, that the data is all set to the same projection and overlaps correctly, and that the soil type raster only contains 1,2,3,4.
Any help is greatly appreciated, so I have attached the files used in a google drive link.

2022-03-28 15:21:19,342 (pygeoprocessing.geoprocessing_core) WARNING No valid pixels were received, sending None.
2022-03-28 15:21:19,343 (taskgraph.Task) Task.add_task(706) ERROR Something went wrong when adding task calculate curve number (14), terminating taskgraph.
Traceback (most recent call last):
File “taskgraph\”, line 674, in add_task
File “taskgraph\”, line 1093, in _call
File “natcap\invest\seasonal_water_yield\”, line 1072, in _calculate_curve_number_raster
File “pygeoprocessing\”, line 443, in raster_calculator
File “natcap\invest\seasonal_water_yield\”, line 1064, in cn_op
KeyError: 0

Hi @CTXBrabbs -

Thanks for posting all of that information, and what you’ve tried. I just looked at SoilType.tif, and it looks like the background values are all 0, not NoData, and there is no NoData value defined. Try reclassifying your 0s to NoData and see if that helps.

~ Stacie

1 Like

Hi @swolny,

That seems to have fixed the model, I thought I had set the SoilType.tif fil a NoData value, but must have forgotten. Thank you for noticing and helping me out!


1 Like

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