Get the Minimum and Maximum Using the RasterCalculator Function

214
0
03-25-2024 07:52 AM
James477
New Contributor

I'm working on a Python script to normalize my raster image using the RasterCalculator function in ArcGIS Pro. However, I'm encountering an issue with accessing the minimum and maximum values of the raster dataset. When using the ArcGIS GUI, the calculation works as expected, but in my script, it doesn't recognize 'minimum' or 'maximum'. Here's a snippet of my code:

 

normalised_raster = arcpy.ia.RasterCalculator(["test.tif"], ["x"], "(x - x.minimum) / (x.maximum - x.minimum)")

 

How can I properly access the minimum and maximum values to perform this raster calculation in my script?

How can I properly access the minimum and maximum values to perform this raster calculation in my script?

0 Kudos
0 Replies