How to add field for depth below stratum?

Hi,

I am new to gINT, my goal is to plot a graph that shows Data vs depth below stratum top (e.g. the ground comprises 0.2m Topsoil + 0.8m Clay and I want to plot the data at 1m bgl as 0.8m instead).

In excel, I was able to obtain such depth by looking up the geology code with the same borehole ID and subtract the sample depth by stratum top depth. In gINT, I am not so sure how it works. I imagine I can create a new field for stratum top depth next to each geology top depth, so that the "depth below stratum top" can be calculated in the sampling tab? gINT Rule might be involved or maybe I can achieve the same outcome in a simpler way? 

Thank you very much,

Krist

  • It is not really clear to me what it is that you want to accomplish but generally speaking gINT has functions very similar to excel...some even with the same name.  If you can do it in excel you can probably do it in gINT. the gINT syntax is a bit different than the excel syntax but very similar.  each function has a function name followed by arguments in parenthesis and separated by commas. The example below illustrates a method to obtain the depth below the top of the layer in a simple depth vs text entity in a log form. I understand that this is not what you want to do but you can use it to modify your graph entity in a similar manner.

    Assume you have a table named lithology with a PointID, depth key set and data as below.

    You also have a LAB_TEST table with keyset PointID, depth containing the following data

    placing the following code in the Text Expression field of a depth vs text entity

    <<B>><<U>><<LAB_TEST.LAB_NO>>(<<format(<<LAB_TEST.Depth>>,0.0)>>-<<format(<<LAB_TEST.LAB_BOTTOM>>,0.0)>>)<<U>><<B>>
    <<HasData(<<LAB_TEST.PPEN>>,PPen=<<LAB_TEST.PPEN>>)>>
    <<Calc(<<LAB_TEST.Depth>>-<<SqlRange(<<LAB_TEST.Depth>>,[LITHOLOGY].[Depth],,,0)>>)>> ft below layer top

    Produces the following result in the test result column below

    The first line of the code prints the test number and top and bottom depth bolded and underlined

    The second line prints the test results

    The third line prints the depth below the top of the layer calculated as the top depth of the test minus the top depth of the lithology layer that contains the top depth of the test result. Breaking the code down: the calc function simply forces the calculation of the arithmetic formula (subtraction) as an argument. The test top depth is the first part of the arithmetic expression. The second part of the arithmetic expression uses the SqlRange function to lookup the top depth of the test in the lithology table and return the top depth of the lithology layer that contains that depth.  The SqlRange function has 5 comma separated arguments and is similar to the excel vlookup function.  The first argument is the value to lookup (in this case the top depth of the test result). The second argument identifies the table to lookup that depth in and the field to return (in this case look it up in the lithology table and return the top depth). The third and 4th arguments specify which fields in the lithology table to use as the bottom and top depths.  In this case since I used the gINT default names for these fields I can omit these arguments.  The 5th argument is a numeric code that tells gint how to treat lookups that land exactly on a boundary (0 in this case).

    The first example top depth is 1.0. This places it in the subbase layer that has a top depth of 0.9. thus 1.0-0.9=0.1' below the top of the subbase layer.

    The second example top depth is 6.0. This places it in Gravelly SILT layer that has a top depth 0f 4.3. Thus 6.0-4.3=1.7' below the top of the layer.

    Note that the SqlRange function requires you to use SQL format for arguments 2,3, and 4; not gINT format.

    For more help/info on the SqlRange function search for it in the help file.

    Hope this points you in the right direction.

  • As another twist on the same example above that might be more in line with what you want to do, you could use the gINT lookup function to search for a specific geologic layer top to calculate the depth below top of that specific layer.  This is similar to specifying an exact lookup in excel. For the above example the code would be:

    <<Calc(<<LAB_TEST.Depth>>-<<Lookup(<<LITHOLOGY.Depth>>,<<LITHOLOGY.Strata_ID>> = "COE-CL")>>)>> ft below top of CL layer

    The first argument of the lookup function specifies the table and field to return, in this case the top depth of the layer.  the second argument specifies the fields to compare, in this case find the record where the strata_ID field equals COE-CL.  The comparison could also be to a user variable rather than a literal value hardwired into the code.  Again use the help file to provide more information on the lookup function.

    This would return the following for each test result in the above example...

    The first test top depth is 1.0 the lookup will return the top depth of the lean clay layer (strata_ID code COE-CL) as 1.3' . Thus 1.0-1.3 = -0.3 ft below top of CL layer (ie above the clay layer)

    The second test top depth is 6.0  as above, the lookup will return the top depth of the lean clay layer (strata_ID code COE-CL) as 1.3'. So 6.0-1.3 = 4.7 ft below top of CL layer

    The example used functions to output the desired depths below top of layer as a text string but the same functions can be used to compute the plot depth on a log or the plot coordinates for a graph.

  • Thank you very much for the help! I think I do understand the logic now, I will try it out shortly Slight smile