What causes RuntimeError: ERROR 010240 saving after CellStatistics?

المشرف العام

Administrator
طاقم الإدارة
I am having trouble saving outputs from CellStatistics but only when I run it on a list of rasters. This was working on python 26 but not 27.

I know this example is nonsense, but:

env.workspace = "G:\\Faculty\\Mann\\Historic_BCM\\Aggregated1080\\" relevant_tifnames_year_i= ['cwd1975jan.tif', 'cwd1975feb.tif', 'cwd1975mar.tif', 'cwd1975apr.tif', 'cwd1975may.tif', 'cwd1975jun.tif', 'cwd1975jul.tif', 'cwd1975aug.tif', 'cwd1975sep.tif', 'cwd1975oct.tif', 'cwd1975nov.tif', 'cwd1975dec.tif'] mean = CellStatistics(relevant_tifnames_year_i, "MEAN", "DATA") mean.save(str(env.workspace)+"outa.tif") sd = CellStatistics(relevant_tifnames_year_i, "STD", "DATA") sd.save(str(env.workspace)+"outb.tif") Atest= CellStatistics([mean,sd], "MEAN", "DATA") Atest.save(str(env.workspace)+"outc.tif") Traceback (most recent call last): File "", line 1, in Atest.save(str(env.workspace)+"out3.tif") RuntimeError: ERROR 010240: Could not save raster dataset to G:\Faculty\Mann\Historic_BCM\Aggregated1080\Scratch\meanc_ras3 with output format GRID. Notice that I can save CellStats run on a list of files from my working directory, but not on a list made up of my intermediate inputs "sd" and "mean". I know that I can run it if I pass the file paths, but in my actual code I need to run it off of intermediate inputs. Am I missing something here?

Note: Overwrite = True has been set. There are no files with the same name in the output folder etc.

Here is the actual code (storing rasters to a list and then running CellStats)

for year in base_year: # paths for files relevant_tifnames_year = [v for v in relevant_tifnames if int(re.sub('[^0-9]','',v) or 0) >= year and int(re.sub('[^0-9]','',v) or 0)
 
أعلى