I have a simple model in ModelBuilder that does the following:
- Iterate through a folder of rasters (these are outputs from Global Climate Models)
- Clip each raster to a study area (Egypt), using a polygon, and dump outputs into a Geodatabase
- For each clipped raster use the Zonal Statistics as Table tool to calculate some basic statistics (i.e. mean, min, max) and dump the outputs into a folder
Problem: There are many input rasters, each with similar names (i.e. Temp1, Temp2, Precip1, Precip2 etc.). This means that when running the model the outputs are all subsequently named very similarly such that I am unable to know which GCM each output has come from.
What I would like to do: Each input raster is stored in a folder with a name that I would like to retain in the output file names. I would like to include this name in the output of each clipped raster (step 2 above) and in the output of each statistic table (step 3 above).
Current model: Below is a screenshot of my current model. I understand that I need to use the Parse Path and Calculate Value tools to retain the folder name and pass this into the output file names but I do not know how to do this. Help!
Progress: Thus far I have the below. I can get it to include the originating folder name in the output files in the clipped raster but it's also including part of the parent folder too (i.e. ParentFolderName_FolderName rather than simply FolderName_%Name%_c).