Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. import arcpy, glob, os
  2. from arcpy import sa #spatial analyst
  3.  
  4. liste_a = glob.glob("folderA\*.tif") #get a list of tif (or other extension)
  5.  
  6. for image in liste_a: #loop on images
  7. print image # just checking...
  8. image_a = Raster(image) #create raster object based on the raster name
  9. image_b = Raster("folderB\" + os.path.split(image)[-1][:-5] + "B.tif") #idem, but adjust the name
  10. image_c = image_a - image-b #self explicit
  11. 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