I'm currently doing a research project for school which requires me to interpolate recorded temperatures within in our study area. After the maps are made, I'm going to string them together into an animation to show temperature variations over time. I will end up having over 1000 maps interpolated so its out of the question to do them one at a time. I'm in the process of creating a script to automate this. To make the process of coding easier for myself, I created a setup in the model builder, which i ran successfully, and exported the code to python. My problems arises here... I run the code and get these errors:
Traceback (most recent call last):
File "C:\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 325, in RunScript
exec codeObject in __main__.__dict__
File "C:\Users\Seth\Documents\summer project 2010\CommunityNet\python test\modelbuilder test1.py", line 32, in <module>
gp.Idw_sa(sensorlocation_shp, "8_2_2010_1", test1, "0.000265", "2", "VARIABLE 12", "")
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000860: Input point features: is not the type of Composite Geodataset, or does not exist.
ERROR 001000: Z value field: Field 8_2_2010_1 does not exist
ERROR 000876: Output raster: C:\Users\Seth\Documents\summer project 2010\CommunityNet\python test\modelbuilder test1.py's extension is invalid for the output raster format.
Failed to execute (Idw).
Here is my code for reference:
# ---------------------------------------------------------------------------
# modelbuilder test1.py
# Created on: Thu Nov 11 2010 08:20:08 PM
# (generated by ArcGIS/ModelBuilder)
# Usage: modelbuilder test1 <sensorlocation_shp> <test1>
# ---------------------------------------------------------------------------
# Import system modules
import sys, string, os, arcgisscripting
# Create the Geoprocessor object
gp = arcgisscripting.create()
# Check out any necessary licenses
gp.CheckOutExtension("spatial")
# Load required toolboxes...
gp.AddToolbox("C:/Program Files (x86)/ArcGIS/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx")
# Script arguments...
sensorlocation_shp = sys.argv[0]
if sensorlocation_shp == '#':
sensorlocation_shp = "C:\\Users\\Seth\\Documents\\summer project 2010\\CommunityNet\\python test\\location\\sensorlocation.shp" # provide a default value if unspecified
test1 = sys.argv[0]
if test1 == '#':
test1 = "C:\\Users\\Seth\\Documents\\summer project 2010\\CommunityNet\\python test\\location\\test" # provide a default value if unspecified
# Local variables...
# Process: IDW...
gp.Idw_sa(sensorlocation_shp, "8_2_2010_1", test1, "0.000265", "2", "VARIABLE 12", "")