This question already has an answer here:
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.
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:
The submodel on the top right, to re-scale the rasters:
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.