I've been trying to build a model in ModelBuilder (ArcGIS 10.1) which can do the following task:

I have a folder full of ca. 16,000 raster files (.asc) representing mean temperatures for each day of 40+ years with names like 19800101, 19800102 (first two days of January 1980) etc. Now I want:

  1. import each .asc to raster
  2. reclassify each raster (e.g. temperature x = 0, temperature y = 1)
  3. do a weighted sum of all rasters of one year (to get the number of all days with temperature y)
  4. write resulting yearly rasters to a different folder

I tried different things but nothing worked for the whole process. I can get 1) and 2) working in a model but fail to do 3) and 4) along with it automated and had to do it by hand which is very time consuming. I suppose it comes down to using different iterators, but I just can't find a way to get it working.

Can you point me in the right direction for doing this task automated and efficiently in ModelBuilder?

  • 3
    model builder only supports one iterator per model. I would suggest that you try with Python. If you don't want to use Python, build a model that iterates on your raster for only one year, set the year as a parameter and launch it it batch mode (right-click your model once saved)
    – radouxju
    Apr 20, 2014 at 19:26
  • You can set the inputs to have multiple values, the problem comes when outputs are generated and are overwritten. ASCII files are considered to be raster so don't really need to be imported. I would definitely go with the python option: get your model working correctly on one iteration and then add recursion in python. Model builder supports variables like 'output_folder' right click on some empty space and add variable, select type of folder then give it the value of your output folder. To use this in the tools specify %Output_folder%\FileName.tif in the output. Apr 21, 2014 at 3:12
  • Thanks for the replies! I have no knowledge of Python programming, so this isn't an option for now. Liked the batch idea, but it's not working as posted several times link, link etc. I have a model that does 1+2 but 3+4 isn't working automated, only single runs (using cell statistics instead of weighted sum as I don't get weighted sum to work in model builder). Apr 21, 2014 at 13:25
  • Is it critical to use a weighted sum, or would cell statistics with a sum statistic suffice?
    – Aaron
    Aug 17, 2014 at 16:21
  • Since cell statisitcs has a 'sum' option I guess it should work too. Do you have an approach for my problem using cell statistics in Model Builder? Sep 19, 2014 at 8:53

1 Answer 1


Use two models: 1) Import/Reclass and 2) weighted sum/output.

To get the year to sum on, use an interate rasters. In Model Builder, Add Field "Year", calculate field [year] as: left(%value%,4)

That will get you the first four characters of your raster name to use as a year. Once you've got a year field for all your rasters, sum them together on the basis of that year.

  • Thank you, Mox! I only recently saw your answer. I tried as you suggested and managed to add and calculate the fields. They now have the year in the table field. I'm now struggeling to add the rasters based on the raster table field attributes (like 1971, 1972 and so on). How can I do this with 'weighted sum' or any other tool for that matter? I don't see any possibility to do so. Is there a tool like the 'dissolve' tool for shapefiles where you can dissolve them based on an attribute? Jun 7, 2014 at 20:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.