Automatically generate anisotropic semivariogram parameters

3910
5
Jump to solution
01-21-2013 01:15 PM
AndreaEvans
New Contributor
Hello,

I am just starting to learn how to work with ArcGIS, and I am specifically trying to automatically generate anisotropic semivariogram parameters for a series of data sets, which I can then output for subsequent use. I have managed to do this with isotropic semivariogram parameters, by first creating a geostatistical model manually, and then using the moving window kriging function to generate the semivariogram parameters automatically based on the created model. I need to process a few hundred data sets, so manually generating the parameters all of the time will not work for me.

Is there a way to get the moving window kirging function to estimate anisotropic semivariogram parameters? If not, is there any other way to automatically estimate these parameters? I know I can specify an anisotropic semivariogram model using the geostatistical analyst wizard, but as far as I know I cannot automate the wizard to automatically calculate the anisotropic semivariogram parameters.

Thank you!
0 Kudos
1 Solution

Accepted Solutions
EricKrause
Esri Regular Contributor
You can index the model with something like:

/model[@name='Kriging']/model[@name='Variogram']/model[@name='VariogramModel'][0]/value[@name='Range']

Putting the index number in brackets after the model name will tell it which one to go to.  If you don't supply an index number, it will use the first one it finds.  An index of "0" refers to the first element; "1" refers to the second, "2" to the third, etc.

View solution in original post

0 Kudos
5 Replies
EricKrause
Esri Regular Contributor
You need to do something similar to the steps in this topic.

After you create a geostatistical layer using kriging with anisotropy turned on, you need to call the Set Model Parameter gp tool with your geostatistical layer as the model source.  You need to set the "auto" flag for the major and minor ranges to "true".  The code you'll need is this:

Parameter XML path:
/model[@name='Kriging']/model[@name='Variogram']/model[@name='VariogramModel']/value[@name='Range']/@auto; /model[@name='Kriging']/model[@name='Variogram']/model[@name='VariogramModel']/value[@name = 'MinorRange']/@auto

Parameter value: true; true

Save the output xml file in a convenient location.

Now you need to use the Create Geostatistical Layer gp tool.  Use the xml file you saved above as the model source, and give it a new dataset.  Run the tool, and you'll get a new geostatistical layer where the major and minor ranges have been recalculated.

You can then query the major and minor ranges by running Get Model Parameter gp tool twice.  For the model source, give it the geostatistical layer that you created from Create Geostatistical Layer, and use the following XML path code:

/model[@name='Kriging']/model[@name='Variogram']/model[@name='VariogramModel']/value[@name='Range']

and

/model[@name='Kriging']/model[@name='Variogram']/model[@name='VariogramModel']/value[@name = 'MinorRange']

The first bit of code will return the major range.  The second will return the minor range. 

You only need to do Set Model Parameter once, and you can iterate through your datasets and keep re-using that xml file in Create Geostatistical Layer.  For each new geostatistical layer, use Get Model Parameter to query the major and minor ranges.

I hope that was clear.  Let me know if you run into problems.
0 Kudos
AndreaEvans
New Contributor
Thank you for the reply... I tried it out on one file in my series and your solution worked exactly as I needed it to! Thank you!
0 Kudos
EricKrause
Esri Regular Contributor
I'm sorry, I messed up.  If you only change the auto flags for the major and minor ranges, it will calculate them assuming the other parameters are correct.  Since the other parameters were calculated for the very first dataset, they will not match new datasets, and the calculation of the major/minor range will get corrupted.  You'll need tell the model to recalculate everything before querying the ranges.

I've attached an .zip file that contains an XML file that has all the flags changed in order to properly recalculate the anisotropy parameters.  Use this file as the model source in Create Geostatistical Layer.  Use the same XML path codes as above to query the major/minor ranges with Get Model Parameter.

Also, if you want to query the angle of the major range, use this XML path code in Get Model Parameter:

/model[@name='Kriging']/model[@name='Variogram']/model[@name='VariogramModel']/value[@name='Direction']

Sorry for the mess up, but this workflow should work now.
0 Kudos
AndreaEvans
New Contributor
Thank you for the update, but don't worry; I had already noticed that issue once I started working on the code and made sure that I let all the required parameters be updated. Thank you for the xml file though. It provided a good check for me.

However, when I am doing a linear combination of models, I noticed that in the xml file they are all simply labeled as 'variogramModel' with no distinction in the model name. Do you know how I can access the parameters (i.e. range, sill, etc) from each? (I am not sure how to distinguish the xml path since all three sub-components of the variogram model have the same name)

Thanks again!
0 Kudos
EricKrause
Esri Regular Contributor
You can index the model with something like:

/model[@name='Kriging']/model[@name='Variogram']/model[@name='VariogramModel'][0]/value[@name='Range']

Putting the index number in brackets after the model name will tell it which one to go to.  If you don't supply an index number, it will use the first one it finds.  An index of "0" refers to the first element; "1" refers to the second, "2" to the third, etc.
0 Kudos