AnsweredAssumed Answered

Kriging command from python ignores cell size?

Question asked by roemhildtg on Jun 20, 2018
Latest reply on Jun 20, 2018 by roemhildtg

I'm working on creating a batch kriging tool using the Emperical Bayesian Kriging tool. When I run the tool in ArcGIS pro on a selected set of features, the tool runs and creates a nice looking output raster. It looks like this:

 

But when I copy that exact tool output from a python window, I get the following code:

 

arcpy.ga.EmpiricalBayesianKriging("pond_depth_points", "Water_dept", "point_geostat", r"K:\01696-360\GIS\Maps\2018 Pond Assessment\2018 Pond Assessment.gdb\pond_empbkrig_1", 0.0001953125, "NONE", 100, 1, 100, "NBRTYPE=StandardCircular RADIUS=0.028516880589107 ANGLE=0 NBR_MAX=15 NBR_MIN=10 SECTOR_TYPE=ONE_SECTOR", "PREDICTION", 0.5, "EXCEED", None, "POWER")


# which I translate to this in my layer loop:

def create_raster(points, workspace, row_data, depth_field):
    raster_name = "kriging_{0}".format(row_data[0])
    try:
        # raster = arcpy.Kriging_3d(points, depth_field, join(workspace, raster_name), "Spherical ,0.000005", 0.0000953125, "Variable 12")
        # arcpy.ddd.Kriging(points, depth_field, join(workspace, raster_name), "Spherical 0.000195 # # #", 0.0001953125, "VARIABLE 12 0.00015", None)
        # raster = arcpy.Kriging_3d(points, depth_field, join(workspace, raster_name),"Spherical 0.2", "0.2", "VARIABLE 8", "")

        output_filename = join(workspace, raster_name)
        output_geostat = 'point_geostat'
        cell_size = 0.0001953125
        transformation = "NONE"
        max_points = 100
        local_overlap_factor = 1
        simulated_semio = 100
        search_neighborhood = "NBRTYPE=StandardCircular RADIUS=0.028516880589107 ANGLE=0 NBR_MAX=15 NBR_MIN=10 SECTOR_TYPE=ONE_SECTOR"
        output_type = "PREDICTION"
        semio_model_type = "POWER"

        arcpy.ga.EmpiricalBayesianKriging(points, depth_field, output_geostat, output_filename,
            cell_size, transformation, max_points,
            local_overlap_factor, simulated_semio,  search_neighborhood,
            "PREDICTION", 0.5, "EXCEED", None, semio_model_type)

When I run this tool and add the output raster to the map, the output raster looks like this. I also noticed the output of the above tool when added to the map also looks like this. Why? Am I doing something wrong here?

Outcomes