AnsweredAssumed Answered

Interpolating with IDW(geostatistical analyst): Python for Loop

Question asked by kachieng on Feb 14, 2015
Latest reply on Feb 15, 2015 by kachieng

Hi All,

I'm trying to interpolate point feature classes with Python.  I would like the output to maintain the name of the input feature class.

However, my code seem not to be running.

Please assist me troubleshoot the code:

Thanks in advance.



Please see below


# Import system modules

import arcpy

from arcpy import env



# Set environment settings

arcpy.env.workspace = r"\\bsedom5\users\kachieng2\Desktop\ET_2002-2014\Product\Monthly"




# Set local variables

inPointFeatures = "fc"

zField = "ETommd"

outLayer = "outIDW"

outRaster = r"\\bsedom5\users\kachieng2\Desktop\ET_2002-2014\Product\MonthlyET.gdb\fc"

cellSize = 2000.0

power = 2


# Set variables for search neighborhood

majSemiaxis = 300000

minSemiaxis = 300000

angle = 0

maxNeighbors = 15

minNeighbors = 10

sectorType = "ONE_SECTOR"

searchNeighbourhood = arcpy.SearchNeighborhoodStandard(majSemiaxis, minSemiaxis,

                                                       angle, maxNeighbors,

                                                       minNeighbors, sectorType)



# Check out the ArcGIS Geostatistical Analyst extension license




# Execute IDW

for fc in fclist:

    outRaster = r"\\bsedom5\users\kachieng2\Desktop\ET_2002-2014\Product\MonthlyET.gdb\fc[:-4]"

    arcpy.IDW_ga(fc, zField, "", outRaster, cellSize, power, searchNeighbourhood)