Python for a batch raster calculator run

752
1
07-01-2013 07:10 AM
KatelynDotson
New Contributor
I am trying to learn python in order to run a script for raster calculator in model builder. However, connecting to the files I need is a bit confusing for me. I am trying to create a batch (or loop) run for 24 meridional and 24 zonal raster files in a folder using the con function. But like I state previously, I have no idea how to get this one started as far as connecting to the files/folders. If anyone could help that would be great!

Thanks.
Tags (2)
0 Kudos
1 Reply
RhettZufelt
MVP Frequent Contributor
You didn't say what version you are running.  If 10.1, look at da.walk ( http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000023000000 ).

has an example near bottom of how to iterate through all rasters in the workspace (except for back_up, but can remove that).

Basically, it makes a python "list" of your rasters that meet the criteria, that you can use/iterate through for your con statements.

R_
0 Kudos