IndexError: "index 4 is out of bounds for axis 0 with size 4" in SDR model

Hello, NatCap’ers,
Hope you are well. Hope too you could help me easily with this, please.

My data is the same as the case data(SDR), but I don 't know why I keep showing the error. However, the case data could be run. I cannot find the solution now, so could you please help me with it? Thanks a lot.

Best regards,
Linsheng Wen

InVEST-natcap.invest.sdr.sdr-log-2023-06-08–16_39_19.txt (27.5 KB)

Hi @WLS , thanks for posting your logfile. It is not immediately clear what the problem is. There seems to be a problem with the data used in the LS factor calculation. That is the slope, weighted average aspect, and flow accumulation rasters. You can find these rasters in the intermediate_outputs folder. These are all derived from the input DEM, so viewing that in GIS might reveal the problem.

If nothing obvious stands out when looking at these data, please do share your input data so we can try to reproduce this error. A link to a google drive, dropbox, etc is fine. And you may send a private message to me with the link if you prefer.

Thanks,
Dave

Dear Dave,

I hope this email finds you well. I sincerely apologize for the delayed response. I greatly appreciate your prompt email and assistance regarding the error I encountered while running the model.

I would like to inform you that I have successfully resolved the issue. As you suggested, the problem originated from the DEM data. After further investigation and experimentation, This could be a problem with the mask extraction of the DEM or with the projection transformation. Before that I also went to exclude LUCC data or other data sources. This took me a lot of time. Once I rectified the DEM data and ensured its integrity, the model ran smoothly without any issues.

I want to express my gratitude for your guidance and the valuable insight you provided. Your suggestion to investigate the DEM data was instrumental in identifying the source of the problem. I am truly thankful for your prompt response and willingness to assist me.

Thank you again for your invaluable assistance. I sincerely appreciate your time and help.

Best regards,
Linsheng Wen

1 Like

Hi NatCap’ers,
Hope you are well. Hope too you could help me easily with this, please.

I have a new question about the InVEST model. I compared the predicted ulse by the invest model with the actual monitored value and found that the simulated value is much larger than the observed value. I adjusted the Borselli K Parameter(kb) by referring to the User’s Guide, but found that the adjustment did not work well. How do I go about adjusting the parameters to reduce the ulse, kb,IC0 or Maximum SDR Value, or both?

Best regards,
Linsheng Wen

Hi @WLS -

Have you looked at the User Guide chapter called Comparison with Observations? It provides a little bit of guidance, and points to a study by Perrine Hamel where they adjust model parameters. It is also common to adjust the USLE C values, since they have a lot of influence on the results.

And a reminder that the model itself doesn’t tend to perform well in areas with very steep slopes, since the original USLE equation was created for land with gentle slopes. We have made some adjustments in the model to compensate for this, but still we frequently see excessively high values reported in mountainous areas. So it’s worthwhile to see if there is a pattern to where the high values are occurring.

Finally, you might look at other posts in this forum about the LS factor, where we discuss how it is often a driver of very high values.

~ Stacie

1 Like

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