sagunn

"WEIGHT" field issue in Arc-SDM 10

Discussion created by sagunn on Jan 14, 2013
Latest reply on Jan 14, 2013 by slynch-esristaff
Hi all,

I'm using the Arc-SDM v. 10 (Spatial Data Modeler) tools in ArcGIS 10.1.  I am trying to run a Weights of Evidence model (WOE) but keep receiving this error, even with the demo MXD and dataset:
PYTHON ERRORS:
Traceback Info:
  File "Z:\SDM\Scripts\NewCalcResp3.py", line 133, in <module>
    gp.Lookup_sa(Temp_Raster,"WEIGHT",Output_Raster)

Error Info:
    <class 'arcgisscripting.ExecuteError'>: Failed to execute. Parameters are not valid.
ERROR 001000: Lookup field: Field WEIGHT does not exist
Failed to execute (Lookup).


The model seems to run fine until it tries to calculate weights, then I run into this error.  The code in question is:
 if NoDataArg != '#' and gp.describe(Input_Raster).pixeltype.upper().startswith('U'):
            NoDataArg2 = '#'
        else:
            NoDataArg2 = NoDataArg
        RasterLayer = "OutRas_lyr"
        gp.MakeRasterLayer_management(Input_Raster,RasterLayer)
        #++ AddJoin requires and input layer or tableview not Input Raster Dataset.
        gp.AddJoin_management(RasterLayer,"Value",Wts_Table,"CLASS")
        Temp_Raster = os.path.join(gp.scratchworkspace,'temp_raster')
        if gp.exists(Temp_Raster): gp.delete(Temp_Raster)
        gp.CopyRaster_management(RasterLayer,Temp_Raster,'#','#',NoDataArg2)
        gp.Lookup_sa(Temp_Raster,"WEIGHT",Output_Raster)


I understand that gp.Lookup_sa is failing because the weight field does not exist in Temp_Raster, but I'm not sure how to resolve it.  Any advice on how to troubleshoot this issue would be appreciated.  I have emailed one of the SDM folks in charge of the project as well.

Thank you!

Outcomes