I'm new to Python so sorry for maybe trivial question esta, I have four Landsat images and each image with an area to extract by mask. How can I make this script? I've tried with this script doesn't work
import arcpy, os
from arcpy import env
path = 'F:\\Master\\Python\\1997\\data'
arcpy.env.overwriteOutput = True
arcpy.env.workspace = path
arcpy.CheckOutExtension("spatial")
Local variables:
1='1_23165_1997204.img'
2='2_23065_1997197.img'
3='3_23166_1997204.img'
4= '4_23066_1997197.img'
rec_1 = "rec_1"
rec_2 = "rec_2"
rec_3 = "rec_3"
rec_4 = "rec_4"
Zona1 = "F:\\Master\\Python\\output\\zona1"
Zona2 = "F:\\Master\\Python\\output\\zona2"
Zona3 = "F:\\Master\\Python\\output\\zona3"
Zona4 = "F:\\Master\\Python\\output\\zona4"
Process: Extract by Mask
arcpy.gp.ExtractByMask_sa(1, rec_1, Zona1)
arcpy.gp.ExtractByMask_sa(2, rec_2, Zona2)
arcpy.gp.ExtractByMask_sa(3, rec_3, Zona3)
arcpy.gp.ExtractByMask_sa(4, rec_4, Zona4)