Using certain Geostatistical Wizard tools from a Python script?

4424
2
Jump to solution
12-04-2013 02:23 PM
JacobDeAngelo
New Contributor
Hi All,

I would like to set up a python script (or a custom tool using a python script) that will create a set of surfaces for any given point set I input into my script.  I am using 10.1, but could upgrade to 10.2 if newer tools would be better suited.  For now, I want this tool to create one RBF (Radial Basis Functions) surface and one Kriging surface.  I will want a raster output but possibly also a geostatistical layer output as well.

I want to call the geostatistical analyst tools (RBF & Kriging) in my python script.  I will be able to hardwire or custom-call certain parameters of the geostatistical analyst tools but I want to be able to pull in the default or optimized values as calculated in the geostatistical wizard or in the tools themselves.  For example with RBF:

I can hardwire or custom-call in: input/output features, zfield, max/min neighbors, sector type, function (spline, ect)

But I want certain parameters to be dependent on the data set I am putting into the tool (semiaxes, cellsize, kernel parameter value).

RBF questions:

When one uses the radial basis functions tool in the geostatistical analyst tools, a default major and minor semiaxis are automatically calculated and entered into the menu when data is placed in the 'input features' box.  A cell size is also suggested.  Could these parameters be called from a python script somehow?  I assume both are just looking at the spatial extent of the data and assigning a default based on it, but I would really like to know how to calculate a reasonable semiaxis value. Cell size is less important.

The kernel parameter: It seems that the RBF tool from geostatistical analyst tools will use the 'optimized kernel parameter value' for any surface you put into it.  Is this true?  An example to explain: When I change sector type to 8-sector (from default 1-sector) in the GA wizard, a new kernel parameter value will be calculated if I hit the button to optimize the kernel parameter.  I noticed the GA layer outputted from RBF toolbox tool had the same kernel value as the value in the GA wizard after you hit the optimize button.  From this I deduce that the RBF tool in the geostatistical analyst tools toolbox will autmoatically calculate & use the optimized value for whatever input parameters you put in.  Is this correct? 

Kriging questions:

How can you run kriging from the toolbox?  I don't see any variogram tools in the 'Empirical Baysian Kriging' tool (or moving window)

I'd like to use the default values the GA wizard would give when looking at input data for variogram values & neighborhood values in a python script.  Can this be done? 

This might seem like a lot of questions, but what I want is pretty simple.  I want to have a tool that I can drop any data set into and have some basic standard surfaces come out.  Thanks to All,

Jake
0 Kudos
1 Solution

Accepted Solutions
EricKrause
Esri Regular Contributor
The default major/minor semiaxes are calculated as one quarter of the diagonal extent of the input points (because we also use minimum and maximum neighbors, this parameter is not very important).  The default cell size is calculated as the smaller of the width and height of the input data extent, divided by 250.  You can expose these as parameters in your script tool so that the defaults can be overridden. 

About the kernel parameter, you are correct that it is optimized to find the minimum root-mean-square crossvalidation error, treating all other parameters as fixed.  When you change a different parameter, you will get a new optimal kernel parameter that reflects the change in the other parameter.

Empirical Bayesian Kriging does variography automatically, which is why it is available as a geoprocessing tool.  No interactive variography is required, and we suggest using EBK for automation of kriging.  It is easier to automate, and it is more trustworthy when run blindly.

If you still want to automate kriging (other than EBK) as it is implemented in the Geostatistical Wizard, you should start by reading this topic: http://forums.arcgis.com/threads/92508-Need-Help-Automation-of-Kriging-using-Model-builder-or-python....

It's quite long, and a lot of it won't apply to you, but all the information about automating kriging is in there.  The only difference is that if you're using 10.1, you won't be able to use the GeostatisticalDatasets arcpy class.  You should consider upgrading to make this workflow easier.  If you don't upgrade, you'll have to pass the new datasets as comma- and semicolon-delineated strings.

View solution in original post

0 Kudos
2 Replies
EricKrause
Esri Regular Contributor
The default major/minor semiaxes are calculated as one quarter of the diagonal extent of the input points (because we also use minimum and maximum neighbors, this parameter is not very important).  The default cell size is calculated as the smaller of the width and height of the input data extent, divided by 250.  You can expose these as parameters in your script tool so that the defaults can be overridden. 

About the kernel parameter, you are correct that it is optimized to find the minimum root-mean-square crossvalidation error, treating all other parameters as fixed.  When you change a different parameter, you will get a new optimal kernel parameter that reflects the change in the other parameter.

Empirical Bayesian Kriging does variography automatically, which is why it is available as a geoprocessing tool.  No interactive variography is required, and we suggest using EBK for automation of kriging.  It is easier to automate, and it is more trustworthy when run blindly.

If you still want to automate kriging (other than EBK) as it is implemented in the Geostatistical Wizard, you should start by reading this topic: http://forums.arcgis.com/threads/92508-Need-Help-Automation-of-Kriging-using-Model-builder-or-python....

It's quite long, and a lot of it won't apply to you, but all the information about automating kriging is in there.  The only difference is that if you're using 10.1, you won't be able to use the GeostatisticalDatasets arcpy class.  You should consider upgrading to make this workflow easier.  If you don't upgrade, you'll have to pass the new datasets as comma- and semicolon-delineated strings.
0 Kudos
JacobDeAngelo
New Contributor
Eric,

Thanks- great reply.  You answered all my questions relating to RBF.  That post you linked me to does a good job with all the Kriging questions.  I'll post back if I need help, but I think you covered it all. 

Cheers,

Jake
0 Kudos