I need to reduce the processing extent of my raster by some sort of automatic procedure in python. Currently the borders of the dataset I've been using has anomalies (due to the classification of the landsat scanning lines).
I would like to reduce the extent of the raster processing so that when I retrieve the information above by a SetNull function the borders are not processed. Something like
Now this can easily be done with an extract by mask function (i.e. figure2) although that would require manual selection of the masking region. Is there a menthod I can utilize to calculate the extent region (ignoring nodata values) minus the border width in the x and y direction of each row/column and then utilize the arcpy.env.extent
in Python?