forked from drsudhanshupanda/Software
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSBEVA Model.py
106 lines (81 loc) · 7.49 KB
/
SBEVA Model.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# SBEVA Model.py
# Created on: 2022-02-25 09:51:04.00000
# (generated by ArcGIS/ModelBuilder)
# Description:
# ---------------------------------------------------------------------------
# Import arcpy module
import arcpy
# Local variables:
KFACT_shp = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\soils_SSURGSDM_sc015_3166549_01\\KFACT.shp"
Stream_Buff_Fin = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamBankErosionOutput.gdb\\Stream_Buff_Fin"
StreamBuffer50 = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\StreamBuffer50"
KFACT_BUFF = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\KFACT_BUFF"
KFACT_BUFF_RAST2 = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\KFACT_BUFF_RAST2"
JM_2011_TC_agreedem = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\DATA_TC\\JM_2011_TC_agreedem\\JM_2011_TC_agreedem"
AOIWS_shp = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\hydrologic_units_WBDHU12_sc015_3166956_03\\AOIWS.shp"
DEM_AOI = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\DEM_AOI"
SLOPE_AOI = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\SLOPE_AOI"
SLOPE_SUS = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\SLOPE_SUS"
SLOPESUS_50FT = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\SLOPESUS_50FT"
NLCD_AOI = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamBankErosionOutput.gdb\\NLCD_AOI"
NLCD_BUFF50 = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\NLCD_BUFF50"
NLCD_SUS_50FT = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\NLCD_SUS_50FT"
KFACT_RAST = "KFACT_RAST"
KFACT_SUS = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\KFACT_SUS"
MapunitRaster_sc_10m1_tif = "MapunitRaster_sc_10m1.tif"
GSSURGO_AOI = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\GSSURGO_AOI"
FLOODFREQ_SUS = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\FLOODFREQ_SUS"
HYDGRP_SUS = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\HYDGRP_SUS"
WTSUM50FT = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\WTSUM50FT"
Stream_Buff_Fin__2_ = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamBankErosionOutput.gdb\\Stream_Buff_Fin"
StreamBuffer1 = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\StreamBuffer1"
EROS_SUM_1FT = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\EROS_SUM_1FT"
NLCD_BUFF1 = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\NLCD_BUFF1"
NLCD_SUS_1FT = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\NLCD_SUS_1FT"
SLOPESUS_1FT = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\SLOPESUS_1FT"
STRMBNKEROS_FIN = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\STRMBNKEROS_FIN"
# Set Geoprocessing environments
arcpy.env.scratchWorkspace = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\Emanuel_Soil_Project\\OutputData.gdb"
arcpy.env.workspace = "U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\Emanuel_Soil_Project"
# Process: Buffer
arcpy.Buffer_analysis(Stream_Buff_Fin, StreamBuffer50, "50 Feet", "FULL", "ROUND", "ALL", "", "PLANAR")
# Process: Clip (5)
arcpy.Clip_analysis(KFACT_shp, StreamBuffer50, KFACT_BUFF, "")
# Process: Polygon to Raster
arcpy.PolygonToRaster_conversion(KFACT_BUFF, "kffact", KFACT_BUFF_RAST2, "CELL_CENTER", "NONE", "10")
# Process: Extract by Mask
arcpy.gp.ExtractByMask_sa(JM_2011_TC_agreedem, AOIWS_shp, DEM_AOI)
# Process: Slope
arcpy.gp.Slope_sa(DEM_AOI, SLOPE_AOI, "DEGREE", "1", "PLANAR", "METER")
# Process: Reclassify
arcpy.gp.Reclassify_sa(SLOPE_AOI, "Value", "0 2 0;2 4 0;4 6 0;6 20 1;20 77.929459 2", SLOPE_SUS, "DATA")
# Process: Extract by Mask (3)
arcpy.gp.ExtractByMask_sa(SLOPE_SUS, StreamBuffer50, SLOPESUS_50FT)
# Process: Extract by Mask (4)
arcpy.gp.ExtractByMask_sa(NLCD_AOI, StreamBuffer50, NLCD_BUFF50)
# Process: Reclassify (3)
arcpy.gp.Reclassify_sa(NLCD_BUFF50, "Land_Cover", "'Developed, Open Space' 1;'Evergreen Forest' 0;Shrub/Scrub 0;Hay/Pasture 1;'Woody Wetlands' 0;'Emergent Herbaceuous Wetlands' 0", NLCD_SUS_50FT, "DATA")
# Process: Reclassify (4)
arcpy.gp.Reclassify_sa(KFACT_RAST, "kffact", ".15 0;.05 0;.20 1;.24 1;.02 0;.17 0;.10 0", KFACT_SUS, "DATA")
# Process: Extract by Mask (6)
arcpy.gp.ExtractByMask_sa(MapunitRaster_sc_10m1_tif, StreamBuffer50, GSSURGO_AOI)
# Process: Reclassify (5)
arcpy.gp.Reclassify_sa(GSSURGO_AOI, "flodfreqdc", "None 0", FLOODFREQ_SUS, "DATA")
# Process: Reclassify (6)
arcpy.gp.Reclassify_sa(GSSURGO_AOI, "hydgrp", "C/D 1;B/D 1;B 0;C 0;A/D 1", HYDGRP_SUS, "DATA")
# Process: Weighted Sum
arcpy.gp.WeightedSum_sa("U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\SLOPESUS_50FT Value 0.2;U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\NLCD_SUS_50FT Value 0.2;U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\KFACT_SUS Value 0.2;U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\FLOODFREQ_SUS Value 0.2;U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\HYDGRP_SUS Value 0.2", WTSUM50FT)
# Process: Buffer (2)
arcpy.Buffer_analysis(Stream_Buff_Fin__2_, StreamBuffer1, "1 Feet", "FULL", "ROUND", "ALL", "", "PLANAR")
# Process: Extract by Mask (7)
arcpy.gp.ExtractByMask_sa(WTSUM50FT, StreamBuffer1, EROS_SUM_1FT)
# Process: Extract by Mask (5)
arcpy.gp.ExtractByMask_sa(NLCD_AOI, StreamBuffer1, NLCD_BUFF1)
# Process: Reclassify (2)
arcpy.gp.Reclassify_sa(NLCD_BUFF1, "Land_Cover", "'Developed, Open Space' 1;'Evergreen Forest' 0;Shrub/Scrub 0;'Woody Wetlands' 0;'Emergent Herbaceuous Wetlands' 0", NLCD_SUS_1FT, "DATA")
# Process: Extract by Mask (2)
arcpy.gp.ExtractByMask_sa(SLOPE_SUS, StreamBuffer1, SLOPESUS_1FT)
# Process: Weighted Sum (2)
arcpy.gp.WeightedSum_sa("U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\EROS_SUM_1FT VALUE 0.2;U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\NLCD_SUS_1FT Value 0.2;U:\\Shared\\GIS\\Projects\\USFS_Biomass_Panda\\EcoStreamConference_2016\\Project\\StreamErosion2.gdb\\SLOPESUS_1FT Value 0.6", STRMBNKEROS_FIN)