I have multiple point feature class (r001_mean, r002_mean.....012_mean) into one folder. I am trying to write a python script to perform Kriging interpolation which will loop all the point feature class and outraster will save as it name of input raster.
Each Point feature class hold one Z filed only (GRID_CODE)
Below is my script, what i have so far.....its giving error massage of "not defined point_num"
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="keyword token">from</SPAN> arcpy <SPAN class="keyword token">import</SPAN> env
<SPAN class="keyword token">from</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>sa <SPAN class="keyword token">import</SPAN> <SPAN class="operator token">*</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>overwriteOutput <SPAN class="operator token">=</SPAN> <SPAN class="token boolean">True</SPAN>
<SPAN class="comment token"># Check out the ArcGIS Spatial Analyst extension license</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>CheckOutExtension<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Spatial"</SPAN><SPAN class="punctuation token">)</SPAN>
In_Point <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"D:\NPP_Test\MERRA_TEMP_2012C"</SPAN> <SPAN class="comment token">#(Point feature name:r001_mean, r002_mean.....r012_mean )</SPAN>
Out_Raster <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"D:\NPP_Test\MERRA_TEMP_2012D"</SPAN>
points <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>ListFeatureClasses<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
zFields <SPAN class="operator token">=</SPAN> <SPAN class="string token">"GRID_CODE"</SPAN>
<SPAN class="comment token">#Kriging Veriable</SPAN>
cellSize <SPAN class="operator token">=</SPAN> <SPAN class="number token">0.05</SPAN>
lagSize <SPAN class="operator token">=</SPAN> <SPAN class="number token">0.5780481172534</SPAN>
majorRange <SPAN class="operator token">=</SPAN> <SPAN class="number token">6</SPAN>
partialSill <SPAN class="operator token">=</SPAN> <SPAN class="number token">3.304292110</SPAN>
nugget <SPAN class="operator token">=</SPAN> <SPAN class="number token">0.002701348</SPAN>
kRadius <SPAN class="operator token">=</SPAN> RadiusFixed<SPAN class="punctuation token">(</SPAN><SPAN class="number token">20000</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">#Mask region of interest</SPAN>
mask <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"D:\Gujarta Shape file\GUJARATSTATE.shp"</SPAN>
<SPAN class="keyword token">for</SPAN> zField <SPAN class="keyword token">in</SPAN> zFields<SPAN class="punctuation token">:</SPAN>
Point <SPAN class="operator token">=</SPAN> Point_Num<SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">:</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">]</SPAN>
kModelUniversalObj <SPAN class="operator token">=</SPAN> KrigingModelUniversal<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"LINEARDRIFT"</SPAN><SPAN class="punctuation token">,</SPAN> lagSize<SPAN class="punctuation token">,</SPAN> majorRange<SPAN class="punctuation token">,</SPAN> partialSill<SPAN class="punctuation token">,</SPAN> nugget<SPAN class="punctuation token">)</SPAN>
OutKriging <SPAN class="operator token">=</SPAN> Kriging<SPAN class="punctuation token">(</SPAN>inPointFeatures<SPAN class="punctuation token">,</SPAN> zField<SPAN class="punctuation token">,</SPAN> kModelUniversalObj<SPAN class="punctuation token">,</SPAN> cellSize<SPAN class="punctuation token">,</SPAN> kRadius<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">#IDWMASk = ExtractByMask(outIDW, mask)</SPAN>
KrigMask <SPAN class="operator token">=</SPAN> ExtractByMask<SPAN class="punctuation token">(</SPAN>OutKriging<SPAN class="punctuation token">,</SPAN> mask<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">#Save outraster as the same name of input</SPAN>
KrigMask<SPAN class="punctuation token">.</SPAN>save<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"r{}.tif"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>Point_Num<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>