bdm8641

Python Code for VRT Lime

Discussion created by bdm8641 on May 23, 2011
I am new to this and I'm just now trying to get info on Python code for if then statements:  Does anyone know how to write a code in field calculator for this Lime recommendation.  I was using SST Toolbox which used the ArcGIS 3.X background and the code (don't even know what code form this is) we used for this example was the following (pHb and adj_pH are still the fields I use and $SoilSampleDepth would bring up a text window asking what depth did we want to run this lime rec for):

( ( [pHb] >= 6.0 ) and ( [pHb] <= 6.9) and ( [adj_ph]  <= 6.1 ) ) : ( ( 47 - ( 6.75 * [pHb] ) ) * ( $SoilSampleDepth  / 8 ) * 1 ) *2000
( ( [pHb] >= 6.0 ) and ( [pHb] <= 6.9) and ( [adj_ph]  = 6.4 ) ) : ( ( 47 - ( 6.75 * [pHb] ) ) * ( $SoilSampleDepth  / 8 ) * 0.5 ) *2000
( ( [pHb] < 6.0 ) and ( [adj_ph]  <= 6.1 ) ) : ( ( 47.6 - ( 6.75 * [pHb] ) ) * ( $SoilSampleDepth  / 8 ) * 1 ) *2000
(  ( [pHb] < 6.0 ) and ( [adj_ph]  = 6.4 ) ) : ( ( 47.6 - ( 6.75 * [pHb] ) ) * ( $SoilSampleDepth  / 8 ) * 0.5 ) *2000
(  ( [pHb] = 7.0) and ( [adj_ph]  < 5.0 ) ) :  (0.3 * ( $SoilSampleDepth  / 8 ) ) *2000
(  ( [pHb] = 7.0) and ( [adj_ph]  >= 5.0 )  and ( [adj_ph]  < 6.4 ) ) :  (0.2 * ( $SoilSampleDepth  / 8 ) ) *2000
(  ( [pHb] = 7.1 ) and ( [adj_ph]  < 5.0 ) ) : (0.2 * ( $SoilSampleDepth  / 8 ) ) *2000
(  ( [pHb] = 7.1)  and ( [adj_ph]  >= 5.0 ) and ( [adj_ph]  < 6.4 ) ) : ( 0.1 * ( $SoilSampleDepth  / 8 ) ) *2000
([adj_ph]  > 6.4) : 0

Outcomes