Hello, everyone. I have two sets of similar kind of rasters (1st set: idwlist, 2nd set: equallist) and I want to multiply each raster from the 1st group (‘eachidw’) with every raster from the 2nd group (‘eachequal’). In other words, I want to create a code that calculates and stores all the possible products (multiplications) between the rasters of the two groups.
The problem with the arcpy code below is that the output of every iteration is not saved but overwritten, so I would like to ask if there is any way to make the code save each multiplication output. Thanks a lot !
from arcpy import env
from arcpy.sa import *
import os
arcpy.env.workspace = "C:/MSc_thesis/XrApor"
idwlist = arcpy.ListRasters("*", "TIF")
equallist = arcpy.ListRasters("*", "GRID")
for eachidw in idwlist:
for eachequal in equallist:
outTimes = Times(eachidw,eachequal)
. outTimes.save("C:/MSc_thesis/products")