-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NDR runoff proxy is way off if no nodata value is defined #1005
Comments
Related: #783 |
In a slack thread with Rafa and Stacie, they clarified that runoff proxy should always be |
I see a few problems here -
|
I certainly agree that it'd be nice to have a consistent method of handling the "no defined" nodata issue in pygeoprocessing.
I think that's a fair point. I have found it convenient to use Thinking about this issue from an InVEST input perspective I think we should have a more thorough validation and action procedure for "no defined" nodata values. We've talked about this case being a-okay with GDAL, so we should also support it. I don't think that's necessary from InVEST (though in my mind makes for a better argument for pygeoprocessing). But, given we want to make it "easier" for users to run InVEST, I can see how handling this common case would be beneficial to that cause. And from InVEST, we know (to a large extent) what the inputs and intermediate value ranges should be, so we can make highly educated decisions about what a proper nodata value could be for given raster data. So I'd prefer initially the option of:
|
This came up in a recent forums post and has an easy workaround (runoff proxy input should have a nodata value).
To reproduce:
n_export
values across the 2 runs.The problem here is that early in the model, we align the runoff proxy input and mask out pixel values outside of the watersheds vector. Because there's no nodata value defined, a pixel value of 0 is assumed for masked-out pixels, and we log a relevant
WARNING
in the logfile. But this is a serious issue later on because when we're normalizing runoff proxy pixel values, we assume that all of the pixel values that are non-nodata are valid, and when those are all 0, they're skewing the normalization down towards 0.If we can assume that the runoff proxy raster must be positive values, then we can simply define a negative nodata value and be on our merry way. If not, then maybe we can assume +/- infinity as a nodata value?
It may also be a reasonable solution to add some functionality to pygeoprocessing's
align_and_resize_raster_stack
to assign default nodata values to specific datasets if one is not defined, but that also gets tricky. Maybe validation is a better solution?The text was updated successfully, but these errors were encountered: