I have 12 point feature datasets for different month. I want to perform IDW interpolation.
I have created the python code but its taking only one "Z" field for different month feature datasets from the attribute. Below I have mentioned the code. How to assign here multiple Z field from each month folder (JANUARY, FEBRUARY......DECEMBER).
Point feature class from different month folder (e.g. For January Merged_001, for FEBRUARY Merged_002.......for DECEMBER Merged_012 ) and want to perform IDW interpolation and save it as on same month folder as it Z field name (Max_Temper, Min_Temper, Precipitatat, Wind, Relative_H, Solar) with month (e.g for January 001_Max_Temper, 001_Min_Temper, 001_Precipitatat, 001_Wind, 001_Relative_H, 001_Solar).
After Whatever Solar raster for different month (for January 001_Solar....for DECEMBER 012_Solar) we will get, I want to do some calculation (001_Solar * 30) *0.5 and save it 001_sr ........012_sr in Month wise folder.
Below i have attached Point shapefile also for reference purpose
Here is my code.
import arcpy
from arcpy import env
from arcpy.sa import *
arcpy.env.parallelProcessingFactor = "100%"
arcpy.env.overwriteOutput = True
# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")
env.workspace = "D:\SWAT-WEATHER-DATA2\APRIL"
# Set local variables
inPointFeatures = "D:\SWAT-WEATHER-DATA2\APRIL\Merged_004.shp"
zField = "Min_Temper" #Z_Filed = Max_Temper, Min_Temper, Precipitatat, Wind, Relative_H, Solar
cellSize = 0.002298707671
power = 2
searchRadius = RadiusVariable(10, 150000)
#Mask region of interest
mask="D:\Gujarta Shape file\GUJARATSTATE.shp"
# Execute IDW
outIDW = Idw(inPointFeatures, zField, cellSize, power, searchRadius)
# Execute Mask
IDWMASk = ExtractByMask(outIDW, mask)
# Save output, except Solar Radiation raster
IDWMASk.save("004_Min_Temp.tif")
# 004_Max_Temp.tif, 004_Min_Temp.tif....Solar
#Only for Solar Radiation raster
#PAR = (IDWMASk * 30) * 0.5
#Save output, Only for Solar Radiation raster
#PAR.save("003_sr.tif")
#print done
print 'done'
Solved! Go to Solution.
leaving philosophy out of it... can one assume the original points represent the truth? and what errors does using that data introduce in itself.
What is the "truth".
Interpolation is interpolation. "Estimating", "predicting", values which are not actually there in your original data but putting some mathematical function through the input points to create a continuous surface raster output. Lots of stuff in the middle. IDW, NN, Splines, even Kriging
By the way, thanks xander_bakker for giving us some nice pictures of the various "interpolations"
You're welcome, but I'm sure there are many options to explore that will yield different results and there are many interpolations methods that will yield "better" results.
Also, very true your remark about estimating and predicting. If possible it is preferable to get back to the source (meteorological stations?). Hard to tell what kind of processes have been applied and on what data to obtain the results.
I will second that... especially it is climatalogical data
Xander Bakker Dan Patterson. Several researcher has been tested the issue of How effectively different interpolation techniques can predict the missing value based on known value, they found Kriging is working effectively to predict the missing value. And its very close to the observation. Thank you.
lets rule out potential sources of error first
Dan Patterson. Thank you for the suggestions.. Regarding indentation issues with my posted code i don't know why indentation occurring even i posted code very carefully with syntax highlighting.
Dan Patterson. I exactly followed the same which one you posted. after all this process also indentation issue coming.
Below i have a attached snapshot