Using a polygon vector extraction in a folder all tif format raster data
(Be sure to install a good arcpy package)
Import ArcPy
arcpy.CheckOutExtension ( " Spatial " )
arcpy.gp.overwriteOutput = 1
arcpy.env.workspace = " E: \\ the Data " # all raster images of the folder
of Rasters = arcpy.ListRasters ( " * " , " TIF " )
mask = " E: \\ \\ bound.shp Data " # for extracting a vector mask
for Raster in of Rasters:
Print (Raster)
OUT = " E: Data \\ \\ \\ Images " +raster
arcpy.gp.ExtractByMask_sa(raster, mask, out)
print("OK")
2019-09-02 23:53:36