Hi, does the NDVI Python function actually work? It doesn't retrieve any output for me.
https://pro.arcgis.com/en/pro-app/2.7/arcpy/image-analyst/ndvi.htm
If you are using a standalone python script, you could use a similar script as the following
# Import system modules
import arcpy
from arcpy.ia import *
# Set the analysis environments
arcpy.env.workspace = "C:/arcpyExamples/data"
# Set the local variables
in_raster = "landsat8.tif"
# Execute NDVI function
out_ndvi_raster = NDVI(in_raster, 5, 4)
# Save the output
out_ndvi_raster.save("C:/arcpyExamples/outputs/NDVI.tif")
Did you save the raster?
Raster—ArcGIS Pro | Documentation
by "retrieve " do you mean it doesn't create one, or you don't see one?
Thank you @JayantaPoddar and @DanPatterson but I saved the raster and I have exactly the same code but it doesn't produce anything and I don't get any errors either. Does this work with any satellite image? Mine is WorldView 2
I assume you have Image Analyst Extension for ArcGIS Pro.
Bands are different for WorldView 2.
Maybe you could try Band 7 (NIR1) and Band 5 (Red).
Also ensure you are providing an existing workspace which contains the composite image (containing multiple bands), the correct image name and existing output path.
If you still have confusion, please share the screenshot of the folder containing the Worldview 2 image(s) in Windows Explorer, and also the script you have so far.
Are you sure I need Image Analyst extension? Raster functions don't need Image Analyst extension. When I use the NDVI tool, I can create an NDVI image and I don't have Image Analyst extension. Also, I think at least it needs to give me an error if Image Analyst extension is the issue
it appears elsewhere other than the IA
NDVI function—ArcGIS Pro | Documentation
An overview of the Spatial Analyst functions—ArcGIS Pro | Documentation