0

The raster files that function refers are as follows:

  • Precipitation (o “Raster” in figure 1): Variable
  • CN_2S_7ma: Constant
  • CN_8S_7ma: Constant

The mathematical function that must be entered is as follows:

a) First condition: Condition for raster that have "No Value" or empty cells, they put a zero. If "Precipitation"> 0, Response: Yes = going to Condition 2, No = 0

b) Second condition: If "Precipitation"> = CN_2S_7ma, Response:

Yes = 〖(Precipitation - CN_2S_7ma)〗^2 / (Precipitation + CN_8S_7ma)

No = 0

The idea is to place the function in a model builder, after using the "Iterate Rasters" to take all raster within the folder ("Precipitacion") and apply the function. So far, I am writing like this both conditions in "Raster Calculator" and not working:

Con( “%Raster%” > 0,( Con( “%Raster%” >= "%CN_2S_7ma%",( ( Square( "%Raster%" - "%CN_2S_7ma%" ) ) / ( “%Raster%” + "%CN_8S_7ma%" ) ), 0 ) ), 0 )

Figure 1: print screen of my "not working" model Builder :(

Figure 1: print screen of my "not working" model Builder :(

closed as off-topic by Vince, Brad Nesom, PolyGeo Aug 17 '15 at 21:27

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Vince, Brad Nesom, PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • THANK YOU SO MUCH MWrenn and BruceDoh!!! that was all the problem... I wrote with colors and others in Word first... and then copy/paste to raster calculator. It's my first time writing long commands there... so I thought that writing in colors for the (((()))) it would help... ¬¬ I'm so happy that was all the problem... !!! Thank you so so much again!!! – Dana Aug 17 '15 at 16:02
1

Check your quotation marks. Some of them are normal double quotes, but some of them are 'curly quotes', specifically the ones around your %raster% variables. This may have happened if you copied and pasted something out of a Microsoft program, as they love to convert your normal quotes to curly/smart quotes. It's really obvious if you copy and paste your expression into a text editor like notepad++.

The quick fix is to delete the quotation marks and retype them in the raster calculator. I'm not sure if that's the only problem with the expression, but I believe it's at least one of the issues.

  • Was just about to post this. I got syntax errors with the expression Dana posted, but this line works fine for me: Con("%Raster%">0, Con("%Raster%" >= "%CN_2S_7ma%", Square("%Raster%" - "%CN_2S_7ma%") / ("%Raster%" + "%CN_8S_7ma%"), 0), 0) – BruceDoh Aug 17 '15 at 15:13

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