AnsweredAssumed Answered

Batch to calculate the difference of many  rasters located in different workspaces

Question asked by nepomuck0 on Dec 16, 2012
Latest reply on Dec 29, 2012 by nepomuck0
Hi there,

Im running a rockfall model which gives me per iteration about 15 new ascii raster (mean energy, reach probability, max speed, and so on). The aim of my master thesis is, to compare the influence of the protection forest. Therefore i have always two datasets (a 15 rasters) which i want to compare (mean_energy_per_cell_without_forest - mean_energy_per_cell_with_forest). Because I want to do this for 5 different rock sizes and two different study-areas, that would be a lot of clicking within the raster calculator.
Within the modelbuilder i got nowhere, due to the fact that the  rockfall model gives always the same 15 names to the rasters, and i stored them into different  folders/workspaces. Therefore all my hope lies in the hand of python :)
Because I am new to python, im not sure if there is a possibility to create a script, that takes the different .mdb-workspaces as input variable (which i could change afterwards easily). and calculates always the difference of the two matching rasters from the two different .mdb-workspaces from each other (Input: "CS_withforest_big.mdb" and "CS_without_big.mdb"  -->> Output diff_mean_energy, diff_max_speed, diff_reach_probability ...)

It would be great, if you could give some tipps about the script-architecture! Thanks a lot !

nepomuck0

Outcomes