natcap / invest

InVEST®: models that map and value the goods and services from nature that sustain and fulfill human life.
Apache License 2.0
166 stars 68 forks source link

HQ convolve_2d misuse #270

Closed dcdenu4 closed 4 years ago

dcdenu4 commented 4 years ago

HQ uses pgp.convolve_2d with arguments ignore_nodata_and_edges=True and mask_nodata=False. This creates nonsensical output. From Rich:

But something weird happens when you set "ignore nodata" to true but "mask nodata" to false. You're saying "treat the nodata edges as though they aren't there, but then also expose the underlying values that would have been there"... You've got these areas of all 1s bounded by nodata, so there is no variation in those blocks, then you say ignore the edge effects, so the result is that it's all 1 in that block, but then it also says show me whatever the nodata values were, which were just ignored and the visual result is some numerical noise -- that's the garbage result you see.

There is a pygeoprocessing PR that will now raise an Exception given this combination of arguments. https://github.com/natcap/pygeoprocessing/pull/110

For HQ ignore_nodata_and_edges=False and mask_nodata=False going forward.

dcdenu4 commented 4 years ago

I think convolve_2d is bugged in the 2.1 pgp release.

dcdenu4 commented 4 years ago

This is being worked on under the #8 issue and PR #287

dcdenu4 commented 4 years ago

PR #287 closes this issue.