ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Set Model Parameter

Available with Geostatistical Analyst license.

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Sets parameter values in an existing geostatistical model source.

Usage

  • This tool is generally used in a model or in scripting.

  • The geostatistical model source is either a geostatistical layer or a geostatistical model (XML).

  • The examples below can be used in the Parameter XML Path to specify which parameter will be set to a new value.

    • To change the number of lags parameter:
      /model[@name = 'Kriging']/model[@name = 'Variogram']/value[@name = 'NumberOfLags']
    • To change the weight parameter for LPI:
      /model[@name = 'LPI']/value[@name = 'Weight']
    • To specify whether the nugget should be recalculated in Kriging:
      /model[@name = "Kriging"]/model[@name = "Variogram"]/value[@name = "Nugget"]/@auto

      Then specify a true or false value (true implies that a new nugget value will be calculated when the XML file is used).

    • To specify whether a new range should be calculated:
      /model[@name = 'Kriging']/model[@name = 'Variogram']/model[@name = 'VariogramModel']/value[@name = 'Range']/@auto

      Then specify a true or false value (true implies that a new range value will be calculated when the XML file is used).

    • To specify a new nugget value:
      /model[@name = 'Kriging']/model[@name = 'Variogram']/value[@name = 'Nugget']
  • The XPath code snippet below sets multiple parameters via a single call to the tool.

    params = "/model[@name = 'Kriging']/model[@name = 'Variogram']/value[@name = 'Nugget']/@auto;\
    
              /model[@name = 'Kriging']/model[@name = 'Variogram']/model[@name = 'VariogramModel']/value[@name = 'Range'];\
    
              /model[@name = 'Kriging']/model[@name = 'Variogram']/model[@name = 'VariogramModel']/value[@name = 'Sill']"
    
    vals = "true;5.5;777"
    
    gp.GASetModelParameter_ga(inXMLFile, params, vals, outXMLFile)
    

Syntax

arcpy.ga.GASetModelParameter(in_ga_model_source, model_param_xpath, in_param_value, out_ga_model)
ParameterExplanationData Type
in_ga_model_source

The geostatistical model source to be analyzed.

File; Geostatistical Layer
model_param_xpath

XML path to the required model parameter.

String
in_param_value

Value for the parameter defined by the XML path.

String
out_ga_model

Geostatistical model created with the parameter value defined in the XML path.

File

Code sample

SetModelParameter example 1 (Python window)

Change the value of a parameter in a geostatistical model source.

import arcpy
from arcpy import env
env.workspace = "C:/gapyexamples/data"
newParam = arcpy.GASetModelParameter_ga(
    "C:/gapyexamples/data/kriging.lyr", 
    "/model[@name = 'Kriging']/model[@name = 'Variogram']/value[@name = 'Nugget']",
    "1", "C:/gapyexamples/output/outModel.xml")
print newParam
SetModelParameter example 2 (stand-alone script)

Change the value of a parameter in a geostatistical model source.

# Name: GASetModelParameter_Example_02.py
# Description: Sets parameter value in an existing geostatistical model source.
# Requirements: Geostatistical Analyst Extension

# Import system modules
import arcpy

# Set environment settings
arcpy.env.workspace = "C:/gapyexamples/data"

# Set local variables
modelSource = "C:/gapyexamples/data/kriging.lyr"
xmlPath = "/model[@name = 'Kriging']/model[@name = 'Variogram']/value[@name = 'Nugget']"
newValue = 1
outModel = "C:/gapyexamples/output/outModel.xml"

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

# Execute GASetModelParameter
newParam = arcpy.GASetModelParameter_ga(modelSource, xmlPath, newValue, outModel)

# Show results
print newParam

Environments

  • Current Workspace
  • Scratch Workspace

Licensing information

  • Basic: Requires Geostatistical Analyst
  • Standard: Requires Geostatistical Analyst
  • Advanced: Requires Geostatistical Analyst

Related topics

  • An overview of the Working With Geostatistical Layers toolset

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal