Hi Xander Bakker and Shouvik Jha, Thanks for sharing the awesome script. I ran the script using more than 300 raster data X and Y respectively. I just modify the script for path and format template: import numpy as np
template1 = r'C:\regression\correlation\data_x\x_{}.tif'
template2 = r'C:\regression\correlation\data_y\y_{}.tif'
nodata = -3.4028235e+38
out_ras = r'C:\regression\correlation.tif'
print "create nested numpy array list..."
lst_np_ras = []
for i in range(0, 334):
ras_path1 = template1.format("%01d" % (i,))
print " - ", ras_path1
ras_np1 = arcpy.RasterToNumPyArray(ras_path1)
ras_path2 = template2.format("%01d" % (i,))
print " - ", ras_path2ras_np2 =
arcpy.RasterToNumPyArray(ras_path2)lst_np_ras.append([ras_np1, ras_np2]) but I get an error message Runtime error
Traceback (most recent call last):
File "<string>", line 102, in <module>
File "<string>", line 78, in main
RuntimeError: ERROR 010240: Could not save raster dataset to C:\regression\correlation.tif with output format TIFF. Can you help to solve this? Kind regards, Arwan
... View more