Guest User

Untitled

a guest
Feb 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. import arcpy
  2. from arcpy.sa import *
  3. arcpy.env.workspace = "F:/SED/T1"
  4.  
  5. past = arcpy.ListRasters("*1961-1990_RCP4.5*", "ASC")
  6. future1 = arcpy.ListRasters("*2041-2060_RCP4.5*", "ASC")
  7. future2 = arcpy.ListRasters("*2061-2080_RCP4.5*", "ASC")
  8. future3 = arcpy.ListRasters("*2081-2100_RCP4.5*", "ASC")
  9.  
  10. for p, f1, f2, f3 in zip(past, future1, future2, future3):
  11. Minuspf1 = arcpy.Minus_3d(p ,f1)
  12. Minuspf2 = arcpy.Minus_3d(p ,f2)
  13. Minuspf3 = arcpy.Minus_3d(p ,f3)
  14.  
  15. Max1 = float(arcpy.GetRasterProperties_management(Minuspf1,"MAXIMUM").getOutput(0))
  16. Max2 = float(arcpy.GetRasterProperties_management(Minuspf2,"MAXIMUM").getOutput(0))
  17. Max3 = float(arcpy.GetRasterProperties_management(Minuspf3,"MAXIMUM").getOutput(0))
  18.  
  19. print(Max1)
  20. print(Max2)
  21. print(Max3)
  22.  
  23. SED1 = Power(Divide(Minuspf1, Max1), 2)
  24. SED2 = Power(Divide(Minuspf2, Max2), 2)
  25. SED3 = Power(Divide(Minuspf3, Max3), 2)
Add Comment
Please, Sign In to add comment