You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the NDR eff calcuation mistakenly uses the effective retention nodata value (-1) as a real value on pour point pixels.
The processing stack is initialized with pour point pixels (that drain outside of the raster or drain to a nodata pixel). When these pixels are processed, we iterate over their downslope neighbors. Neighbors that are outside of the raster are correctly skipped:
but nodata neighbors are not skipped. I confirmed that at this point in the code, neighbor_effective_retention is -1 (the nodata value) and gets used as if it were real data in case 2:
It seems that the NDR eff calcuation mistakenly uses the effective retention nodata value (-1) as a real value on pour point pixels.
The processing stack is initialized with pour point pixels (that drain outside of the raster or drain to a nodata pixel). When these pixels are processed, we iterate over their downslope neighbors. Neighbors that are outside of the raster are correctly skipped:
invest/src/natcap/invest/ndr/effective_retention.h
Lines 176 to 179 in f9c143d
but nodata neighbors are not skipped. I confirmed that at this point in the code,
neighbor_effective_retention
is-1
(the nodata value) and gets used as if it were real data in case 2:invest/src/natcap/invest/ndr/effective_retention.h
Lines 192 to 204 in f9c143d
I think that the correct behavior would be to skip nodata neighbors (effectively treating them as 0 in the
working_retention_eff
sum).The impact of this bug on final model results should be pretty minor, since it only affects the pour point pixels.
I am linking to the routing refactor branch because that's what I'm most familiar with right now, but the same problem exists in the original code.
The text was updated successfully, but these errors were encountered: