I'm trying to automate a bunch of GA processes and my initial script appears to be working. But how can I view or add my output GA layer to ArcMap? I know this sounds silly, but I cannot figure out how to view my output, tmpLyr after the process runs. Either it's not producing it (which if I run the script a second time, Python tells me tmpLyr already exists) or I just don't know how to add it to ArcMap.
I don't really need to see it so much as I will need to export it to a raster in the next step.
thx
(edited: This code works and I can view the output grid just fine but it might still be nice to be able to view the GA layer mid way though the process)
# Purpose: Create a new Geostatistical layer based on a previous one
# Create the Geoprocessor object.
import arcgisscripting
gp = arcgisscripting.create()
gp.workspace = "C:\\working\\Y2010\\ECSR\\Plant"
#gp.toolbox = "ga"
try:
# Set the input GA layer.
inputGALayer = "C:\\working\\Y2010\\ECSR\\xml\\DS\\DS01_Pre2010.xml"
# Set the new input dataset
inputDset = "C:\\working\\Y2010\\ECSR\\Plant\\ECSR_Plant2009_working.gdb\\DS_P120_2009\\DS01_P120_2009_Plant"
# Set the field name
inputDset = inputDset + " BV_4ft"
# Set output layer name
outLayer = "C:\\working\\Y2010\\ECSR\\rasters\\temp\\tempLyr"
# Check out Geostatistical Analyst extension license.
gp.CheckOutExtension("GeoStats")
# Process: Create a Geostatistical layer...
gp.GACreateGeostatisticalLayer( inputGALayer, inputDset, outLayer)
except:
# If an error occurred while running a tool, then print the messages.
print gp.GetMessages()
try:
# Set the input GA layer.
inputGALyr = "C:\\working\\Y2010\\ECSR\\rasters\\temp\\tempLyr"
# Set the output grid name.
outputGrid = "C:\\working\\Y2010\\ECSR\\rasters\\temp\\out_grid"
# Set some of the parameters.
cell_size = 1
points_horiz = 1
points_vert = 1
# Check out GeoStatistical Analyst extension license.
#gp.CheckOutExtension("GeoStats")
# Process: GA Layer To Grid...
gp.GALayerToGrid_ga (inputGALyr, outputGrid, cell_size, points_horiz, points_vert)
except:
# If an error occurred while running a tool, then print the messages.
print gp.GetMessages()