POST
|
Ok, call me names, but I need help! I am learning python and arcpy because i need to create loops that select variables and create kriging files. After an incredible number of hours and headackes, I created a script that "works" BUT either it never stops if i specify the overwrite.output or gives me an error saying that I can not overwrite. My point is: how do I tell python that I want to generate a new file (kriging raster file) every time an iteration is finished? For example, if I run the kriging for the year 101, I need an output file 101; for year 102 an output file 102, and so on. I know for most of you this question is idiotic, but I really cant figure it out! This is my code # --------------------------------------------------------------------------- # provahalf.py # Created on: 2010-12-22 13:53:23.00000 # (generated by ArcGIS/ModelBuilder) # Description: # --------------------------------------------------------------------------- # Import arcpy module import arcpy # Check out any necessary licenses arcpy.CheckOutExtension("spatial") #arcpy.geoprocessing.OverWriteOutput = True arcpy.env.overwriteOutput = True # Script arguments... define workspace & where the files are found Input = "C:/Eva/Kennedy/Athmospheric/WIND_DATA_27Jan10/OneWeekData/PuffModel/new analysis/" arcpy.env.workspace = Input # Local variables: provissima__2_ = "provissima" provissima = "provissima" final = "C:\\Eva\\Kennedy\\Athmospheric\\WIND_DATA_27Jan10\\OneWeekData\\PuffModel\\new analysis\\final" Output_variance_of_prediction_raster = "" yrmdda=0 while yrmdda<103: # Process: Select Layer By Attribute arcpy.SelectLayerByAttribute_management(provissima__2_, "NEW_SELECTION", "\"yrmdda\" = 101") # Process: Kriging arcpy.gp.Kriging_sa(provissima, "WindSp", final, "Spherical 0.031460", "0.03146", "VARIABLE 12", Output_variance_of_prediction_raster) yrmdda=yrmdda+1
... View more
12-22-2010
11:04 AM
|
0
|
0
|
297
|
POST
|
Dear All, I have to create a map of wind speed using IDW for every day from 2000 to 2006. I can not possibly do it by hand, so I really need a loop! BUT: I do not know how to code! Is there someone out-there that can help me out and send me the code for creating this loop? My attribute table looks like this: StationID YEARMODA Lat Long Wind 723183 20000101 36.48 -82.399 1.48 723184 20000101 36.02 -82.885 7.60 723185 20000101 35.98 -82.566 4.35 723183 20000102 36.48 -82.399 2.06 723184 20000102 36.02 -82.885 8.98 723185 20000102 35.98 -82.566 3.24 THANK YOU SO MUCH!
... View more
12-07-2010
09:31 AM
|
0
|
0
|
295
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|