[GIS] Creating ArcMap Model with multiple iterators?

arcgis-10.4arcgis-desktopiteratormodelbuilder

I'm using ArcMap version 10.4.1. I'm attempting to create a model which almost works perfectly but I can't figure out the last bit.

Ultimately I want to run the "extract by mask" tool multiple times. However, the input for the raster layer is in one folder and the input for the mask layer is in another folder. Each raster/mask combination represents one day; the data differs for each day. There are an equal number of raster and mask files in each folder.

This is the full model which I created. The model runs the whole way through without throwing any errors. When the model finishes I get different raster layers but all extracted to the same mask. Everything else works correctly- I get a folder of different masks, and I get another folder of different rasters. I want to extract each raster to the mask for that day.

Full Model

The submodel on the top left creates the mask, while the submodel on the bottom left iterates through the folder which I'm populating the masks with. The submodel on the top right re-scales the raster layer. The submodel on the bottom right iterates through the folder where I put all the raster layers, and then runs the extract by mask tool. I put in pre-conditions (the dashed lines), so that the submodel on the bottom right, with the extract by mask tool, runs last.

The submodel on the top left, to create the cloud masks:

Mask Model, top left

The submodel on the top right, to re-scale the rasters:

Submodel top right, to process the rasters
Submodel from the bottom left, to iterate through the folder of masks:

Iterate through the mask folder

The submodel from the bottom right. This iterates through the folder of rasters and runs extract by mask. The white "input raster" bubble connects to the output from the model that iterates through the folder of masks.
Iterate through NDVI folder and run extract by mask

Best Answer

I believe your bottom right (iterate_nndvi) model needs to be a sub-model in your bottom left (iterate_masks).

If you think about it, you enter iterate_masks, this loops as many times as needed then passes out a single mask raster, hence you are only extracting with one unchanging raster. Place iterate_nndvi inside iterate_masks and connect will ensure iterate_masks is run on every loop in iterate_nndvi .

Related Question