Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import arcpy, glob, os
- from arcpy import sa #spatial analyst
- liste_a = glob.glob("folderA\*.tif") #get a list of tif (or other extension)
- for image in liste_a: #loop on images
- print image # just checking...
- image_a = Raster(image) #create raster object based on the raster name
- image_b = Raster("folderB\" + os.path.split(image)[-1][:-5] + "B.tif") #idem, but adjust the name
- image_c = image_a - image-b #self explicit
- image_c.save( "folderC\" + os.path.split(image)[-1][:-5] + "C.tif") #save with new name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement