├── .gitattributes ├── .gitignore ├── .ipynb_checkpoints └── Field Options List-checkpoint.ipynb ├── .prj ├── Box_and_Whisker ├── BoxAndWhisker.py └── Toolbox.tbx ├── Change_over_time ├── DetectChange.tbx └── change_over_time.py ├── Charge_Balance ├── Toolbox.tbx ├── charge_balance.py └── charge_balance_cb_only.py ├── CrossSectionTool ├── ElevProf.py └── ElevProf0.py ├── Field Options List.ipynb ├── LICENSE ├── Line_Orientation ├── Line_Orientation.tbx └── line_orientation.py ├── PLSS ├── CAD_TO_LATLONG.py ├── CAD_TO_UTM.py ├── CreateCustomGrid.py ├── CreateQLabels.py ├── CreateQQLabels.py ├── CreateQQSections.py ├── CreateQSections.py ├── CustomGridTools.tbx ├── TRS.py ├── TRS_MODEL_NO_SDE.py ├── TRS_Model.py └── USGS_COORD.tbx ├── Piper ├── Example.gdb.zip ├── Example.gdb │ └── Example.gdb │ │ ├── a00000001.TablesByName.atx │ │ ├── a00000001.gdbindexes │ │ ├── a00000001.gdbtable │ │ ├── a00000001.gdbtablx │ │ ├── a00000002.gdbtable │ │ ├── a00000002.gdbtablx │ │ ├── a00000003.gdbindexes │ │ ├── a00000003.gdbtable │ │ ├── a00000003.gdbtablx │ │ ├── a00000004.CatItemsByPhysicalName.atx │ │ ├── a00000004.CatItemsByType.atx │ │ ├── a00000004.FDO_UUID.atx │ │ ├── a00000004.freelist │ │ ├── a00000004.gdbindexes │ │ ├── a00000004.gdbtable │ │ ├── a00000004.gdbtablx │ │ ├── a00000004.spx │ │ ├── a00000005.CatItemTypesByName.atx │ │ ├── a00000005.CatItemTypesByParentTypeID.atx │ │ ├── a00000005.CatItemTypesByUUID.atx │ │ ├── a00000005.gdbindexes │ │ ├── a00000005.gdbtable │ │ ├── a00000005.gdbtablx │ │ ├── a00000006.CatRelsByDestinationID.atx │ │ ├── a00000006.CatRelsByOriginID.atx │ │ ├── a00000006.CatRelsByType.atx │ │ ├── a00000006.FDO_UUID.atx │ │ ├── a00000006.gdbindexes │ │ ├── a00000006.gdbtable │ │ ├── a00000006.gdbtablx │ │ ├── a00000007.CatRelTypesByBackwardLabel.atx │ │ ├── a00000007.CatRelTypesByDestItemTypeID.atx │ │ ├── a00000007.CatRelTypesByForwardLabel.atx │ │ ├── a00000007.CatRelTypesByName.atx │ │ ├── a00000007.CatRelTypesByOriginItemTypeID.atx │ │ ├── a00000007.CatRelTypesByUUID.atx │ │ ├── a00000007.gdbindexes │ │ ├── a00000007.gdbtable │ │ ├── a00000007.gdbtablx │ │ ├── a00000009.freelist │ │ ├── a00000009.gdbindexes │ │ ├── a00000009.gdbtable │ │ ├── a00000009.gdbtablx │ │ ├── a00000009.spx │ │ ├── gdb │ │ └── timestamps ├── Piper.tbx ├── Piper.zip ├── Piper │ └── Piper │ │ ├── Example.gdb.zip │ │ ├── Piper.tbx │ │ ├── out.pdf │ │ └── piper2.py ├── out.pdf ├── piper.py ├── piper2.py └── piper_excel.py ├── PourPuff.tbx ├── PourousPuff.py ├── PourousPuff2.py ├── PourousPuff3.py ├── README.md ├── Stiff.zip ├── Stiff ├── .ipynb_checkpoints │ └── Untitled-checkpoint.ipynb ├── Example.gdb.zip ├── Stiff.JPG ├── Stiff.tbx └── StiffGEOfeat.py ├── Theis.zip ├── Theis └── Theis │ ├── Theis.gdb │ ├── a00000001.TablesByName.atx │ ├── a00000001.gdbindexes │ ├── a00000001.gdbtable │ ├── a00000001.gdbtablx │ ├── a00000002.gdbtable │ ├── a00000002.gdbtablx │ ├── a00000003.gdbindexes │ ├── a00000003.gdbtable │ ├── a00000003.gdbtablx │ ├── a00000004.CatItemsByPhysicalName.atx │ ├── a00000004.CatItemsByType.atx │ ├── a00000004.FDO_UUID.atx │ ├── a00000004.gdbindexes │ ├── a00000004.gdbtable │ ├── a00000004.gdbtablx │ ├── a00000004.spx │ ├── a00000005.CatItemTypesByName.atx │ ├── a00000005.CatItemTypesByParentTypeID.atx │ ├── a00000005.CatItemTypesByUUID.atx │ ├── a00000005.gdbindexes │ ├── a00000005.gdbtable │ ├── a00000005.gdbtablx │ ├── a00000006.CatRelsByDestinationID.atx │ ├── a00000006.CatRelsByOriginID.atx │ ├── a00000006.CatRelsByType.atx │ ├── a00000006.FDO_UUID.atx │ ├── a00000006.gdbindexes │ ├── a00000006.gdbtable │ ├── a00000006.gdbtablx │ ├── a00000007.CatRelTypesByBackwardLabel.atx │ ├── a00000007.CatRelTypesByDestItemTypeID.atx │ ├── a00000007.CatRelTypesByForwardLabel.atx │ ├── a00000007.CatRelTypesByName.atx │ ├── a00000007.CatRelTypesByOriginItemTypeID.atx │ ├── a00000007.CatRelTypesByUUID.atx │ ├── a00000007.gdbindexes │ ├── a00000007.gdbtable │ ├── a00000007.gdbtablx │ ├── a00000009.gdbindexes │ ├── a00000009.gdbtable │ ├── a00000009.gdbtablx │ ├── a00000009.spx │ ├── a0000000a.gdbindexes │ ├── a0000000a.gdbtable │ ├── a0000000a.gdbtablx │ ├── a0000000a.spx │ ├── a0000000b.gdbindexes │ ├── a0000000b.gdbtable │ ├── a0000000b.gdbtablx │ ├── a0000000c.gdbindexes │ ├── a0000000c.gdbtable │ ├── a0000000c.gdbtablx │ ├── a0000000d.band_index.atx │ ├── a0000000d.blk_key_index.atx │ ├── a0000000d.col_index.atx │ ├── a0000000d.gdbindexes │ ├── a0000000d.gdbtable │ ├── a0000000d.gdbtablx │ ├── a0000000d.row_index.atx │ ├── a0000000e.gdbindexes │ ├── a0000000e.gdbtable │ ├── a0000000e.gdbtablx │ ├── gdb │ └── timestamps │ ├── Toolbox.tbx │ └── theis.py ├── Transposer ├── Toolbox.tbx ├── Transposer.py └── Transposer_No_Pandas.py ├── graphexamples.csv ├── hydrograph ├── figure_60.png └── hydrograph.py ├── map_Clean.py ├── paramgroup dict.py ├── populate_fields_via_filename.py ├── prism ├── PRISM (2).py ├── PRISM2.py ├── PRISM_downsample.py ├── PRISM_zonal.py ├── PRISM_zonal2.py ├── PRISM_zonal3.py └── prism.py └── zonal_extractor.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # ========================= 18 | # Operating System Files 19 | # ========================= 20 | 21 | # OSX 22 | # ========================= 23 | 24 | .DS_Store 25 | .AppleDouble 26 | .LSOverride 27 | 28 | # Icon must ends with two \r. 29 | Icon 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | -------------------------------------------------------------------------------- /.prj: -------------------------------------------------------------------------------- 1 | Projection GEOGRAPHIC 2 | Datum NAD83 3 | Spheroid GRS80 4 | Units DD 5 | Zunits NO 6 | Parameters 7 | -------------------------------------------------------------------------------- /Box_and_Whisker/Toolbox.tbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Box_and_Whisker/Toolbox.tbx -------------------------------------------------------------------------------- /Change_over_time/DetectChange.tbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Change_over_time/DetectChange.tbx -------------------------------------------------------------------------------- /Change_over_time/change_over_time.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Apr 16 15:18:28 2015 4 | @author: paulinkenbrandt 5 | """ 6 | 7 | import arcpy 8 | import datetime 9 | import pandas as pd 10 | import matplotlib.pyplot as plt 11 | import datetime 12 | #from rpy2.robjects.packages import importr 13 | #utils = importr("rkt") 14 | 15 | resultstable = arcpy.GetParameterAsText(0) 16 | stationidfield = arcpy.GetParameterAsText(1) 17 | datefield = arcpy.GetParameterAsText(2) 18 | paramfield = arcpy.GetParameterAsText(3) 19 | param = arcpy.GetParameterAsText(4) 20 | valuefield = arcpy.GetParameterAsText(5) 21 | 22 | fieldlist = [f.name for f in arcpy.ListFields(resultstable)] 23 | 24 | stationid,parameter,dt,values = [],[],[],[] 25 | 26 | # populate lists with values from the active table 27 | with arcpy.da.UpdateCursor(resultstable,[datefield,paramfield,stationidfield,valuefield]) as cursor: 28 | 29 | for row in cursor: 30 | if row[1] in param: 31 | stationid.append(row[2]) 32 | parameter.append(row[1]) 33 | dt.append(row[0]) 34 | values.append(row[3]) 35 | 36 | d = {'dt':dt, 'stationid':stationid, 'parameter':parameter, 'values':values} 37 | 38 | df = pd.DataFrame(d, index=dt) 39 | #arcpy.AddMessage(df) 40 | from rpy2.robjects.packages import importr 41 | 42 | 43 | now = datetime.datetime.now() 44 | 45 | plt.figure() 46 | plt.plot(df.index.to_datetime(),df['values']) 47 | plt.savefig("C:\\PROJECTS\\EPA EN\\test_figs\\"+str(now.year)+"-"+str(now.month)+"-"+str(now.day)+"_"+str(now.hour)+"_"+str(now.minute)+".pdf") 48 | plt.show() 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /Charge_Balance/Toolbox.tbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Charge_Balance/Toolbox.tbx -------------------------------------------------------------------------------- /Charge_Balance/charge_balance.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Jun 19 10:19:00 2014 4 | 5 | @author: paulinkenbrandt 6 | """ 7 | 8 | import arcpy 9 | import numpy as np 10 | 11 | # input table having the fields Cl, HCO3, CO3, SO4, Na, K, Ca, Mg 12 | infile = arcpy.GetParameterAsText(0) 13 | 14 | # field having unique station identifier 15 | stid = arcpy.GetParameterAsText(1) 16 | 17 | # function to calculate charge balance 18 | def chrgbal(Ca,Mg,Na,K,Cl,HCO3,CO3,SO4,NO3,NO2): 19 | # Multipliers to convert from mg/l to meq/l 20 | d = {'Ca':0.04990269, 'Mg':0.082287595, 'Na':0.043497608, 'K':0.02557656, 'Cl':0.028206596, 'HCO3':0.016388838, 'CO3':0.033328223, 'SO4':0.020833333, 'NO2':0.021736513, 'NO3':0.016129032} 21 | cation = d['Ca']*Ca + d['Mg']*Mg + d['Na']*Na + d['K']*K 22 | anion = d['Cl']*Cl + d['HCO3']*HCO3 + d['CO3']*CO3 + d['SO4']*SO4 + d['NO3']+d['NO2'] 23 | bal = (cation-anion)/(cation + anion)*100 24 | return round(bal,2), cation, anion 25 | 26 | # import stuff from table; converts null values to zero for calculations 27 | arr = arcpy.da.TableToNumPyArray(infile, ('Cl', 'HCO3','CO3', 'SO4','Na','K','Ca','Mg',arcpy.GetParameterAsText(1)), null_value=0) 28 | 29 | 30 | nosamp = len(arr['Cl']) # Determine number of samples in file 31 | 32 | # Multipliers to convert from mg/l to meq/l 33 | d = {'Ca':0.04990269, 'Mg':0.082287595, 'Na':0.043497608, 'K':0.02557656, 'Cl':0.028206596, 'HCO3':0.016388838, 'CO3':0.033328223, 'SO4':0.020833333, 'NO2':0.021736513, 'NO3':0.016129032} 34 | 35 | 36 | # import major ions as arrays 37 | Cl = arr['Cl'] 38 | Mg = arr['Mg'] 39 | K = arr['K'] 40 | Ca = arr['Ca'] 41 | Na = arr['Na'] 42 | HCO3 =arr['HCO3'] 43 | CO3 = arr['CO3'] 44 | NaK = np.array([Na[i]+K[i] for i in range(nosamp)]) 45 | SO4 = arr['SO4'] 46 | 47 | # Convert to meq/L and assign to variables 48 | Cl_meq = np.array([arr['Cl'][i]*d['Cl'] for i in range(nosamp)]) 49 | Mg_meq = np.array([arr['Mg'][i]*d['Mg'] for i in range(nosamp)]) 50 | K_meq = np.array([arr['K'][i]*d['K'] for i in range(nosamp)]) 51 | Ca_meq = np.array([arr['Ca'][i]*d['Ca'] for i in range(nosamp)]) 52 | Na_meq = np.array([arr['Na'][i]*d['Na'] for i in range(nosamp)]) 53 | HCO3_meq = np.array([arr['HCO3'][i]*d['HCO3'] for i in range(nosamp)]) 54 | CO3_meq = np.array([arr['CO3'][i]*d['CO3'] for i in range(nosamp)]) 55 | NaK_meq = np.array([Na_meq[i]+K_meq[i] for i in range(nosamp)]) 56 | SO4_meq = np.array([arr['SO4'][i]*d['SO4'] for i in range(nosamp)]) 57 | 58 | # field having unique station identifier 59 | stid = arr[arcpy.GetParameterAsText(1)] 60 | 61 | # create zero arrays for charge balance funtion 62 | NO3 = [0]*nosamp 63 | NO2 = [0]*nosamp 64 | 65 | #calculate charge balance for each sample 66 | cb = np.array([chrgbal(Ca[i],Mg[i],Na[i],K[i],Cl[i],HCO3[i],CO3[i],SO4[i],NO3[i],NO2[i])[0] for i in range(nosamp)]) 67 | # calculate anion total 68 | an = np.array([chrgbal(Ca[i],Mg[i],Na[i],K[i],Cl[i],HCO3[i],CO3[i],SO4[i],NO3[i],NO2[i])[2] for i in range(nosamp)]) 69 | # calculate cation total 70 | cat = np.array([chrgbal(Ca[i],Mg[i],Na[i],K[i],Cl[i],HCO3[i],CO3[i],SO4[i],NO3[i],NO2[i])[1] for i in range(nosamp)]) 71 | # looks for missing values, then fills them in if it can 72 | for i in range(len(cb)): 73 | if cb[i]<0: 74 | if Ca[i]==0 and (Na[i] <> 0 and K[i] <> 0 and Mg[i] <> 0): 75 | Ca[i]= abs(cat[i]-an[i])/d['Ca'] 76 | arcpy.AddMessage('Ca created to make correct balance for station %s' %stid[i] ) 77 | elif Mg[i]==0 and (Na[i] <> 0 and K[i] <> 0 and Ca[i] <> 0): 78 | Mg[i]= abs(cat[i]-an[i])/d['Mg'] 79 | arcpy.AddMessage('Mg created to make correct balance for station %s' %stid[i] ) 80 | elif Na[i]==0 and (Ca[i] <> 0 and K[i] <> 0 and Mg[i] <> 0): 81 | Na[i]= abs(cat[i]-an[i])/d['Na'] 82 | arcpy.AddMessage('Na created to make correct balance for station %s' %stid[i] ) 83 | elif K[i]==0 and (Na[i] <> 0 and Ca[i] <> 0 and Mg[i] <> 0): 84 | K[i]= abs(cat[i]-an[i])/d['K'] 85 | arcpy.AddMessage('K created to make correct balance for station %s' %stid[i] ) 86 | else: 87 | arcpy.AddMessage('No missing cations to make correct balance for station %s' %stid[i] ) 88 | elif cb[i]>0: 89 | if SO4[i]==0 and (Cl[i] <> 0 and HCO3[i] <> 0): 90 | SO4[i]=abs(cat[i]-an[i])/d['SO4'] 91 | arcpy.AddMessage('SO4 created to make correct balance for station %s' %stid[i] ) 92 | elif Cl[i]==0 and (SO4[i] <> 0 and HCO3[i] <> 0): 93 | Cl[i]=abs(cat[i]-an[i])/d['Cl'] 94 | arcpy.AddMessage('Cl created to make correct balance for station %s' %stid[i] ) 95 | elif HCO3[i]==0 and (SO4[i] <> 0 and Cl[i] <> 0): 96 | HCO3[i]=abs(cat[i]-an[i])/d['HCO3'] 97 | arcpy.AddMessage('HCO3 created to make correct balance for station %s' %stid[i] ) 98 | #elif CO3[i]==0 and (HCO3[i]<>0 and SO4[i] <> 0 and Cl[i] <> 0): 99 | # CO3[i]=abs(cat[i]-an[i])/d['CO3'] 100 | # arcpy.AddMessage('CO3 created to make correct balance for station %s' %stid[i] ) 101 | else: 102 | arcpy.AddMessage('No missing anions to make correct balance for station %s' %stid[i]) 103 | else: 104 | arcpy.AddMessage('No changes made for station %s' %stid[i]) 105 | 106 | #define field order to add to table 107 | fields = [Na,K,Ca,Mg,Cl,HCO3,CO3,SO4,cb,stid] 108 | #transpose array from columns to rows for proper tool input 109 | inay = zip(*fields) 110 | 111 | # define field names and data types for the array 112 | dts = {'names': ('Na_new','K_new','Ca_new','Mg_new','Cl_new','HCO3_new','CO3_new','SO4_new','chgbal','stid1'), 'formats' : (np.float64, np.float64, np.float64, np.float64, np.float64, np.float64,np.float64,np.float64,np.float64,'|S256')} 113 | inarray = np.rec.fromrecords(inay,dtype = dts) 114 | 115 | # add fields to existing table by joining using the unique station id 116 | arcpy.da.ExtendTable(infile,arcpy.GetParameterAsText(1),inarray,'stid1') -------------------------------------------------------------------------------- /Charge_Balance/charge_balance_cb_only.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Thu Jun 19 10:19:00 2014 4 | 5 | @author: paulinkenbrandt 6 | """ 7 | 8 | import arcpy 9 | import numpy as np 10 | 11 | # input table having the fields Cl, HCO3, CO3, SO4, Na, K, Ca, Mg 12 | infile = arcpy.GetParameterAsText(0) 13 | 14 | # field having unique station identifier 15 | stid = arcpy.GetParameterAsText(1) 16 | 17 | # function to calculate charge balance 18 | # {'sodium': 'Na', 'potassium': 'K', 'bicarbonate': 'HCO3', 'carbonate': 'CO3', 'sulfate': 'SO4', 'nitrite': 'NO2', 'calcium': 'Ca', 'magnesium': 'Mg', 'nitrate': 'NO3', 'chloride': 'Cl'} 19 | def chrgbal(Ca,Mg,Na,K,Cl,HCO3,CO3,SO4,NO3,NO2): 20 | # Multipliers to convert from mg/l to meq/l 21 | d = {'Ca':0.04990269, 'Mg':0.082287595, 'Na':0.043497608, 'K':0.02557656, 'Cl':0.028206596, 'HCO3':0.016388838, 'CO3':0.033328223, 'SO4':0.020833333, 'NO2':0.021736513, 'NO3':0.016129032} 22 | cation = d['Ca']*Ca + d['Mg']*Mg + d['Na']*Na + d['K']*K 23 | anion = d['Cl']*Cl + d['HCO3']*HCO3 + d['CO3']*CO3 + d['SO4']*SO4 + d['NO3']*NO3 +d['NO2']*NO2 24 | balance = (cation-anion)/(cation + anion)*100 25 | #returns charge balance (%), cation total (meq/l), anion total (meq/l) 26 | return round(balance,2), cation, anion 27 | 28 | # import stuff from table; converts null values to zero for calculations 29 | arr = arcpy.da.TableToNumPyArray(infile, ('Cl', 'HCO3','CO3', 'SO4','Na','K','Ca','Mg','NO3',arcpy.GetParameterAsText(1)), null_value=0) 30 | 31 | 32 | nosamp = len(arr['Cl']) # Determine number of samples in file 33 | 34 | # Multipliers to convert from mg/l to meq/l 35 | d = {'Ca':0.04990269, 'Mg':0.082287595, 'Na':0.043497608, 'K':0.02557656, 'Cl':0.028206596, 'HCO3':0.016388838, 'CO3':0.033328223, 'SO4':0.020833333, 'NO2':0.021736513, 'NO3':0.016129032} 36 | 37 | 38 | # import major ions as arrays 39 | Cl = arr['Cl'] 40 | Mg = arr['Mg'] 41 | K = arr['K'] 42 | Ca = arr['Ca'] 43 | Na = arr['Na'] 44 | HCO3 =arr['HCO3'] 45 | CO3 = arr['CO3'] 46 | NaK = np.array([Na[i]+K[i] for i in range(nosamp)]) 47 | SO4 = arr['SO4'] 48 | NO3 = arr['NO3'] 49 | 50 | # Convert to meq/L and assign to variables 51 | Cl_meq = np.array([arr['Cl'][i]*d['Cl'] for i in range(nosamp)]) 52 | Mg_meq = np.array([arr['Mg'][i]*d['Mg'] for i in range(nosamp)]) 53 | K_meq = np.array([arr['K'][i]*d['K'] for i in range(nosamp)]) 54 | Ca_meq = np.array([arr['Ca'][i]*d['Ca'] for i in range(nosamp)]) 55 | Na_meq = np.array([arr['Na'][i]*d['Na'] for i in range(nosamp)]) 56 | HCO3_meq = np.array([arr['HCO3'][i]*d['HCO3'] for i in range(nosamp)]) 57 | CO3_meq = np.array([arr['CO3'][i]*d['CO3'] for i in range(nosamp)]) 58 | NaK_meq = np.array([Na_meq[i]+K_meq[i] for i in range(nosamp)]) 59 | SO4_meq = np.array([arr['SO4'][i]*d['SO4'] for i in range(nosamp)]) 60 | NO3_meq = np.array([arr['NO3'][i]*d['NO3'] for i in range(nosamp)]) 61 | 62 | # field having unique station identifier 63 | stid = arr[arcpy.GetParameterAsText(1)] 64 | 65 | # create zero arrays for charge balance funtion 66 | 67 | NO2 = [0]*nosamp 68 | 69 | #calculate charge balance for each sample 70 | cb = np.array([chrgbal(Ca[i],Mg[i],Na[i],K[i],Cl[i],HCO3[i],CO3[i],SO4[i],NO3[i],NO2[i])[0] for i in range(nosamp)]) 71 | anion = np.array([chrgbal(Ca[i],Mg[i],Na[i],K[i],Cl[i],HCO3[i],CO3[i],SO4[i],NO3[i],NO2[i])[2] for i in range(nosamp)]) 72 | cation = np.array([chrgbal(Ca[i],Mg[i],Na[i],K[i],Cl[i],HCO3[i],CO3[i],SO4[i],NO3[i],NO2[i])[1] for i in range(nosamp)]) 73 | 74 | 75 | 76 | #define field order to add to table 77 | fields = [Cl_meq, Mg_meq, K_meq, Ca_meq, Na_meq, HCO3_meq, CO3_meq, NaK_meq, SO4_meq, NO3_meq, anion, cation, cb, stid] 78 | #transpose array from columns to rows for proper tool input 79 | inay = zip(*fields) 80 | 81 | # define field names and data types for the array 82 | dts = {'names': ('chargebal','stid1'), 'formats' : (np.float64, np.float64, np.float64, np.float64, np.float64, np.float64, np.float64, np.float64, np.float64, np.float64, np.float64, np.float64,'|S256')} 83 | inarray = np.rec.fromrecords(inay,dtype = dts) 84 | 85 | # add fields to existing table by joining using the unique station id 86 | arcpy.da.ExtendTable(infile,arcpy.GetParameterAsText(1),inarray,'stid1') -------------------------------------------------------------------------------- /Line_Orientation/Line_Orientation.tbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Line_Orientation/Line_Orientation.tbx -------------------------------------------------------------------------------- /PLSS/CAD_TO_LATLONG.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Mon Feb 02 08:08:41 2015 4 | 5 | @author: paulinkenbrandt 6 | """ 7 | 8 | # Query Wells 9 | # http://gis.stackexchange.com/questions/29735/select-features-by-attribute-if-in-python-list 10 | 11 | import arcpy 12 | 13 | def qmatch(div): 14 | quarters={'NE':'a','NW':'b','SW':'c','SE':'d'} 15 | q = quarters.get(div) 16 | return q -------------------------------------------------------------------------------- /PLSS/CAD_TO_UTM.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Wed Feb 11 09:56:30 2015 4 | 5 | @author: paulinkenbrandt 6 | """ 7 | 8 | import arcpy 9 | import os 10 | 11 | table = arcpy.GetParameterAsText(0) #table of CAD coordinates you are seeking to assign utms 12 | field = arcpy.GetParameterAsText(1) #field within input table that contains the CAD coordinates 13 | trsLocal = arcpy.GetParameterAsText(2) #Location of TRS database 14 | 15 | arcpy.env.workspace = trsLocal 16 | 17 | 18 | 19 | arr = arcpy.da.TableToNumPyArray('QQQ3','quad') -------------------------------------------------------------------------------- /PLSS/CreateQLabels.py: -------------------------------------------------------------------------------- 1 | #-------------------------------------------------------------- 2 | # Purpose: Creates custom quarter section grid labels. 3 | # 4 | # Author: Ian Broad 5 | # Website: www.ianbroad.com 6 | # 7 | # Created: 04/21/2014 8 | #-------------------------------------------------------------- 9 | 10 | import arcpy 11 | 12 | arcpy.env.overwriteOutput = True 13 | 14 | polygon = arcpy.GetParameterAsText(0) 15 | labels = arcpy.GetParameterAsText(1) 16 | q_grid = arcpy.GetParameterAsText(2) 17 | output = arcpy.GetParameterAsText(3) 18 | 19 | #Assigning labels 20 | one, two, three, four = labels.split(", ") 21 | 22 | mem_point = arcpy.CreateFeatureclass_management("in_memory", "mem_point", "POINT", "", "DISABLED", "DISABLED", polygon) 23 | arcpy.AddField_management(mem_point, "GridLabel", "TEXT") 24 | 25 | result = arcpy.GetCount_management(polygon) 26 | count = int(result.getOutput(0)) 27 | 28 | arcpy.SetProgressor("step", "Creating Q Section Labels...", 0, count, 1) 29 | 30 | insert_cursor = arcpy.da.InsertCursor(mem_point, ["SHAPE@XY", "GridLabel"]) 31 | search_cursor = arcpy.da.SearchCursor(polygon, ["SHAPE@"]) 32 | 33 | for row in search_cursor: 34 | try: 35 | coordinateList = [] 36 | lowerLeft_distances = {} 37 | lowerRight_distances = {} 38 | upperLeft_distances = {} 39 | upperRight_distances = {} 40 | 41 | for part in row[0]: 42 | for pnt in part: 43 | if pnt: 44 | coordinateList.append((pnt.X, pnt.Y)) 45 | 46 | #Finds the extent of each polygon 47 | polygonExtent = row[0].extent 48 | 49 | lowerLeft_coordinate = polygonExtent.lowerLeft 50 | lowerRight_coordinate = polygonExtent.lowerRight 51 | upperLeft_coordinate = polygonExtent.upperLeft 52 | upperRight_coordinate = polygonExtent.upperRight 53 | 54 | lowerLeft_point = arcpy.PointGeometry(lowerLeft_coordinate) 55 | lowerRight_point = arcpy.PointGeometry(lowerRight_coordinate) 56 | upperLeft_point = arcpy.PointGeometry(upperLeft_coordinate) 57 | upperRight_point = arcpy.PointGeometry(upperRight_coordinate) 58 | 59 | #Finds the vertex closest to each corner of the polygon extent 60 | for vertex in coordinateList: 61 | vertex_coordinates = arcpy.Point(vertex[0], vertex[1]) 62 | vertex_point = arcpy.PointGeometry(vertex_coordinates) 63 | lowerLeft_distances[float(lowerLeft_point.distanceTo(vertex_point))] = (vertex[0], vertex[1]) 64 | 65 | for vertex in coordinateList: 66 | vertex_coordinates = arcpy.Point(vertex[0], vertex[1]) 67 | vertex_point = arcpy.PointGeometry(vertex_coordinates) 68 | lowerRight_distances[float(lowerRight_point.distanceTo(vertex_point))] = (vertex[0], vertex[1]) 69 | 70 | for vertex in coordinateList: 71 | vertex_coordinates = arcpy.Point(vertex[0], vertex[1]) 72 | vertex_point = arcpy.PointGeometry(vertex_coordinates) 73 | upperLeft_distances[float(upperLeft_point.distanceTo(vertex_point))] = (vertex[0], vertex[1]) 74 | 75 | for vertex in coordinateList: 76 | vertex_coordinates = arcpy.Point(vertex[0], vertex[1]) 77 | vertex_point = arcpy.PointGeometry(vertex_coordinates) 78 | upperRight_distances[float(upperRight_point.distanceTo(vertex_point))] = (vertex[0], vertex[1]) 79 | 80 | #Calculates approximate centroid of each quarter quarter section, it's ugly but good enough for now 81 | LLminDistance = min(lowerLeft_distances) 82 | LRminDistance = min(lowerRight_distances) 83 | ULminDistance = min(upperLeft_distances) 84 | URminDistance = min(upperRight_distances) 85 | 86 | top_left_X = upperLeft_distances[ULminDistance][0] 87 | top_left_Y = upperLeft_distances[ULminDistance][1] 88 | top_right_X = upperRight_distances[URminDistance][0] 89 | top_right_Y = upperRight_distances[URminDistance][1] 90 | 91 | bottom_left_X = lowerLeft_distances[LLminDistance][0] 92 | bottom_left_Y = lowerLeft_distances[LLminDistance][1] 93 | bottom_right_X = lowerRight_distances[LRminDistance][0] 94 | bottom_right_Y = lowerRight_distances[LRminDistance][1] 95 | 96 | top_half_X = float((top_left_X + top_right_X)/2.0) 97 | top_half_Y = float((top_left_Y + top_right_Y)/2.0) 98 | 99 | right_half_X = float((top_right_X + bottom_right_X)/2.0) 100 | right_half_Y = float((top_right_Y + bottom_right_Y)/2.0) 101 | 102 | left_half_X = float((top_left_X + bottom_left_X)/2.0) 103 | left_half_Y = float((top_left_Y + bottom_left_Y)/2.0) 104 | 105 | bottom_half_X = float((bottom_left_X + bottom_right_X)/2.0) 106 | bottom_half_Y = float((bottom_left_Y + bottom_right_Y)/2.0) 107 | 108 | one_X = float((top_left_X + top_half_X)/2.0) 109 | one_Y = float((top_left_Y + left_half_Y)/2.0) 110 | 111 | two_X = float((top_right_X + top_half_X)/2.0) 112 | two_Y = float((top_right_Y + right_half_Y)/2.0) 113 | 114 | three_X = float((bottom_left_X + bottom_half_X)/2.0) 115 | three_Y = float((bottom_left_Y + left_half_Y)/2.0) 116 | 117 | four_X = float((bottom_right_X + bottom_half_X)/2.0) 118 | four_Y = float((bottom_right_Y + right_half_Y)/2.0) 119 | 120 | insert_cursor.insertRow(((one_X, one_Y), one)) 121 | insert_cursor.insertRow(((two_X, two_Y), two)) 122 | insert_cursor.insertRow(((three_X, three_Y), three)) 123 | insert_cursor.insertRow(((four_X, four_Y), four)) 124 | 125 | arcpy.SetProgressorPosition() 126 | 127 | except Exception as e: 128 | print e.message 129 | 130 | del insert_cursor 131 | del search_cursor 132 | 133 | arcpy.SpatialJoin_analysis(q_grid, mem_point, output, "JOIN_ONE_TO_ONE", "KEEP_ALL", "", "CLOSEST") 134 | arcpy.Delete_management(mem_point) 135 | 136 | arcpy.ResetProgressor() 137 | arcpy.GetMessages() -------------------------------------------------------------------------------- /PLSS/CustomGridTools.tbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/PLSS/CustomGridTools.tbx -------------------------------------------------------------------------------- /PLSS/TRS.py: -------------------------------------------------------------------------------- 1 | import arcpy 2 | import os 3 | 4 | arcpy.env.workspace = arcpy.GetParameterAsText(4) 5 | target = arcpy.GetParameterAsText(0) 6 | out_coordinate_system = arcpy.SpatialReference(102059) 7 | 8 | projfc = arcpy.env.scratchGDB + os.path.sep + "projfc" 9 | 10 | arcpy.management.Project(target,projfc,out_coordinate_system) 11 | 12 | join = arcpy.GetParameterAsText(1) #PLSSQQSec 13 | join2 = arcpy.GetParameterAsText(2) #PLSSSec 14 | 15 | pntcent = arcpy.env.scratchGDB + os.path.sep + "pntcent" 16 | 17 | arcpy.FeatureToPoint_management(join,pntcent) 18 | out = "PLSSjn1" 19 | out2 = "PLSSjn2" 20 | out4 = arcpy.GetParameterAsText(3) 21 | 22 | out = arcpy.env.scratchGDB + os.path.sep + "out" 23 | out2 = arcpy.env.scratchGDB + os.path.sep + "out2" 24 | out3 = arcpy.env.scratchGDB + os.path.sep + "out3" 25 | 26 | arcpy.analysis.SpatialJoin(projfc,join,out) 27 | arcpy.analysis.SpatialJoin(out,join2,out2) 28 | arcpy.analysis.Near(out2,pntcent,angle = "ANGLE") 29 | arcpy.management.AddField(out2,"PLSS","TEXT","","","20") 30 | 31 | print "joins complete" 32 | 33 | # Calculate PLSS CAD field 34 | intable = out2 35 | fieldname = 'PLSS' 36 | expression = 'quarterfill(!TNUM!,!RNUM!,!SNUM!,!QNUM!,!SECDIVNO!,!NEAR_ANGLE!)' 37 | codeblock = ''' 38 | def quarterfill(tow, ran, sec, quad, x, a): 39 | g=x[0:2] 40 | h=x[2:4] 41 | m = {'NE':'a','NW':'b','SW':'c','SE':'d'} 42 | n = {1:'A',2:'B',3:'C',4:'D'} 43 | qq = m.get(g) or '' 44 | q = m.get(h) or '' 45 | j = n.get(quad) or '' 46 | if a > 90: 47 | qqq='d' 48 | elif a <-90: 49 | qqq='a' 50 | elif a < 90 and a > 0: 51 | qqq = 'c' 52 | elif a < 0 and a > -90: 53 | qqq = 'b' 54 | else: 55 | qqq = '' 56 | return '('+ str(j)+'-'+ str(int(tow)).rjust(2) + '-' + str(int(ran)).rjust(2)+')'+ str(int(sec)).rjust(2) + q + qq + qqq''' 57 | 58 | arcpy.CalculateField_management(intable, fieldname, expression, "PYTHON_9.3", codeblock) 59 | 60 | print 'cad complete' 61 | 62 | #Add XY coordinates in decimal degree format 63 | out3 = "PLSSProj" 64 | out_coordinate_system = arcpy.SpatialReference(4269) 65 | arcpy.Project_management(out2,out3,out_coordinate_system) 66 | arcpy.management.AddXY(out3) 67 | 68 | out_coordinate_system = arcpy.SpatialReference(102059) 69 | arcpy.Project_management(out3,out4,out_coordinate_system) 70 | arcpy.management.AddField(out4,"USGSStatID","TEXT","","","25") 71 | print 'proj complete' 72 | 73 | #Calculate Station ID field 74 | intable = out4 75 | fieldname = 'USGSStatID' 76 | expression = 'decdeg(!POINT_X!,!POINT_Y!)' 77 | codeblock = ''' 78 | def decdeg(x,y): 79 | degx = int(abs(x)) 80 | degy = int(abs(y)) 81 | tempx = 60* (abs(x) - degx) 82 | tempy = 60* (abs(y) - degy) 83 | minx = int(tempx) 84 | miny = int(tempy) 85 | secx = str(int(round(60*(tempx-minx),0))).zfill(2) 86 | secy = str(int(round(60*(tempy-miny),0))).zfill(2) 87 | return str(degy).zfill(2)+str(miny).zfill(2)+str(secy).zfill(2)+str(degx).zfill(2)+str(minx).zfill(2)+str(secx).zfill(2)''' 88 | 89 | arcpy.CalculateField_management(intable, fieldname, expression, "PYTHON_9.3", codeblock) 90 | 91 | #Delete intermediates 92 | arcpy.Delete_management(projfc) 93 | arcpy.Delete_management(pntcent) 94 | arcpy.Delete_management(out) 95 | arcpy.Delete_management(out2) 96 | arcpy.Delete_management(out3) 97 | 98 | arcpy.DeleteField_management(out4, "Join_Count;TARGET_FID;Join_Count_1;TARGET_FID_1;SECDIVID;FRSTDIVID;SECDIVNO;SECDIVSUF;SECDIVTYP;SECDIVTXT;ACRES;PLSSID;SECDIVLAB;SURVTYP;SURVTYPTXT;FRSTDIVID_1;TOWNSHIP;RANGE;SECTION;BASEMERIDIAN;FRSTDIVNO;FRSTDIVDUP;FRSTDIVTYP;FRSTDIVTXT;PLSSID_1;FRSTDIVLAB;SURVTYP_1;SURVTYPTXT_1;TNUM;RNUM;SNUM;QNUM;NEAR_FID;NEAR_DIST;NEAR_ANGLE") 99 | 100 | 101 | print "Processing Complete" 102 | -------------------------------------------------------------------------------- /PLSS/TRS_MODEL_NO_SDE.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # --------------------------------------------------------------------------- 3 | # TRS_MODEL_NO_SDE.py 4 | # Created on: 2014-06-25 13:45:25.00000 5 | # (generated by ArcGIS/ModelBuilder) 6 | # Usage: TRS_MODEL_NO_SDE 7 | # Description: 8 | # PLSS and CAD 9 | # --------------------------------------------------------------------------- 10 | 11 | # Set the necessary product code 12 | # import arcinfo 13 | 14 | 15 | # Import arcpy module 16 | import arcpy 17 | 18 | # Script arguments 19 | infeature = arcpy.GetParameterAsText(0) 20 | if infeature == '#' or not infeature: 21 | infeature = "infeature" # provide a default value if unspecified 22 | 23 | output = arcpy.GetParameterAsText(1) 24 | if output == '#' or not output: 25 | output = "C:\\Users\\PAULINKENBRANDT\\Documents\\ArcGIS\\Default.gdb\\projj21" # provide a default value if unspecified 26 | 27 | # Local variables: 28 | PLSSQQSec = "C:\\GIS\\TRS.gdb\\PLSSQQSec" 29 | PLSSSec = "C:\\GIS\\TRS.gdb\\PLSSSec" 30 | projj = infeature 31 | spajon1 = projj 32 | spajon2 = spajon1 33 | Output_Feature_Class = spajon2 34 | spajon21 = Output_Feature_Class 35 | spajon2__3_ = spajon21 36 | projj21 = spajon2__3_ 37 | projj21XY = projj21 38 | projjXYadd = projj21XY 39 | projj2__2_ = projjXYadd 40 | Near_Features = "C:\\GIS\\TRS.gdb\\PLSSQQPoints" 41 | 42 | desc =arcpy.Describe(infeature) 43 | refer = desc.SpatialReference 44 | 45 | # Process: Project 46 | arcpy.Project_management(infeature, projj, "PROJCS['NAD_1983_UTM_Zone_12N',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-111.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]", "",refer) 47 | 48 | # Process: Spatial Join 49 | arcpy.SpatialJoin_analysis(projj, PLSSSec, spajon1, "JOIN_ONE_TO_ONE", "KEEP_ALL") 50 | 51 | # Process: Spatial Join (2) 52 | arcpy.SpatialJoin_analysis(spajon1, PLSSQQSec, spajon2, "JOIN_ONE_TO_ONE", "KEEP_ALL") 53 | 54 | # Process: Near 55 | arcpy.Near_analysis(spajon2, Near_Features, "", "NO_LOCATION", "NO_ANGLE", "PLANAR") 56 | 57 | # Process: Add Field 58 | arcpy.AddField_management(Output_Feature_Class, "PLSS", "TEXT", "", "", "25", "", "NULLABLE", "NON_REQUIRED", "") 59 | 60 | codeblock = ''' 61 | def quarterfill(tow, ran, sec, quad, x, a): 62 | g=x[0:2] 63 | h=x[2:4] 64 | m = {'NE':'a','NW':'b','SW':'c','SE':'d'} 65 | n = {1:'A',2:'B',3:'C',4:'D'} 66 | qq = m.get(g) or '' 67 | q = m.get(h) or '' 68 | j = n.get(quad) or '' 69 | if a > 90: 70 | qqq='d' 71 | elif a <-90: 72 | qqq='a' 73 | elif a < 90 and a > 0: 74 | qqq = 'c' 75 | elif a < 0 and a > -90: 76 | qqq = 'b' 77 | else: 78 | qqq = '' 79 | return '('+ str(j)+'-'+ str(int(tow)).rjust(2) + '-' + str(int(ran)).rjust(2)+')'+ str(int(sec)).rjust(2) + q + qq + qqq''' 80 | 81 | # Process: Calculate Field 82 | arcpy.CalculateField_management(spajon21, "PLSS", "quarterfill(!TNUM!,!RNUM!,!SNUM!,!QNUM!,!SECDIVNO!,!NEAR_ANGLE!)", "PYTHON_9.3", codeblock) 83 | 84 | # Process: Project (2) 85 | arcpy.Project_management(spajon2__3_, projj21, "GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]", "", "") 86 | 87 | # Process: Add XY Coordinates 88 | arcpy.AddXY_management(projj21) 89 | 90 | # Process: Add Field (2) 91 | arcpy.AddField_management(projj21XY, "USGSCAD", "TEXT", "", "", "20", "", "NULLABLE", "NON_REQUIRED", "") 92 | 93 | codeblock = ''' 94 | def decdeg(x,y): 95 | degx = int(abs(x)) 96 | degy = int(abs(y)) 97 | tempx = 60* (abs(x) - degx) 98 | tempy = 60* (abs(y) - degy) 99 | minx = int(tempx) 100 | miny = int(tempy) 101 | secx = str(int(round(60*(tempx-minx),0))).zfill(2) 102 | secy = str(int(round(60*(tempy-miny),0))).zfill(2) 103 | return str(degy).zfill(2)+str(miny).zfill(2)+str(secy).zfill(2)+str(degx).zfill(2)+str(minx).zfill(2)+str(secx).zfill(2)''' 104 | 105 | 106 | # Process: Calculate Field (2) 107 | arcpy.CalculateField_management(projjXYadd, "USGSCAD", "decdeg(!POINT_X!,!POINT_Y!)", "PYTHON_9.3", codeblock) 108 | 109 | # Process: Delete Field 110 | arcpy.DeleteField_management(projj2__2_, "Join_Count;TARGET_FID;SECDIVID;FRSTDIVID_1;SECDIVNO;SECDIVSUF;SECDIVTYP;SECDIVTXT;ACRES;PLSSID_1;SECDIVLAB;SURVTYP_1;SURVTYPTXT_1;Join_Count_1;TARGET_FID_1;FRSTDIVID;TOWNSHIP;RANGE;SECTION;BASEMERIDIAN;FRSTDIVNO;FRSTDIVDUP;FRSTDIVTYP;FRSTDIVTXT;PLSSID;FRSTDIVLAB;SURVTYP;SURVTYPTXT;TNUM;RNUM;SNUM;QNUM;NEAR_FID;NEAR_DIST;NEAR_ANGLE") 111 | 112 | -------------------------------------------------------------------------------- /PLSS/USGS_COORD.tbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/PLSS/USGS_COORD.tbx -------------------------------------------------------------------------------- /Piper/Example.gdb.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb.zip -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000001.TablesByName.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000001.TablesByName.atx -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000001.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000001.gdbindexes -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000001.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000001.gdbtable -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000001.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000001.gdbtablx -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000002.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000002.gdbtable -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000002.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000002.gdbtablx -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000003.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000003.gdbindexes -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000003.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000003.gdbtable -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000003.gdbtablx: -------------------------------------------------------------------------------- 1 | $  -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000004.CatItemsByPhysicalName.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000004.CatItemsByPhysicalName.atx -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000004.CatItemsByType.atx: -------------------------------------------------------------------------------- 1 | {70737809-852C-4A03-9E22-2CECEA5B9BFA}{C673FE0F-7280-404F-8532-20755DD8FC06}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}& -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000004.FDO_UUID.atx: -------------------------------------------------------------------------------- 1 | {9AE41427-93A2-4F35-B0FC-1DDEB1D918E5}{A5E91841-7CA8-42EC-A66B-64807DC4BA41}{BD818227-090A-46A2-86E7-5001EFE2EEE8}& -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000004.freelist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000004.freelist -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000004.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000004.gdbindexes -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000004.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000004.gdbtable -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000004.gdbtablx: -------------------------------------------------------------------------------- 1 | ~aEC -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000004.spx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000004.spx -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000005.CatItemTypesByName.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000005.CatItemTypesByName.atx -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000005.CatItemTypesByParentTypeID.atx: -------------------------------------------------------------------------------- 1 | " 2 | " ! {00000000-0000-0000-0000-000000000000}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{8405ADD5-8DF8-4227-8FAC-3FCADE073386}{8405ADD5-8DF8-4227-8FAC-3FCADE073386}{8637F1ED-8C04-4866-A44A-1CB8288B3C63}{8637F1ED-8C04-4866-A44A-1CB8288B3C63}{D4912162-3413-476E-9DA4-2AEFBBC16939}{D4912162-3413-476E-9DA4-2AEFBBC16939}{D4912162-3413-476E-9DA4-2AEFBBC16939}{D4912162-3413-476E-9DA4-2AEFBBC16939}{FFD09C28-FE70-4E25-907C-AF8E8A5EC5F3}&" -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000005.CatItemTypesByUUID.atx: -------------------------------------------------------------------------------- 1 | "" 2 |  !   {28DA9E89-FF80-4D6D-8926-4EE2B161677D}{35B601F7-45CE-4AFF-ADB7-7702D3839B12}{4ED4A58E-621F-4043-95ED-850FBA45FCBC}{5B966567-FB87-4DDE-938B-B4B37423539D}{5ED667A3-9CA9-44A2-8029-D95BF23704B9}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{73718A66-AFB9-4B88-A551-CFFA0AE12620}{74737149-DCB5-4257-8904-B9724E32A530}{76357537-3364-48AF-A4BE-783C7C28B5CB}{767152D3-ED66-4325-8774-420D46674E07}{77292603-930F-475D-AE4F-B8970F42F394}{7771FC7D-A38B-4FD3-8225-639D17E9A131}{787BEA35-4A86-494F-BB48-500B96145B58}{8405ADD5-8DF8-4227-8FAC-3FCADE073386}{8637F1ED-8C04-4866-A44A-1CB8288B3C63}{8C368B12-A12E-4C7E-9638-C9C64E69E98F}{A300008D-0CEA-4F6A-9DFA-46AF829A3DF2}{A3803369-5FC2-4963-BAE0-13EFFC09DD73}{B606A7E1-FA5B-439C-849C-6E9C2481537B}{C29DA988-8C3E-45F7-8B5C-18E51EE7BEB4}{C673FE0F-7280-404F-8532-20755DD8FC06}{CD06BC3B-789D-4C51-AAFA-A467912B8965}{D4912162-3413-476E-9DA4-2AEFBBC16939}{D5A40288-029E-4766-8C81-DE3F61129371}{D86502F9-9758-45C6-9D23-6DD1A0107B47}{D98421EB-D582-4713-9484-43304D0810F6}{DB1B697A-3BB6-426A-98A2-6EE7A4C6AED3}{DC64B6E4-DC0F-43BD-B4F5-F22385DCF055}{DC9EF677-1AA3-45A7-8ACD-303A5202D0DC}{E6302665-416B-44FA-BE33-4E15916BA101}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}{F8413DCB-2248-4935-BFE9-315F397E5110}{FBDD7DD6-4A25-40B7-9A1A-ECC3D1172447}{FFD09C28-FE70-4E25-907C-AF8E8A5EC5F3}&" -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000005.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000005.gdbindexes -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000005.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000005.gdbtable -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000005.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000005.gdbtablx -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000006.CatRelsByDestinationID.atx: -------------------------------------------------------------------------------- 1 | {9AE41427-93A2-4F35-B0FC-1DDEB1D918E5}& -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000006.CatRelsByOriginID.atx: -------------------------------------------------------------------------------- 1 | {A5E91841-7CA8-42EC-A66B-64807DC4BA41}& -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000006.CatRelsByType.atx: -------------------------------------------------------------------------------- 1 | {DC78F1AB-34E4-43AC-BA47-1C4EABD0E7C7}& -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000006.FDO_UUID.atx: -------------------------------------------------------------------------------- 1 | {1383EBC5-E281-40CD-B9C0-A319D3541C28}& -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000006.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000006.gdbindexes -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000006.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000006.gdbtable -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000006.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000006.gdbtablx -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000007.CatRelTypesByBackwardLabel.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000007.CatRelTypesByBackwardLabel.atx -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000007.CatRelTypesByDestItemTypeID.atx: -------------------------------------------------------------------------------- 1 |   2 |   {28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{8405ADD5-8DF8-4227-8FAC-3FCADE073386}{8637F1ED-8C04-4866-A44A-1CB8288B3C63}{A300008D-0CEA-4F6A-9DFA-46AF829A3DF2}{CD06BC3B-789D-4C51-AAFA-A467912B8965}{CD06BC3B-789D-4C51-AAFA-A467912B8965}{D86502F9-9758-45C6-9D23-6DD1A0107B47}{D98421EB-D582-4713-9484-43304D0810F6}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}& -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000007.CatRelTypesByForwardLabel.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000007.CatRelTypesByForwardLabel.atx -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000007.CatRelTypesByName.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000007.CatRelTypesByName.atx -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000007.CatRelTypesByOriginItemTypeID.atx: -------------------------------------------------------------------------------- 1 |  2 |   {28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{4ED4A58E-621F-4043-95ED-850FBA45FCBC}{5B966567-FB87-4DDE-938B-B4B37423539D}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{73718A66-AFB9-4B88-A551-CFFA0AE12620}{74737149-DCB5-4257-8904-B9724E32A530}{76357537-3364-48AF-A4BE-783C7C28B5CB}{767152D3-ED66-4325-8774-420D46674E07}{7771FC7D-A38B-4FD3-8225-639D17E9A131}{7771FC7D-A38B-4FD3-8225-639D17E9A131}{A3803369-5FC2-4963-BAE0-13EFFC09DD73}{A3803369-5FC2-4963-BAE0-13EFFC09DD73}{D86502F9-9758-45C6-9D23-6DD1A0107B47}{D98421EB-D582-4713-9484-43304D0810F6}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}& -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000007.CatRelTypesByUUID.atx: -------------------------------------------------------------------------------- 1 |     2 |  {0D10B3A7-2F64-45E6-B7AC-2FC27BF2133C}{17E08ADB-2B31-4DCD-8FDD-DF529E88F843}{55D2F4DC-CB17-4E32-A8C7-47591E8C71DE}{583A5BAA-3551-41AE-8AA8-1185719F3889}{5DD0C1AF-CB3D-4FEA-8C51-CB3BA8D77CDB}{5F9085E0-788F-4354-AE3C-34C83A7EA784}{725BADAB-3452-491B-A795-55F32D67229C}{79CC71C8-B7D9-4141-9014-B6373E236ABB}{8DB31AF1-DF7C-4632-AA10-3CC44B0C6914}{908A4670-1111-48C6-8269-134FDD3FE617}{A1633A59-46BA-4448-8706-D8ABE2B2B02E}{B32B8563-0B96-4D32-92C4-086423AE9962}{CC28387C-441F-4D7C-A802-41A160317FE0}{D022DE33-45BD-424C-88BF-5B1B6B957BD3}{D088B110-190B-4229-BDF7-89FDDD14D1EA}{DC739A70-9B71-41E8-868C-008CF46F16D7}{DC78F1AB-34E4-43AC-BA47-1C4EABD0E7C7}{E79B44E3-F833-4B12-90A1-364EC4DDC43E}& -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000007.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000007.gdbindexes -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000007.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000007.gdbtable -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000007.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000007.gdbtablx -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000009.freelist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000009.freelist -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000009.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000009.gdbindexes -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000009.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000009.gdbtable -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000009.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000009.gdbtablx -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/a00000009.spx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/a00000009.spx -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/gdb: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Piper/Example.gdb/Example.gdb/timestamps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Example.gdb/Example.gdb/timestamps -------------------------------------------------------------------------------- /Piper/Piper.tbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Piper.tbx -------------------------------------------------------------------------------- /Piper/Piper.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Piper.zip -------------------------------------------------------------------------------- /Piper/Piper/Piper/Example.gdb.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Piper/Piper/Example.gdb.zip -------------------------------------------------------------------------------- /Piper/Piper/Piper/Piper.tbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Piper/Piper/Piper.tbx -------------------------------------------------------------------------------- /Piper/Piper/Piper/out.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/Piper/Piper/out.pdf -------------------------------------------------------------------------------- /Piper/out.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Piper/out.pdf -------------------------------------------------------------------------------- /PourPuff.tbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/PourPuff.tbx -------------------------------------------------------------------------------- /PourousPuff.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # --------------------------------------------------------------------------- 3 | # PourousPuff.py 4 | # Created on: 2015-10-05 16:55:42.00000 5 | # (generated by ArcGIS/ModelBuilder) 6 | # Usage: PourousPuff 7 | # Description: 8 | # --------------------------------------------------------------------------- 9 | 10 | # Import arcpy module 11 | import arcpy 12 | 13 | # Load required toolboxes 14 | arcpy.ImportToolbox("Model Functions") 15 | 16 | # Script arguments 17 | Thick30m = arcpy.GetParameterAsText(0) 18 | if Thick30m == '#' or not Thick30m: 19 | Thick30m = "C:\\PROJECTS\\MILLVILLE\\Data\\FlowModels.gdb\\Thick30m" # provide a default value if unspecified 20 | 21 | Poros3 = arcpy.GetParameterAsText(1) 22 | if Poros3 == '#' or not Poros3: 23 | Poros3 = "C:\\PROJECTS\\MILLVILLE\\Data\\FlowModels.gdb\\Poros3" # provide a default value if unspecified 24 | 25 | # Local variables: 26 | DarcyDir = "C:\\PROJECTS\\MILLVILLE\\Data\\FlowModels.gdb\\DarcyDir" 27 | DarcyMag = "C:\\PROJECTS\\MILLVILLE\\Data\\FlowModels.gdb\\DarcyMag" 28 | Value = "50" 29 | FLB_Value_ = "C:\\PROJECTS\\MILLVILLE\\Data\\FlowModels.gdb\\FLB%Value%" 30 | Particl_DarcyVe1_TXT = "C:\\Users\\PAULINKENBRANDT\\AppData\\Local\\ESRI\\Desktop10.3\\SpatialAnalyst\\Particl_DarcyDi1.TXT" 31 | PPB_Value_ = "C:\\PROJECTS\\MILLVILLE\\Data\\PPB%Value%" 32 | 33 | # Process: For 34 | arcpy.IterateCount_mb("50", "500", "50") 35 | 36 | # Process: Particle Track 37 | arcpy.gp.ParticleTrack_sa(DarcyDir, DarcyMag, "431910.55 4615423.59", Particl_DarcyVe1_TXT, "37.9732399999996", Value, FLB_Value_) 38 | 39 | # Process: Porous Puff 40 | arcpy.gp.PorousPuff_sa(Particl_DarcyVe1_TXT, Poros3, Thick30m, PPB_Value_, "10000000", "", "", "3", "1", "0") 41 | 42 | -------------------------------------------------------------------------------- /PourousPuff2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # --------------------------------------------------------------------------- 3 | # PourousPuff2.py 4 | # Created on: 2015-10-05 16:56:53.00000 5 | # (generated by ArcGIS/ModelBuilder) 6 | # Usage: PourousPuff2 7 | # Description: 8 | # --------------------------------------------------------------------------- 9 | 10 | # Import arcpy module 11 | import arcpy 12 | 13 | # Load required toolboxes 14 | arcpy.ImportToolbox("Model Functions") 15 | 16 | # Script arguments 17 | Thick30m = arcpy.GetParameterAsText(0) 18 | if Thick30m == '#' or not Thick30m: 19 | Thick30m = "C:\\PROJECTS\\MILLVILLE\\Data\\FlowModels.gdb\\Thick30m" # provide a default value if unspecified 20 | 21 | Poros3 = arcpy.GetParameterAsText(1) 22 | if Poros3 == '#' or not Poros3: 23 | Poros3 = "C:\\PROJECTS\\MILLVILLE\\Data\\FlowModels.gdb\\Poros3" # provide a default value if unspecified 24 | 25 | # Local variables: 26 | Input_groundwater_head_elevation_raster = "" 27 | Input_formation_transmissivity_raster = "" 28 | Output_direction_raster = "" 29 | Output_magnitude_raster = "" 30 | Value = "50" 31 | FLB_Value_ = "C:\\PROJECTS\\MILLVILLE\\Data\\FlowModels.gdb\\FLB%Value%" 32 | Particl_DarcyVe1_TXT = "" 33 | PPB_Value_ = "C:\\PROJECTS\\MILLVILLE\\Data\\PPB%Value%" 34 | 35 | # Process: Darcy Velocity 36 | arcpy.gp.DarcyVelocity_sa(Input_groundwater_head_elevation_raster, Poros3, Thick30m, Input_formation_transmissivity_raster, Output_direction_raster, Output_magnitude_raster) 37 | 38 | # Process: For 39 | arcpy.IterateCount_mb("50", "500", "50") 40 | 41 | # Process: Particle Track 42 | arcpy.gp.ParticleTrack_sa(Output_direction_raster, Output_magnitude_raster, "431910.55 4615423.59", Particl_DarcyVe1_TXT, "37.9732399999996", Value, FLB_Value_) 43 | 44 | # Process: Porous Puff 45 | arcpy.gp.PorousPuff_sa(Particl_DarcyVe1_TXT, Poros3, Thick30m, PPB_Value_, "10000000", "", "", "3", "1", "0") 46 | 47 | -------------------------------------------------------------------------------- /PourousPuff3.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # --------------------------------------------------------------------------- 3 | # PourousPuff3.py 4 | # Created on: 2015-10-05 16:59:14.00000 5 | # (generated by ArcGIS/ModelBuilder) 6 | # Usage: PourousPuff3 7 | # Description: 8 | # --------------------------------------------------------------------------- 9 | 10 | # Import arcpy module 11 | import arcpy 12 | 13 | arcpy.env.workspace ="C:/PROJECTS/MILLVILLE/Data/FlowModels.gdb" 14 | 15 | 16 | 17 | WLelevm = arcpy.GetParameterAsText(2) 18 | if WLelevm == '#' or not WLelevm: 19 | WLelevm = "WLelev" # provide a default value if unspecified 20 | 21 | desc = arcpy.Describe(WLelevm) 22 | outExtent = desc.extent 23 | rastProp = arcpy.GetRasterProperties_management(WLelevm,"CELLSIZEX") 24 | 25 | thickness = float(arcpy.GetParameterAsText(0)) 26 | if thickness == '#' or not thickness: 27 | thickness = 30 28 | 29 | porosity = float(arcpy.GetParameterAsText(1)) 30 | if porosity == '#' or not porosity: 31 | porosity = 0.20 32 | 33 | cellSize = rastProp.getOutput(0) 34 | arcpy.AddMessage("cell size =" + str(cellSize)) 35 | 36 | if arcpy.Exists("Thick"): 37 | arcpy.Delete_management("Thick") 38 | else: 39 | pass 40 | Thick = arcpy.sa.CreateConstantRaster(thickness, "FLOAT", cellSize, outExtent) 41 | Thick.save("Thick") 42 | 43 | if arcpy.Exists("Poros"): 44 | arcpy.Delete_management("Poros") 45 | else: 46 | pass 47 | 48 | Poros = arcpy.sa.CreateConstantRaster(porosity, "FLOAT", cellSize, outExtent) 49 | Poros.save("Poros") 50 | 51 | 52 | Trans = arcpy.GetParameterAsText(3) 53 | if Trans == '#' or not Trans: 54 | Trans = "Trans" # provide a default value if unspecified 55 | 56 | # Local variables: 57 | 58 | Particl_TXT = "C:\\PROJECTS\\MILLVILLE\\Data\\Particl_TXT" 59 | 60 | if arcpy.Exists("C:/PROJECTS/MILLVILLE/Data/DarcyDir.tif"): 61 | arcpy.Delete_management("C:/PROJECTS/MILLVILLE/Data/DarcyDir.tif") 62 | arcpy.Delete_management("C:/PROJECTS/MILLVILLE/Data/DarcyMag.tif") 63 | else: 64 | pass 65 | arcpy.CheckOutExtension("Spatial") 66 | Output_direction_raster = arcpy.sa.DarcyVelocity(WLelevm, Poros, Thick, Trans, "C:/PROJECTS/MILLVILLE/Data/DarcyMag.tif") 67 | Output_direction_raster.save("C:/PROJECTS/MILLVILLE/Data/DarcyDir.tif") 68 | 69 | 70 | tracking_times = range(int(arcpy.GetParameterAsText(4)),int(arcpy.GetParameterAsText(5)), int(arcpy.GetParameterAsText(6))) 71 | 72 | if arcpy.Exists(Particl_TXT): 73 | arcpy.Delete_management(Particl_TXT) 74 | else: 75 | pass 76 | 77 | for i in tracking_times: 78 | FL = "FL" + str(i) 79 | # Process: Particle Track 80 | arcpy.sa.ParticleTrack(Output_direction_raster,"C:/PROJECTS/MILLVILLE/Data/DarcyMag.tif", "431911 4615424", Particl_TXT, "30", str(i), FL) 81 | 82 | # Process: Porous Puff 83 | PP = arcpy.sa.PorousPuff(Particl_TXT, Poros, Thick, 1000000, "", "", 3, 1, 0) 84 | PP.save("PP"+str(i)) 85 | 86 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #EPA Exchange Network 2 | 3 | These scripts were developed to acheive goal 3 of [US EPA Exchange Network] (http://www.exchangenetwork.net/) grant 83547901: *Improving Access to Utah Water Chemistry Data*. 4 | 5 | 6 | ##ArcToolbox Scripts 7 | 8 | * These are script tools used in ArcGIS 10.2 and 10.3 mainly for the State of Utah 9 | 10 | * To use these tools in ArcGIS, fork this repository or click `Download ZIP` to the right of this readme. Once the files are on your computer, you can navigate to them in ArcCatalog. 11 | -------------------------------------------------------------------------------- /Stiff.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Stiff.zip -------------------------------------------------------------------------------- /Stiff/.ipynb_checkpoints/Untitled-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 0 6 | } 7 | -------------------------------------------------------------------------------- /Stiff/Example.gdb.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Stiff/Example.gdb.zip -------------------------------------------------------------------------------- /Stiff/Stiff.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Stiff/Stiff.JPG -------------------------------------------------------------------------------- /Stiff/Stiff.tbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Stiff/Stiff.tbx -------------------------------------------------------------------------------- /Theis.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis.zip -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000001.TablesByName.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000001.TablesByName.atx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000001.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000001.gdbindexes -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000001.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000001.gdbtable -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000001.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000001.gdbtablx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000002.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000002.gdbtable -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000002.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000002.gdbtablx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000003.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000003.gdbindexes -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000003.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000003.gdbtable -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000003.gdbtablx: -------------------------------------------------------------------------------- 1 | $  -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000004.CatItemsByPhysicalName.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000004.CatItemsByPhysicalName.atx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000004.CatItemsByType.atx: -------------------------------------------------------------------------------- 1 | {5ED667A3-9CA9-44A2-8029-D95BF23704B9}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{C673FE0F-7280-404F-8532-20755DD8FC06}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}& -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000004.FDO_UUID.atx: -------------------------------------------------------------------------------- 1 | {1A74A9B2-5D13-41F4-A812-12477800B85F}{57DC2024-06E1-43C9-B7D0-221BE86F61CD}{A1A864D0-2BCD-4111-8B58-E4F8A2815605}{E9A5E32E-59E5-4666-9C2F-91CBA621E09C}& -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000004.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000004.gdbindexes -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000004.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000004.gdbtable -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000004.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000004.gdbtablx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000004.spx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000004.spx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000005.CatItemTypesByName.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000005.CatItemTypesByName.atx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000005.CatItemTypesByParentTypeID.atx: -------------------------------------------------------------------------------- 1 | " 2 | !"   {00000000-0000-0000-0000-000000000000}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{77292603-930F-475D-AE4F-B8970F42F394}{8405ADD5-8DF8-4227-8FAC-3FCADE073386}{8405ADD5-8DF8-4227-8FAC-3FCADE073386}{8637F1ED-8C04-4866-A44A-1CB8288B3C63}{8637F1ED-8C04-4866-A44A-1CB8288B3C63}{D4912162-3413-476E-9DA4-2AEFBBC16939}{D4912162-3413-476E-9DA4-2AEFBBC16939}{D4912162-3413-476E-9DA4-2AEFBBC16939}{D4912162-3413-476E-9DA4-2AEFBBC16939}{FFD09C28-FE70-4E25-907C-AF8E8A5EC5F3}&" -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000005.CatItemTypesByUUID.atx: -------------------------------------------------------------------------------- 1 | "   !  2 | " {28DA9E89-FF80-4D6D-8926-4EE2B161677D}{35B601F7-45CE-4AFF-ADB7-7702D3839B12}{4ED4A58E-621F-4043-95ED-850FBA45FCBC}{5B966567-FB87-4DDE-938B-B4B37423539D}{5ED667A3-9CA9-44A2-8029-D95BF23704B9}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{73718A66-AFB9-4B88-A551-CFFA0AE12620}{74737149-DCB5-4257-8904-B9724E32A530}{76357537-3364-48AF-A4BE-783C7C28B5CB}{767152D3-ED66-4325-8774-420D46674E07}{77292603-930F-475D-AE4F-B8970F42F394}{7771FC7D-A38B-4FD3-8225-639D17E9A131}{787BEA35-4A86-494F-BB48-500B96145B58}{8405ADD5-8DF8-4227-8FAC-3FCADE073386}{8637F1ED-8C04-4866-A44A-1CB8288B3C63}{8C368B12-A12E-4C7E-9638-C9C64E69E98F}{A300008D-0CEA-4F6A-9DFA-46AF829A3DF2}{A3803369-5FC2-4963-BAE0-13EFFC09DD73}{B606A7E1-FA5B-439C-849C-6E9C2481537B}{C29DA988-8C3E-45F7-8B5C-18E51EE7BEB4}{C673FE0F-7280-404F-8532-20755DD8FC06}{CD06BC3B-789D-4C51-AAFA-A467912B8965}{D4912162-3413-476E-9DA4-2AEFBBC16939}{D5A40288-029E-4766-8C81-DE3F61129371}{D86502F9-9758-45C6-9D23-6DD1A0107B47}{D98421EB-D582-4713-9484-43304D0810F6}{DB1B697A-3BB6-426A-98A2-6EE7A4C6AED3}{DC64B6E4-DC0F-43BD-B4F5-F22385DCF055}{DC9EF677-1AA3-45A7-8ACD-303A5202D0DC}{E6302665-416B-44FA-BE33-4E15916BA101}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}{F8413DCB-2248-4935-BFE9-315F397E5110}{FBDD7DD6-4A25-40B7-9A1A-ECC3D1172447}{FFD09C28-FE70-4E25-907C-AF8E8A5EC5F3}&" -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000005.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000005.gdbindexes -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000005.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000005.gdbtable -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000005.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000005.gdbtablx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000006.CatRelsByDestinationID.atx: -------------------------------------------------------------------------------- 1 | {57DC2024-06E1-43C9-B7D0-221BE86F61CD}{E9A5E32E-59E5-4666-9C2F-91CBA621E09C}& -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000006.CatRelsByOriginID.atx: -------------------------------------------------------------------------------- 1 | {1A74A9B2-5D13-41F4-A812-12477800B85F}{1A74A9B2-5D13-41F4-A812-12477800B85F}& -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000006.CatRelsByType.atx: -------------------------------------------------------------------------------- 1 | {DC78F1AB-34E4-43AC-BA47-1C4EABD0E7C7}{DC78F1AB-34E4-43AC-BA47-1C4EABD0E7C7}& -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000006.FDO_UUID.atx: -------------------------------------------------------------------------------- 1 | {1993EA68-0121-4C8C-A85C-242C2AA26CD3}{B3A09241-2441-489D-B2D7-08928A9AEB73}& -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000006.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000006.gdbindexes -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000006.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000006.gdbtable -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000006.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000006.gdbtablx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000007.CatRelTypesByBackwardLabel.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000007.CatRelTypesByBackwardLabel.atx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000007.CatRelTypesByDestItemTypeID.atx: -------------------------------------------------------------------------------- 1 |    2 | {28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{8405ADD5-8DF8-4227-8FAC-3FCADE073386}{8637F1ED-8C04-4866-A44A-1CB8288B3C63}{A300008D-0CEA-4F6A-9DFA-46AF829A3DF2}{CD06BC3B-789D-4C51-AAFA-A467912B8965}{CD06BC3B-789D-4C51-AAFA-A467912B8965}{D86502F9-9758-45C6-9D23-6DD1A0107B47}{D98421EB-D582-4713-9484-43304D0810F6}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}& -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000007.CatRelTypesByForwardLabel.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000007.CatRelTypesByForwardLabel.atx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000007.CatRelTypesByName.atx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000007.CatRelTypesByName.atx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000007.CatRelTypesByOriginItemTypeID.atx: -------------------------------------------------------------------------------- 1 |  2 |    {28DA9E89-FF80-4D6D-8926-4EE2B161677D}{28DA9E89-FF80-4D6D-8926-4EE2B161677D}{4ED4A58E-621F-4043-95ED-850FBA45FCBC}{5B966567-FB87-4DDE-938B-B4B37423539D}{70737809-852C-4A03-9E22-2CECEA5B9BFA}{73718A66-AFB9-4B88-A551-CFFA0AE12620}{74737149-DCB5-4257-8904-B9724E32A530}{76357537-3364-48AF-A4BE-783C7C28B5CB}{767152D3-ED66-4325-8774-420D46674E07}{7771FC7D-A38B-4FD3-8225-639D17E9A131}{7771FC7D-A38B-4FD3-8225-639D17E9A131}{A3803369-5FC2-4963-BAE0-13EFFC09DD73}{A3803369-5FC2-4963-BAE0-13EFFC09DD73}{D86502F9-9758-45C6-9D23-6DD1A0107B47}{D98421EB-D582-4713-9484-43304D0810F6}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}{F3783E6F-65CA-4514-8315-CE3985DAD3B1}& -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000007.CatRelTypesByUUID.atx: -------------------------------------------------------------------------------- 1 |  2 |  {0D10B3A7-2F64-45E6-B7AC-2FC27BF2133C}{17E08ADB-2B31-4DCD-8FDD-DF529E88F843}{55D2F4DC-CB17-4E32-A8C7-47591E8C71DE}{583A5BAA-3551-41AE-8AA8-1185719F3889}{5DD0C1AF-CB3D-4FEA-8C51-CB3BA8D77CDB}{5F9085E0-788F-4354-AE3C-34C83A7EA784}{725BADAB-3452-491B-A795-55F32D67229C}{79CC71C8-B7D9-4141-9014-B6373E236ABB}{8DB31AF1-DF7C-4632-AA10-3CC44B0C6914}{908A4670-1111-48C6-8269-134FDD3FE617}{A1633A59-46BA-4448-8706-D8ABE2B2B02E}{B32B8563-0B96-4D32-92C4-086423AE9962}{CC28387C-441F-4D7C-A802-41A160317FE0}{D022DE33-45BD-424C-88BF-5B1B6B957BD3}{D088B110-190B-4229-BDF7-89FDDD14D1EA}{DC739A70-9B71-41E8-868C-008CF46F16D7}{DC78F1AB-34E4-43AC-BA47-1C4EABD0E7C7}{E79B44E3-F833-4B12-90A1-364EC4DDC43E}& -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000007.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000007.gdbindexes -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000007.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000007.gdbtable -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000007.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000007.gdbtablx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000009.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000009.gdbindexes -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000009.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000009.gdbtable -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000009.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000009.gdbtablx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a00000009.spx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a00000009.spx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000a.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a0000000a.gdbindexes -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000a.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a0000000a.gdbtable -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000a.gdbtablx: -------------------------------------------------------------------------------- 1 | D -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000a.spx: -------------------------------------------------------------------------------- 1 | @ -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000b.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a0000000b.gdbindexes -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000b.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a0000000b.gdbtable -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000b.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a0000000b.gdbtablx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000c.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a0000000c.gdbindexes -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000c.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a0000000c.gdbtable -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000c.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a0000000c.gdbtablx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000d.band_index.atx: -------------------------------------------------------------------------------- 1 | @ -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000d.blk_key_index.atx: -------------------------------------------------------------------------------- 1 | 000000010000000000 000000010100000000 ,  -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000d.col_index.atx: -------------------------------------------------------------------------------- 1 | @ -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000d.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a0000000d.gdbindexes -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000d.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a0000000d.gdbtable -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000d.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a0000000d.gdbtablx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000d.row_index.atx: -------------------------------------------------------------------------------- 1 | @ -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000e.gdbindexes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a0000000e.gdbindexes -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000e.gdbtable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a0000000e.gdbtable -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/a0000000e.gdbtablx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/a0000000e.gdbtablx -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/gdb: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Theis/Theis/Theis.gdb/timestamps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Theis.gdb/timestamps -------------------------------------------------------------------------------- /Theis/Theis/Toolbox.tbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/inkenbrandt/ArcPy/4a1c1f386e268d9b39c1734d4ef592e460e0059e/Theis/Theis/Toolbox.tbx -------------------------------------------------------------------------------- /Theis/Theis/theis.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Wed Mar 16 16:00:30 2016 4 | 5 | @author: paulinkenbrandt 6 | """ 7 | 8 | import numpy as np 9 | import os 10 | import scipy.special 11 | import arcpy 12 | from arcpy import env 13 | #import math 14 | 15 | #"CURRENT" #Set workspace as open map 16 | 17 | #points = "sample" 18 | #buff = 0.05 19 | #outFeatureClass = "aatest3" 20 | #pumpfield = "Q" 21 | # 22 | # Number of rows and columns together with origin and opposite corner 23 | # determine the size of each cell 24 | numRows = '150' 25 | numColumns = numRows 26 | #S = 0.005 27 | #T = 10000 28 | #t = 100 29 | #Inputs 30 | points = arcpy.GetParameterAsText(0) 31 | pumpfield = arcpy.GetParameterAsText(1) 32 | buff = float(arcpy.GetParameterAsText(2)) 33 | t = float(arcpy.GetParameterAsText(3)) 34 | T = float(arcpy.GetParameterAsText(4)) #vertical multiplier 35 | S = float(arcpy.GetParameterAsText(5)) #horizontal multiplier 36 | cellSize = float(arcpy.GetParameterAsText(6)) 37 | fileplace = arcpy.GetParameterAsText(7) 38 | outraster = arcpy.GetParameterAsText(8) 39 | 40 | outFeatureClass = outraster + "points" 41 | wellidfield = arcpy.Describe(points).OIDFieldName 42 | 43 | env.workspace = fileplace 44 | 45 | 46 | x, y = [], [] 47 | wellid = [] 48 | pump = [] 49 | 50 | for row in arcpy.da.SearchCursor(points, ["SHAPE@XY",wellidfield, pumpfield]): 51 | # Print x,y coordinates of each point feature 52 | x.append(row[0][0]) 53 | y.append(row[0][1]) 54 | wellid.append(row[1]) 55 | pump.append(row[2]) 56 | 57 | 58 | desc = arcpy.Describe(points) 59 | spatialref = desc.spatialReference 60 | 61 | meanx = np.average(x) 62 | meany = np.average(y) 63 | 64 | miny = np.min(y) 65 | minx = np.min(x) 66 | maxy = np.max(y) 67 | maxx = np.max(x) 68 | 69 | # Set coordinate system of the output fishnet 70 | env.outputCoordinateSystem = spatialref 71 | 72 | 73 | # Set the origin of the fishnet 74 | originCoordinate = str(minx-buff)+" "+str(miny-buff) 75 | 76 | # Set the orientation 77 | yAxisCoordinate = str(minx-buff)+" "+str(maxy+buff) 78 | 79 | 80 | # Enter 0 for width and height - these values will be calculated by the tool 81 | cellSizeWidth = '0'#str(cellSize*5) #'0' 82 | cellSizeHeight = '0'#str(cellSize*5) #'0' 83 | 84 | oppositeCoorner = str(maxx+buff)+" "+str(maxy+buff) 85 | 86 | # Create a point label feature class 87 | labels = 'LABELS' 88 | 89 | # Extent is set by origin and opposite corner - no need to use a template fc 90 | templateExtent = points 91 | 92 | # Each output cell will be a polygon 93 | geometryType = 'POLYGON' 94 | 95 | arcpy.CreateFishnet_management(outFeatureClass, originCoordinate, yAxisCoordinate, cellSizeWidth, cellSizeHeight, numRows, numColumns, oppositeCoorner, labels, templateExtent, geometryType) 96 | 97 | grid_points = outFeatureClass+"_label" 98 | 99 | 100 | with arcpy.da.InsertCursor(grid_points, ["SHAPE@XY"]) as cursor: 101 | # insert wells into grid 102 | for row in arcpy.da.SearchCursor(points, ["SHAPE@XY"]): 103 | xy = (row[0][0]+0.01,row[0][1]+0.01) 104 | cursor.insertRow([xy]) 105 | 106 | 107 | oid, gx, gy = [],[],[] 108 | 109 | grid_oid =arcpy.Describe(grid_points).OIDFieldName 110 | 111 | for row in arcpy.da.SearchCursor(grid_points, ["SHAPE@XY", grid_oid]): 112 | # Print x,y coordinates of each point feature 113 | # 114 | oid.append(row[1]) 115 | gx.append(row[0][0]) 116 | gy.append(row[0][1]) 117 | 118 | 119 | 120 | 121 | 122 | # adapted from: https://github.com/Applied-Groundwater-Modeling-2nd-Ed/Chapter_3_problems-1 123 | def well_function(u): 124 | return scipy.special.exp1(u) 125 | 126 | def theis(Q, T, S, r, t): 127 | u = r ** 2 * S / 4. / T / t 128 | s = Q / 4. / np.pi / T * well_function(u) 129 | return s 130 | 131 | 132 | hval = {} 133 | 134 | for j in range(len(x)): 135 | h = [] 136 | for i in range(len(gx)): 137 | dist = np.sqrt(np.power((x[j]-gx[i]),2)+np.power((y[j]-gy[i]),2)) 138 | # u = (np.power(dist,2)*S)/(4*T*t) 139 | # qpart = (pump[j]/(4.0*np.pi*T)) 140 | # lnpart = (-0.5772-np.log(u)+u-(np.power(u,2)/(2.0*np.math.factorial(2)))+(np.power(u,3)/(3*np.math.factorial(3)))-(np.power(u,4)/(4*np.math.factorial(4)))) 141 | 142 | h.append(theis(pump[j],T,S,dist,t)) 143 | hval[wellid[j]] = h 144 | 145 | alldraw = [] 146 | for i in range(len(gx)): 147 | sumdraw = 0 148 | for j in range(len(x)): 149 | sumdraw = hval[wellid[j]][i] + sumdraw 150 | alldraw.append(sumdraw) 151 | 152 | lines = [oid,gx,gy] 153 | typefields = [('idfield','= (int(arcpy.GetParameterAsText(8))*100+int(arcpy.GetParameterAsText(9))): 32 | # get the file name without extension (replaces the %Name% variable from ModelBuidler) 33 | ascFileName = os.path.splitext(ascFile)[0] 34 | # define the output file 35 | rastFile = env.workspace + '/' + ascFileName + 'o' 36 | ascinFile = env.workspace + '/' + ascFile 37 | arcpy.ASCIIToRaster_conversion(ascinFile, rastFile, 'INTEGER') 38 | 39 | if str(ischecked2) == 'true': 40 | # the following defines projections and clips the PRISM raster file 41 | imgFileList = arcpy.ListRasters() 42 | for imgFile in imgFileList: 43 | if int(imgFile[1:-1])>= (int(arcpy.GetParameterAsText(8))*100+int(arcpy.GetParameterAsText(9))): 44 | imgFileName = os.path.splitext(imgFile)[0] 45 | imgFile1 = env.workspace + '/' + imgFileName + 'p' 46 | incoords = arcpy.GetParameterAsText(4) 47 | # Process: Projektion definieren 48 | arcpy.DefineProjection_management(imgFile, incoords) 49 | outExtractByMask = ExtractByMask(imgFile, arcpy.GetParameterAsText(5)) 50 | outExtractByMask.save(imgFile1) 51 | arcpy.AddMessage("Clipped " +imgFileName) 52 | 53 | arcpy.AddMessage("Finished Clipping Data!") 54 | 55 | outcoord = arcpy.GetParameterAsText(6) 56 | 57 | 58 | ischecked3 = arcpy.GetParameterAsText(7) 59 | # the following projects the rasters and downsamples them 60 | if str(ischecked3) == 'true': 61 | prjFileList = arcpy.ListRasters() 62 | for prjFile in prjFileList: 63 | if int(prjFile[1:-1])>= (int(arcpy.GetParameterAsText(8))*100+int(arcpy.GetParameterAsText(9))): 64 | prjFileName = os.path.splitext(prjFile)[0] 65 | prjFile1 = outplace + '/' + prjFileName 66 | arcpy.ProjectRaster_management(prjFile, prjFile1 ,outcoord, "CUBIC", arcpy.GetParameterAsText(10)) 67 | arcpy.AddMessage("Projected and downsampled " +prjFileName) 68 | 69 | arcpy.AddMessage("Finished Downsampling Data!") 70 | 71 | # convert from mm to inches of ppt 72 | ischecked4 = arcpy.GetParameterAsText(11) 73 | if str(ischecked4) == 'true': 74 | env.workspace = outplace 75 | calcFileList = arcpy.ListRasters() 76 | for calcFile in calcFileList: 77 | if int(calcFile[1:-1])>= (int(arcpy.GetParameterAsText(8))*100+int(arcpy.GetParameterAsText(9))): 78 | # Overwrite pre-existing files 79 | arcpy.env.overwriteOutput = True 80 | calcFileName = os.path.splitext(calcFile)[0] 81 | calcFile1 = outplace + '/' + 'a' + calcFileName[1:-1] 82 | arcpy.Times_3d(calcFile,0.0393701,calcFile1) 83 | arcpy.AddMessage("Converted " + calcFileName + ' to inches') 84 | 85 | 86 | # Add Metadata Input 87 | ischecked5 = arcpy.GetParameterAsText(12) 88 | 89 | if str(ischecked5) == 'true': 90 | env.workspace = outplace 91 | metaFileList = arcpy.ListRasters('a*') 92 | for metafile in metaFileList: 93 | if int(metafile[1:-1])>= (int(arcpy.GetParameterAsText(8))*100+int(arcpy.GetParameterAsText(9))): 94 | metaplace = outplace + '/' + metafile 95 | metadata = md.MetadataEditor(metaplace) 96 | metadata.title.set('PRISM precipitation data (inches) ' + metafile[-3:-1] + ' ' + metafile[1:-3] ) # 97 | metadata.purpose.set('PRISM Raster File in Inches ' + metafile[-3:-1] + ' ' + metafile[1:-3]) 98 | metadata.abstract.append('PRISM Raster File in Inches ' + metafile[-3:-1] + ' ' + metafile[1:-3]) 99 | metadata.tags.add(["PRISM", "Precipitation", "Inches",metafile[-3:-1],metafile[1:-3] ]) # tags.extend is equivalent to maintain list semantics 100 | metadata.finish() # save the metadata back to the original source feature class and cleanup. Without calling finish(), your edits are NOT saved! 101 | arcpy.AddMessage("Added Metadata to " + metafile + ' to inches') 102 | 103 | 104 | -------------------------------------------------------------------------------- /prism/PRISM2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # --------------------------------------------------------------------------- 3 | # PRISM2.py 4 | # Created on: 2014-12-01 14:44:03.00000 5 | # (generated by ArcGIS/ModelBuilder) 6 | # Usage: PRISM2 7 | # Description: 8 | # --------------------------------------------------------------------------- 9 | 10 | # Import arcpy module 11 | import arcpy 12 | 13 | # Check out any necessary licenses 14 | arcpy.CheckOutExtension("spatial") 15 | 16 | # Load required toolboxes 17 | arcpy.ImportToolbox("Model Functions") 18 | 19 | # Script arguments 20 | clip_shp = arcpy.GetParameterAsText(0) 21 | if clip_shp == '#' or not clip_shp: 22 | clip_shp = "C:\\GIS\\PRISM\\S\\clip.shp" # provide a default value if unspecified 23 | 24 | Output_Coordinate_System = arcpy.GetParameterAsText(1) 25 | if Output_Coordinate_System == '#' or not Output_Coordinate_System: 26 | Output_Coordinate_System = "PROJCS['NAD_1983_UTM_Zone_12N',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-111.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]" # provide a default value if unspecified 27 | 28 | Geographic_Transformation = arcpy.GetParameterAsText(2) 29 | 30 | R = arcpy.GetParameterAsText(3) 31 | if R == '#' or not R: 32 | R = "C:\\GIS\\PRISM\\R" # provide a default value if unspecified 33 | 34 | Input_Coordinate_System = arcpy.GetParameterAsText(4) 35 | if Input_Coordinate_System == '#' or not Input_Coordinate_System: 36 | Input_Coordinate_System = "Unknown" # provide a default value if unspecified 37 | 38 | v_Name_ = arcpy.GetParameterAsText(5) 39 | if v_Name_ == '#' or not v_Name_: 40 | v_Name_ = "C:\\GIS\\PRISM\\R\\PRISM\\%Name%" # provide a default value if unspecified 41 | 42 | # Local variables: 43 | Raster = R 44 | v_name___3_ = Raster 45 | Name = R 46 | Resampling_Technique = "NEAREST" 47 | 48 | # Process: Iterate Rasters 49 | arcpy.IterateRasters_mb(R, "", "", "NOT_RECURSIVE") 50 | 51 | # Process: Project Raster 52 | arcpy.ProjectRaster_management(Raster, v_name___3_, Output_Coordinate_System, Resampling_Technique, "4358.61940021341", Geographic_Transformation, "", Input_Coordinate_System) 53 | 54 | # Process: Extract by Mask 55 | arcpy.gp.ExtractByMask_sa(v_name___3_, clip_shp, v_Name_) 56 | 57 | -------------------------------------------------------------------------------- /prism/PRISM_downsample.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Mon Dec 01 16:27:39 2014 4 | 5 | @author: paulinkenbrandt 6 | """ 7 | 8 | import arcpy 9 | import os 10 | from arcpy import env 11 | 12 | env.workspace = arcpy.GetParameterAsText(0) 13 | outplace = arcpy.GetParameterAsText(1) 14 | 15 | 16 | imgFileList = arcpy.ListRasters('*op') 17 | for imgFile in imgFileList: 18 | imgFileName = os.path.splitext(imgFile)[0] 19 | imgFile1 = env.workspace + '/' + imgFileName + 'p' 20 | arcpy.Resample_management(imgFile, imgFile1,arcpy.GetParameterAsText(2), "BILINEAR") -------------------------------------------------------------------------------- /prism/PRISM_zonal.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Mon Dec 01 16:38:46 2014 4 | 5 | @author: paulinkenbrandt 6 | """ 7 | 8 | import arcpy 9 | import os 10 | from arcpy import env 11 | from arcpy.sa import * 12 | 13 | env.workspace = arcpy.GetParameterAsText(0) 14 | imgFileList = arcpy.ListRasters('*opp') 15 | for imgFile in imgFileList: 16 | imgFileName = os.path.splitext(imgFile)[0] 17 | imgFile1 = env.workspace + '/' + imgFileName + 'z' 18 | outZSaT = ZonalStatisticsAsTable(GetParameterAsText(1), arcpy.GetParameterAsText(2), imgFile, imgFile1, "DATA", "ALL") 19 | arcpy.MakeFeatureLayer_management (GetParameterAsText(1), arcpy.GetParameterAsText(2)) 20 | arcpy.AddJoin_management(GetParameterAsText(1), arcpy.GetParameterAsText(2), imgFile1, arcpy.GetParameterAsText(2)) 21 | arcpy.CopyFeatures_management(GetParameterAsText(1), imgFile1+"join") 22 | arcpy.RemoveJoin_management(GetParameterAsText(1)) 23 | 24 | -------------------------------------------------------------------------------- /prism/PRISM_zonal2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # --------------------------------------------------------------------------- 3 | # PRISM_zonal2.py 4 | # Created on: 2014-12-09 14:53:45.00000 5 | # (generated by ArcGIS/ModelBuilder) 6 | # Usage: PRISM_zonal2 7 | # Description: 8 | # --------------------------------------------------------------------------- 9 | 10 | # Import arcpy module 11 | import arcpy 12 | 13 | # Check out any necessary licenses 14 | arcpy.CheckOutExtension("spatial") 15 | 16 | # Load required toolboxes 17 | arcpy.ImportToolbox("Model Functions") 18 | 19 | # Script arguments 20 | Zone_field = arcpy.GetParameterAsText(0) 21 | if Zone_field == '#' or not Zone_field: 22 | Zone_field = "ID" # provide a default value if unspecified 23 | 24 | v_Name_ = arcpy.GetParameterAsText(1) 25 | if v_Name_ == '#' or not v_Name_: 26 | v_Name_ = "C:\\GIS\\PRISM\\Table\\%Name%" # provide a default value if unspecified 27 | 28 | Wildcard = arcpy.GetParameterAsText(2) 29 | if Wildcard == '#' or not Wildcard: 30 | Wildcard = "a30*" # provide a default value if unspecified 31 | 32 | HUCS = arcpy.GetParameterAsText(3) 33 | if HUCS == '#' or not HUCS: 34 | HUCS = "U:\\GWP\\Groundwater\\PowderMt\\Powder_Mtn.gdb\\Watershed" # provide a default value if unspecified 35 | 36 | Downsampled = arcpy.GetParameterAsText(4) 37 | if Downsampled == '#' or not Downsampled: 38 | Downsampled = "C:\\GIS\\PRISM\\Downsampled" # provide a default value if unspecified 39 | 40 | # Local variables: 41 | Raster = Downsampled 42 | Name = Downsampled 43 | 44 | # Process: Iterate Rasters 45 | arcpy.IterateRasters_mb(Downsampled, Wildcard, "", "NOT_RECURSIVE") 46 | 47 | # Process: Zonal Statistics as Table 48 | arcpy.gp.ZonalStatisticsAsTable_sa(HUCS, Zone_field, Raster, v_Name_, "DATA", "ALL") 49 | 50 | -------------------------------------------------------------------------------- /prism/PRISM_zonal3.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Tue Dec 16 06:58:20 2014 4 | 5 | @author: paulinkenbrandt 6 | """ 7 | 8 | import arcpy 9 | import os 10 | from arcpy import env 11 | from arcpy.sa import * 12 | 13 | 14 | outplace = arcpy.GetParameterAsText(0) 15 | env.workspace = outplace 16 | 17 | def setdefaultvalue(variable, default): 18 | '''fills in default value when user does not input one''' 19 | if variable =='#' or not variable: 20 | return default 21 | else: 22 | return variable 23 | 24 | HUCS = setdefaultvalue(arcpy.GetParameterAsText(1),"U:\\GWP\\Groundwater\\PowderMt\\Powder_Mtn.gdb\\Base\\Watershed") 25 | 26 | ## Clip File to HUCS 27 | runclipper = arcpy.GetParameterAsText(5) 28 | imgFileList = arcpy.ListRasters() 29 | outrasterdest = arcpy.GetParameterAsText(4) 30 | if str(runclipper) == 'true': 31 | for imgFile in imgFileList: 32 | # set start year and start month for processing 33 | rasteryear = setdefaultvalue(int(arcpy.GetParameterAsText(2)), 1895) 34 | rastermonth = setdefaultvalue(int(arcpy.GetParameterAsText(3)), 1) 35 | # skip files younger than start year and month 36 | if int(imgFile[1:])>= (rasteryear*100+rastermonth): 37 | imgFileName = os.path.splitext(imgFile)[0] 38 | imgFile1 = outrasterdest + '/' + imgFileName 39 | outExtractByMask = ExtractByMask(imgFile, arcpy.GetParameterAsText(1)) 40 | outExtractByMask.save(imgFile1) 41 | arcpy.AddMessage("Clipped " +imgFileName) 42 | 43 | env.workspace = outrasterdest 44 | 45 | zoneFileList = arcpy.ListRasters() 46 | for zoneFile in zoneFileList: 47 | # set start year and start month for processing 48 | rasteryear = setdefaultvalue(int(arcpy.GetParameterAsText(2)), 1895) 49 | rastermonth = setdefaultvalue(int(arcpy.GetParameterAsText(3)), 1) 50 | # skip files younger than start year and month 51 | if int(os.path.splitext(zoneFile[1:])[0])>= (rasteryear*100+rastermonth): 52 | # Execute RasterToPoint 53 | arcpy.env.overwriteOutput = True 54 | outsheds = outrasterdest + "/sheds"+zoneFile[1:]+".shp" 55 | points = arcpy.CreateFeatureclass_management("in_memory","FC"+zoneFile,"POINT") 56 | 57 | points = arcpy.RasterToPoint_conversion(zoneFile, points, "VALUE") 58 | 59 | arcpy.AddMessage("Pointillized " +zoneFile) 60 | # Create a new fieldmappings and add the two input feature classes. 61 | fieldmappings = arcpy.FieldMappings() 62 | fieldmappings.addTable(HUCS) 63 | fieldmappings.addTable(points) 64 | pointFieldIndex = fieldmappings.findFieldMapIndex("grid_code") 65 | fieldmap = fieldmappings.getFieldMap(pointFieldIndex) 66 | 67 | # Get the output field's properties as a field object 68 | field = fieldmap.outputField 69 | # Rename the field and pass the updated field object back into the field map 70 | field.name = "a"+ zoneFile[1:] 71 | field.aliasName = "a"+ zoneFile[1:] 72 | fieldmap.outputField = field 73 | 74 | # Set the merge rule to mean and then replace the old fieldmap in the mappings object 75 | # with the updated one 76 | fieldmap.mergeRule = "mean" 77 | fieldmappings.replaceFieldMap(pointFieldIndex, fieldmap) 78 | # Delete fields that are no longer applicable, such as city CITY_NAME and CITY_FIPS 79 | # as only the first value will be used by default 80 | try: 81 | x = fieldmappings.findFieldMapIndex("Join_Count") 82 | fieldmappings.removeFieldMap(x) 83 | y = fieldmappings.findFieldMapIndex("TARGET_FID") 84 | fieldmappings.removeFieldMap(y) 85 | except (RuntimeError, TypeError, NameError, ValueError): 86 | pass 87 | 88 | arcpy.AddMessage("Field Mapped " +zoneFile) 89 | 90 | arcpy.SpatialJoin_analysis(HUCS,points, outsheds,"JOIN_ONE_TO_ONE","#",fieldmappings, "INTERSECT") 91 | arcpy.AddMessage("Joined and created " + outsheds) 92 | arcpy.CopyFeatures_management(outsheds, HUCS) 93 | arcpy.Delete_management(outsheds) -------------------------------------------------------------------------------- /zonal_extractor.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on Tue Dec 16 06:58:20 2014 4 | 5 | @author: paulinkenbrandt 6 | """ 7 | 8 | import arcpy 9 | import os 10 | from arcpy import env 11 | from arcpy.sa import * 12 | 13 | 14 | outplace = arcpy.GetParameterAsText(0) 15 | env.workspace = outplace 16 | 17 | def setdefaultvalue(variable, default): 18 | '''fills in default value when user does not input one''' 19 | if variable =='#' or not variable: 20 | return default 21 | else: 22 | return variable 23 | 24 | HUCS = setdefaultvalue(arcpy.GetParameterAsText(1),"U:\\GWP\\Groundwater\\PowderMt\\Powder_Mtn.gdb\\Base\\Watershed") 25 | 26 | ## Clip File to HUCS 27 | runclipper = arcpy.GetParameterAsText(5) 28 | imgFileList = arcpy.ListRasters() 29 | outrasterdest = arcpy.GetParameterAsText(4) 30 | if str(runclipper) == 'true': 31 | for imgFile in imgFileList: 32 | # set start year and start month for processing 33 | rasteryear = setdefaultvalue(int(arcpy.GetParameterAsText(2)), 1895) 34 | rastermonth = setdefaultvalue(int(arcpy.GetParameterAsText(3)), 1) 35 | # skip files younger than start year and month 36 | if int(imgFile[1:])>= (rasteryear*100+rastermonth): 37 | imgFileName = os.path.splitext(imgFile)[0] 38 | imgFile1 = outrasterdest + '/' + imgFileName 39 | outExtractByMask = ExtractByMask(imgFile, arcpy.GetParameterAsText(1)) 40 | outExtractByMask.save(imgFile1) 41 | arcpy.AddMessage("Clipped " +imgFileName) 42 | 43 | env.workspace = outrasterdest 44 | 45 | zoneFileList = arcpy.ListRasters() 46 | for zoneFile in zoneFileList: 47 | # set start year and start month for processing 48 | rasteryear = setdefaultvalue(int(arcpy.GetParameterAsText(2)), 1895) 49 | rastermonth = setdefaultvalue(int(arcpy.GetParameterAsText(3)), 1) 50 | # skip files younger than start year and month 51 | if int(os.path.splitext(zoneFile[1:])[0])>= (rasteryear*100+rastermonth): 52 | # Execute RasterToPoint 53 | arcpy.env.overwriteOutput = True 54 | outsheds = outrasterdest + "/sheds"+zoneFile[1:]+".shp" 55 | points = arcpy.CreateFeatureclass_management("in_memory","FC"+zoneFile,"POINT") 56 | 57 | points = arcpy.RasterToPoint_conversion(zoneFile, points, "VALUE") 58 | 59 | arcpy.AddMessage("Pointillized " +zoneFile) 60 | # Create a new fieldmappings and add the two input feature classes. 61 | fieldmappings = arcpy.FieldMappings() 62 | fieldmappings.addTable(HUCS) 63 | fieldmappings.addTable(points) 64 | pointFieldIndex = fieldmappings.findFieldMapIndex("grid_code") 65 | fieldmap = fieldmappings.getFieldMap(pointFieldIndex) 66 | 67 | # Get the output field's properties as a field object 68 | field = fieldmap.outputField 69 | # Rename the field and pass the updated field object back into the field map 70 | field.name = "a"+ zoneFile[1:] 71 | field.aliasName = "a"+ zoneFile[1:] 72 | fieldmap.outputField = field 73 | 74 | # Set the merge rule to mean and then replace the old fieldmap in the mappings object 75 | # with the updated one 76 | fieldmap.mergeRule = "mean" 77 | fieldmappings.replaceFieldMap(pointFieldIndex, fieldmap) 78 | # Delete fields that are no longer applicable, such as city CITY_NAME and CITY_FIPS 79 | # as only the first value will be used by default 80 | try: 81 | x = fieldmappings.findFieldMapIndex("Join_Count") 82 | fieldmappings.removeFieldMap(x) 83 | y = fieldmappings.findFieldMapIndex("TARGET_FID") 84 | fieldmappings.removeFieldMap(y) 85 | z = fieldmappings.findFieldMapIndex("Shape_Leng") 86 | fieldmappings.removeFieldMap(y) 87 | except (RuntimeError, TypeError, NameError, ValueError): 88 | pass 89 | 90 | arcpy.AddMessage("Field Mapped " +zoneFile) 91 | 92 | arcpy.SpatialJoin_analysis(HUCS,points, outsheds,"JOIN_ONE_TO_ONE","#",fieldmappings, "INTERSECT") 93 | arcpy.AddMessage("Joined and created " + outsheds) 94 | HUCS = arcpy.CopyFeatures_management(outsheds, HUCS) 95 | #arcpy.DeleteFeatures_management(outsheds) 96 | --------------------------------------------------------------------------------