Systematic projection issue in ArcMap window when creating rasters from NumPy Arrays

Discussion created by amilt on Jun 24, 2013
This post is to flag some kind of projection problem in ArcMap.

I have created a script that processes a raster by first converting it to a NumPy Array, doing some calculations, and then converting back to a .tif raster. In the last steps of the script, the raster is properly referenced to the original raster, and its projection is defined according to the original.

However, when the script runs the first time, the resulting raster(s) is incorrectly projected in ArcMap. When the script is run the second time within the same ArcMap session, it projects correctly. This occurs when the names of the output files across runs differ (or are the same), and when the input raster has been loaded into ArcMap beforehand (and thus the Data Frame is set to the input raster projection).

To Illustrate: Here's are the input raster and output from the first run. The output from the second run is undistorted and looks like the first.