Discovered something today. I was working on an arcpy script that copies a raster dataset from a file geodatabase into a Postgres SDE geodatabase and then does some boring routine tasks–building stats, creating a mosaic dataset, adding the raster to the mosaic dataset and making a couple referenced mosaic datasets.
It sometimes has trouble with the initial step of uploading the raster because of the sheer size of if (1m elevation raster for counties) and it failed today on one. It failed today so I used the ArcCatalog GUI to copy the raster and renamed it.
I then proceeded to run launch my script. Before each step, I use arcpy.Exists extensively to check to see if various items exist before I attempt to create them. It was continuously reporting that my raster set did not exist even though I could see it in ArcCatalog.
Finally, I realized that I needed to close ArcCatalog before arcpy recognized the fact I had renamed something. To note, I was running arcpy from a separate PythonWin window, not from the ArcCatalog session I had renamed the raster dataset with.
Once I closed ArcCatalog, arcpy recognized the renaming and life was good.
I’m also suspicious now about a problem I often have running statistics on my rasters. The ArcTool reports no errors when I create them but for some reason the raster does not show that it has statistics afterwards. I normally have multiple ArcApplication sessions open and now suspect that perhaps this problem is due to sessions not letting go of the connection. Stay tuned for further developments on this.