markusfleiss

Modelbuilder - Interation - raster calculator - take next raster in a folder

Discussion created by markusfleiss on Oct 1, 2011
Latest reply on Aug 1, 2013 by tonalca6864
Subject: Modelbuilder - Interation - raster calculator - take next raster in a folder


Hallo,

I made a runoff model which combines 3hourly rainfall raster data with daily soil moisture data in a raster calculator tool.

My modelling period is 30 days. So I have two folders, one with 240 (30 x 8 per day) rainfall and another one with 30 soil moisture datasets.

Thus I took the Iterator "Iterate Rasters" in the Modelbuilder and gave as input the folder with my 240 rainfall rasters. Then I put a "Raster Calculator Tools" where it should calculate with my rainfall and soil moisture data.

What it should do is following:

Iteration1: rainfall_day1_hour0.img + soilmoisture_Day1.img
Iteration2: rainfall_day1_hour3.img + soilmoisture_Day1.img
Iteration3: rainfall_day1_hour6.img + soilmoisture_Day1.img
Iteration4: rainfall_day1_hour9.img + soilmoisture_Day1.img
Iteration5: rainfall_day1_hour12.img + soilmoisture_Day1.img
Iteration6: rainfall_day1_hour15.img + soilmoisture_Day1.img
Iteration7: rainfall_day1_hour18.img + soilmoisture_Day1.img
Iteration8: rainfall_day1_hour21-img + soilmoisture_Day1.img
Iteration9: rainfall_day2_hour0.img + soilmoisture_Day2.img
Iteration10: rainfall_day2_hour3.img + soilmoisture_Day2.img
Iteration11: rainfall_day2_hour6.img + soilmoisture_Day2.img
Iteration12: rainfall_day2_hour9.img + soilmoisture_Day2.img
Iteration13: rainfall_day2_hour12.img + soilmoisture_Day2.img
Iteration14: rainfall_day2_hour15.img + soilmoisture_Day2.img
Iteration15: rainfall_day2_hour18.img + soilmoisture_Day2.img
Iteration16: rainfall_day2_hour21.img + soilmoisture_Day2.img
Iteration17: rainfall_day3_hour0.img + soilmoisture_Day3.img
...
Iteration240: rainfall_day30_hour21.img + soilmoisture_Day30.img



What it does:

Iteration1: rainfall_day1_hour0.img + soilmoisture_Day1.img
Iteration2: rainfall_day1_hour3.img + soilmoisture_Day1.img
Iteration3: rainfall_day1_hour6.img + soilmoisture_Day1.img
Iteration4: rainfall_day1_hour9.img + soilmoisture_Day1.img
Iteration5: rainfall_day1_hour12.img + soilmoisture_Day1.img
Iteration6: rainfall_day1_hour15.img + soilmoisture_Day1.img
Iteration7: rainfall_day1_hour18.img + soilmoisture_Day1.img
Iteration8: rainfall_day1_hour21-img + soilmoisture_Day1.img
Iteration9: rainfall_day2_hour0.img + soilmoisture_Day1.img
Iteration10: rainfall_day2_hour3.img + soilmoisture_Day1.img
Iteration11: rainfall_day2_hour6.img + soilmoisture_Day1.img
Iteration12: rainfall_day2_hour9.img + soilmoisture_Day1.img
Iteration13: rainfall_day2_hour12.img + soilmoisture_Day1.img
Iteration14: rainfall_day2_hour15.img + soilmoisture_Day1.img
Iteration15: rainfall_day2_hour18.img + soilmoisture_Day1.img
Iteration16: rainfall_day2_hour21.img + soilmoisture_Day1.img
Iteration17: rainfall_day3_hour0.img + soilmoisture_Day1.img
...
Iteration240: rainfall_day30_hour21.img + soilmoisture_Day1.img


In other words: My model iterates one after one rainfall raster out of the folder, but cannot take another "raster container" where I takes my soil moisture rasters one after another as my raster calculator inputs after every iterator. Instead it can only take every time the same raster dataset and not a container where I take the next one after each iteration.

Has anybody an idea how to solve my problem?

I struggled with this problem for days now, so it would be a great help for me, if somebody could give me some hints how to solve this problem.

Best regards,

Markus

Outcomes