zeltak

python script freezes and i get a lock on the file

Discussion created by zeltak on Mar 22, 2011
Latest reply on Mar 23, 2011 by clm42
Hi

Im running a large python script which i created through the model builder.

its basically just a bunch of spatial joins for each day.

the problem is that after a while python freezes and i get lock (.lock) on the shapefile

there is no error just a general freeze of python and nothing seems to be going on

can anyone help out?

here is an example day:

# Import arcpy module
import arcpy

#m01


# Local variables:
PM_d01_m01_2009_shp = "C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp"
AOD_d01_m01_2009_shp = "C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_aod_shp\\AOD_d01_m01_2009.shp"
J_d01_m01_2009_shp = "C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_joined_shp\\J_d01_m01_2009.shp"

# Process: Spatial Join
arcpy.SpatialJoin_analysis(PM_d01_m01_2009_shp, AOD_d01_m01_2009_shp, J_d01_m01_2009_shp, "JOIN_ONE_TO_ONE", "KEEP_ALL", "DATASET \"DATASET\" true true false 12 Text 0 0 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,DATASET,-1,-1;SITECODE \"SITECODE\" true true false 12 Text 0 0 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,SITECODE,-1,-1;DATESTRING \"DATESTRING\" true true false 10 Text 0 0 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,DATESTRING,-1,-1;POC \"POC\" true true false 1 Short 0 1 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,POC,-1,-1;SITENAME \"SITENAME\" true true false 32 Text 0 0 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,SITENAME,-1,-1;LATITUDE \"LATITUDE\" true true false 13 Double 5 12 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,LATITUDE,-1,-1;LONGITUDE \"LONGITUDE\" true true false 14 Double 5 13 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,LONGITUDE,-1,-1;STATE \"STATE\" true true false 2 Text 0 0 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,STATE,-1,-1;COUNTYFIPS \"COUNTYFIPS\" true true false 3 Short 0 3 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,COUNTYFIPS,-1,-1;COUNTYNAME \"COUNTYNAME\" true true false 19 Text 0 0 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,COUNTYNAME,-1,-1;EPACODE \"EPACODE\" true true false 9 Text 0 0 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,EPACODE,-1,-1;MFVALUE \"MFVALUE\" true true false 5 Float 1 4 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,MFVALUE,-1,-1;DATE \"DATE\" true true false 8 Date 0 0 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,DATE,-1,-1;C \"C\" true true false 8 Long 0 8 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,C,-1,-1;M \"M\" true true false 8 Long 0 8 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,M,-1,-1;D \"D\" true true false 8 Long 0 8 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,D,-1,-1;ORIG_FID \"ORIG_FID\" true true false 9 Long 0 9 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_pm_shp\\PM_d01_m01_2009.shp,ORIG_FID,-1,-1;C_1 \"C_1\" true true false 4 Short 0 4 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_aod_shp\\AOD_d01_m01_2009.shp,C,-1,-1;M_1 \"M_1\" true true false 3 Short 0 3 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_aod_shp\\AOD_d01_m01_2009.shp,M,-1,-1;D_1 \"D_1\" true true false 3 Short 0 3 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_aod_shp\\AOD_d01_m01_2009.shp,D,-1,-1;X \"X\" true true false 9 Double 2 8 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_aod_shp\\AOD_d01_m01_2009.shp,X,-1,-1;Y \"Y\" true true false 9 Double 2 8 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_aod_shp\\AOD_d01_m01_2009.shp,Y,-1,-1;AOD \"AOD\" true true false 10 Double 3 9 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_aod_shp\\AOD_d01_m01_2009.shp,AOD,-1,-1;DATE_1 \"DATE_1\" true true false 8 Date 0 0 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_aod_shp\\AOD_d01_m01_2009.shp,DATE,-1,-1;ORIG_FID_1 \"ORIG_FID_1\" true true false 9 Long 0 9 ,First,#,C:\\Users\\ekloog\\Documents\\$Doc\\3.PostDoc\\3.1.Projetcs\\3.1.1.NE_PM_MODELS\\3.1.1.4.Work\\daily_aod_shp\\AOD_d01_m01_2009.shp,ORIG_FID,-1,-1", "CLOSEST", "15 Kilometers", "dist_km")




thx zeltak

Outcomes