AnsweredAssumed Answered

Automating Empirical Bayesian Kriging

Question asked by danacarstens on Mar 16, 2018
Latest reply on Mar 16, 2018 by slynch-esristaff

Hello, 

 

I am trying to write a Python script that will apply empirical bayesian kriging to >120 columns of water quality data. Each column is representative of a different month in either 1985 and 2015. I've gotten the script below to work successfully in ArcMap but it is producing temporary layers that go away once I close the program. How can I modify my script so that I can set a standard symbology for each layer produced and have it exported as a jpeg (or tif.) to some specified folder? Thank you!

 


import arcpy
from arcpy import env
import arcpy, os
from arcpy.sa import *

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Check out the ArcGIS Geostatistical Analyst extension license
arcpy.CheckOutExtension("GeoStats")


# Set workspace
env.workspace = r"K:/Research/2018 GIS"

# Set local variables
inPointFeatures = r"K:/Research/2018 GIS/DO_data.shp" # input shapefile
zFields = arcpy.ListFields("DO_data.shp",field_type="Double")


# EBK Veriables
outRaster = ""
inPointFeatures = "DO_data.shp"
cellSize = 8.60966128128307E-03
transformation = "NONE"
maxLocalPoints = 100
overlapFactor = 1
numberSemivariograms = 100

# Set variables for search neighborhood
searchNeighbourhood = "NBRTYPE=SmoothCircular RADIUS=0.474897239843659 SMOOTH_FACTOR=0.2"
outputType = "PREDICTION"
quantileValue = 0.5
thresholdType = "EXCEED"
probabilityThreshold = ""
semivariogram = "POWER"


for zField in zFields[3:]: #loop on the fields while ignoring the first three fields
outLayer = str(zField) + ".shp"
OutEBK = arcpy.EmpiricalBayesianKriging_ga(inPointFeatures, zField.name, outLayer, outRaster, cellSize, transformation, maxLocalPoints,overlapFactor, numberSemivariograms, searchNeighbourhood, outputType, quantileValue, thresholdType, probabilityThreshold, semivariogram)

Outcomes