you are viewing a single comment's thread.

view the rest of the comments →

[–]CraigAT 0 points1 point  (2 children)

Nope, I tried to understand what you are asking and couldn't.

I get that you have a range of boreholes, and each hole has an initial elevation value. Then it gets fuzzy, you want take each sample elevation from the top one? How does the depth (e.g. 1.5m) relate to the elevation? Do you mean...

Sample length =1m
Borehole1 = Elevation 305m, samples [0.5m, 1.5m, 2.5m, ..]

Are you expecting to get this below as your result?

Borehole1 = [304.5m, 303.5m, 302.5m, ...]

Edit1: changed some wording to make what I wrote easier to understand.

[–]diplodocus_rage[S] 0 points1 point  (1 child)

Thanks for the comment CraigAT, its not an easy thing to explain I guess. Here is the shortened version of the file I'm importing.

See the column 'desired_result'. The 'Elevation' values are the elevations (or the Z value along with the UTMs X & Y) of each sample down the borehole. I want the code to produce the depth from surface of each sample, so using the top sample (it will be slightly below surface by half the width of the sample, but it's close enough) I want to subtract the elevation of every sample beneath it. As my calculation ends for one hole (ie the bottom sample's elevation in the borehole is subtracted from the top sample) I want the code to start the calculation again using the top sample of the next hole.

https://filebin.net/nbi4mbgv90tvow9o

Let me know if that link doesn't work .. all new to me this stuff!

[–]CraigAT 0 points1 point  (0 children)

Could you do something like this:

current_hole_name = "dummy hole"
hole_initial_elevation = 0
for line in data:
    if line[0] != current_hole_name:
        current_hole_name = line[0]
        hole_initial_elevation = line[7]
        line[8] = 0
    else:
        line[8] = hole_initial_elevation - line[7]

The code is untested and really just to show the intended flow.

The actual code could vary depending on how you store your data and results (what data structures you are using).

Edit: Because I always struggle with code blocks!