Using Raster Calculator in Model Builder

1665
3
03-16-2012 12:13 AM
grahamlangley-edwards
New Contributor II
Hello, I have constructed a model that uses an OLS regression towards the end.  I would like the values for two of the coefficients to be used as part of a raster calculator equation that rebuilds the regression and outputs to a raster.  I have entered the equation that I want to use in the Raster Calculator tool, but cannot figure out how to make the two coefficients from the OLS regression become part of the equation (they are not listed as options under the Layers and Variables section of Raster Calculator).  Part of the problem is that the model is designed to have those two coefficients be different every time the model is run.  Is there any way that I can have the two coefficients become part of the equation?  I have attached a screen shot of the model for clarity.  Any help is greatly appreciated...

Thanks,

Graham
0 Kudos
3 Replies
grahamlangley-edwards
New Contributor II
Perhaps I should mention that I attached the Variables bubble to the Raster Calculator bubble with a precondition connector.  The other option was a Map Algebra Expression connector, but when I tried that no connector appeared on the model connecting the two bubbles.

Thanks,

Graham
0 Kudos
grahamlangley-edwards
New Contributor II
Someone please help, I have a Tuesday deadline and have already scoured the forums for an answer.

Thanks
0 Kudos
curtvprice
MVP Esteemed Contributor
There is some missing information here.... I'm assuming your "variables" output from the script tool is a string right? Say it's a space delimited text with two numbers: "234.2 -12.4".

The key to this is use of the Calculate Value tool to parse this output into new model variables that can be used in your Raster Calculator expression.

Calculate Value is the glue that really makes ModelBuilder more than a handy macro and demo toy. Unfortunately, it is unavailable if you just have an ArcView license (but it does get added with Spatial or 3d Extensions).

I posted [thread=182131] my complete answer[/thread] over on the Spatial Analyst forum because I think this is really a Raster Calculator tool question.
0 Kudos