-
Notifications
You must be signed in to change notification settings - Fork 75
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
Reported discrepancy between LS Factor in SDR vs SAGA #915
Comments
Rafa noted today that:
|
Doug and Jesse had a coincidentally very relevant exchange on slack this morning, where Jesse thought that slope was in radians when it turns out that pygeoprocessing produces slope in degrees. The SDR UG also assumes that slope is in radians. It could be that this LS factor discrepancy is simply due to a unit conversion issue. |
Nope, that's not it. |
Ok, so I've been looking into this for a little while now and here's a summary of what I've found so far: It's worth noting that I'm using SAGA version 7.3.0 in QGIS 3.22.4-Białowieża, while the source code I'm referencing is a development version on SAGA's LS Factor doesn't handle plateausSAGA's LS factor calculation relies on a flow accumulation method, The solution for this is to use the SAGA Wang & Liu pitfilling algorithm to ensure suitable hydrological connectivity. When using Wang&Liu on the DEM, the InVEST LS Factor and the SAGA LS Factor are actually on the same order. Not identical (like ~30-50% off), but at least they're roughly the same order of magnitude. SAGA's LS Factor Uses Strict Desmet & Govers 1996; InVEST Does NotThe critical difference is in the Given:
Contrast that with the InVEST This accounts for some of the difference between the two LS methods. Saga Uses On-Pixel Aspect; InVEST Does NotThe SAGA source code uses the on-pixel aspect calculated from their InVEST by contrast infers aspect from the weighted average of flow contributions to each neighbor according to the Multiple Flow Direction algorithm. While pixel values have reasonable values in the range $ [1, \sqrt{2}] $ in both cases, the SAGA approach has more spatially contiguous outputs: Contributing Area Differs between SAGA and InVESTThe SAGA LS Factor operation offers multiple methods for calculating the upstream contributing area, including: InVEST does neither of these, instead using the literal upstream contributing area and not treating it as the accumulated flow length as SAGA does. So, is there a problem?If you are using a Wang&Liu-conditioned DEM, these other differences are minor. However, the aspect issue seems like something we may want to correct. I'm not sure about the others; I'll check with Rafa about this. |
I just met with Rafa and we're going to continue to do some exploratory development and data analysis that will probably end up with some modifications to the InVEST LS Factor function. For now, there are a few things that need to be done:
|
I forgot to update this. We're trying out a few different methods for updating the LS factor on the Costa Rica inputs that Kelly used for a recent project and Rafa will do the data analysis to figure out what's the best solution for InVEST's SDR from there. |
As a reminder to myself, I'm working on this in https://github.com/phargogh/invest-ls-factor-vs-saga |
We're waiting on some real-world data to run this on. The original hope was to use the Costa Rica layers, but maybe we should use something else? |
I just chatted with @schmittrjp about this on slack and here's his response:
So, @dcdenu4 this is a bit of a bigger change. Once the change is ready, should the release wait until 3.14? @dcdenu4 Would it be OK with you if I added an ADR for this? (related to #1079) |
@phargogh, 3.14 probably makes sense. Given how much this update effects results we might want to have a forum post as well with some visuals outlining the change. I think an ADR would be awesome. I know I had done some research and prep for an updated proposal related to #1079 . I'll see if I can dig any of that out... Actually I think I was writing up an ADR for the Habitat Quality change. I'll see where that ended up. |
I have just created a PR for this, #1289 and I am just waiting on final confirmation from Rafa about the changes we're hoping to make before submitting the PRs for this and for an ADR discussing the change. |
The ADR discussing this change is at #1288 and can be previewed here: https://github.com/phargogh/invest/blob/task/1079-915-adr-for-ls-factor-change/doc/decision-records/ADR-0001-Update-SDR-LS-Factor.md |
Word from @schmittrjp is:
|
I've heard this now from several people including Dionee on the natcap forums and now from Rafa as well: there is a significant difference between the calculated LS factor in InVEST SDR when compared with SAGA's LS factor. Rafa sent along his inputs to the SAGA module in QGIS (download them here, Stanford auth required) for further investigation.
The text was updated successfully, but these errors were encountered: