2

I am attempting to run the SAVI function (found within the Spatial Analyst module) in ArcPy. However, this function is not showing up for me regardless of there being multiple ArcGIS pages with code samples. (https://pro.arcgis.com/en/pro-app/arcpy/spatial-analyst/savi.htm)

Is this function only available for ArcGIS Pro users?

I have a Spatial Analyst license and I am using ArcGIS Desktop. Is this a licensing issue? Why can't I execute the SAVI function in my code?

SAVI_raster = arcpy.sa.SAVI(Raster,5,4,L_Value)

Error message:

AttributeError: 'module' object has no attribute 'SAVI'

2
  • 2
    The only SAVI reference I found was in the Band Arithmetic doc, which lends credence to the idea that it's a new Pro function (as does the error message). New commands are going to be a common problem moving forward; if you're not using Pro, you should use the desktop.arcgis.com documentation to keep from getting trapped by this.
    – Vince
    Oct 14, 2020 at 20:26
  • Thank you, Vince! I had an inkling that it might be because I am using desktop as opposed to pro.
    – Katie B.
    Oct 15, 2020 at 15:07

1 Answer 1

4

Alternatively, you could just calculate it yourself in the raster calculator.

The modified version of the SAVI (MSAVI) does not require an L factor and is a bit more stable across a range of settings. It is derived using the red and nir bands thus:

(2 * NIR + 1 - sqrt( (2 * NIR + 1)^2 - 8 * (NIR - RED) )) / 2

References

Qi J., Chehbouni A., Huete A.R., Kerr Y.H., (1994). Modified Soil Adjusted Vegetation Index (MSAVI). Remote Sensing of Environment 48:119-126.

2
  • Thank you, Jeffrey! I was trying to take an easier route by using the SAVI function itself but it sounds like I will likely have to do it this way!
    – Katie B.
    Oct 15, 2020 at 15:09
  • I will warn you though, esri's raster algebra has never done well with zero division so, you either need to change zeros to a very small number or use a con statement in the equation to omit zeros from the equation during processing. I would first check to see if you even have zeros in the two required bands. Oct 15, 2020 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.