-
Notifications
You must be signed in to change notification settings - Fork 1
/
gallerini.py
74 lines (68 loc) · 3.33 KB
/
gallerini.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import pandas as pd
def geoSurvey(Dataframe, cols_in, cols_out, Imax=0.2):
# Imax = intervale depth
bue = []
# loop over all the data (pick each row)
for index, row in Dataframe.iterrows():
if 0 < Dataframe[cols_in[2]][index]-Dataframe[cols_in[3]][index] < 1.5*Imax:
# first condition: if thickness is very low
a = [Dataframe[cols_in[0]][index],
Dataframe[cols_in[1]][index],
(Dataframe[cols_in[2]][index]+Dataframe[cols_in[3]][index])/2,
Dataframe[cols_in[4]][index],
Dataframe[cols_in[5]][index],
Dataframe[cols_in[6]][index]]
bue.append(a)
elif 1.5*Imax <= Dataframe[cols_in[2]][index]-Dataframe[cols_in[3]][index] <= 2.5*Imax:
# second way, if thicknes is between two intemediate values
a1 = [Dataframe[cols_in[0]][index],
Dataframe[cols_in[1]][index],
Dataframe[cols_in[2]][index]-Imax/2,
Dataframe[cols_in[4]][index],
Dataframe[cols_in[5]][index],
Dataframe[cols_in[6]][index]]
a2 = [Dataframe[cols_in[0]][index],
Dataframe[cols_in[1]][index],
Dataframe[cols_in[3]][index]+Imax/2,
Dataframe[cols_in[4]][index],
Dataframe[cols_in[5]][index],
Dataframe[cols_in[6]][index]]
bue.append(a1)
bue.append(a2)
# it pick two points from strata and add it to the list
elif Dataframe[cols_in[2]][index]-Dataframe[cols_in[3]][index] > 2.5*Imax:
# third way, if thicknes is higher than 2.5 Imax
X = int(round(((Dataframe[cols_in[2]][index]-Imax/2)-(Dataframe[cols_in[3]][index]+Imax/2))/Imax))+1
N = range(1, X)
# N number of intermediate point extractions in the strata
Ic = ((Dataframe[cols_in[2]][index]-Imax/2)-(Dataframe[cols_in[3]][index]+Imax/2))/X
# top extraction point
zini = [Dataframe[cols_in[0]][index],
Dataframe[cols_in[1]][index],
Dataframe[cols_in[2]][index]-Imax/2,
Dataframe[cols_in[4]][index],
Dataframe[cols_in[5]][index],
Dataframe[cols_in[6]][index]]
# bottom extraction point
zfin = [Dataframe[cols_in[0]][index],
Dataframe[cols_in[1]][index],
Dataframe[cols_in[3]][index]+Imax/2,
Dataframe[cols_in[4]][index],
Dataframe[cols_in[5]][index],
Dataframe[cols_in[6]][index]]
bue.append(zini)
bue.append(zfin)
for n in N:
bue.append([Dataframe[cols_in[0]][index],
Dataframe[cols_in[1]][index],
Dataframe[cols_in[2]][index]-Imax/2-(Ic*n),
Dataframe[cols_in[4]][index],
Dataframe[cols_in[5]][index],
Dataframe[cols_in[6]][index]])
# loop over each of the intermediate points to extract,
# defining x,y,z and litho in each, and finally adding to the list
else:
continue
geo = pd.DataFrame(bue)
geo.columns = cols_out
return geo