You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Now we can use `subsurface` function to help us reading csv files into pandas dataframes that the package can understand. Since the combination of styles data is provided can highly vary from project to project, `subsurface` provides some *helpers* functions to parse different combination of .csv
31
+
# %%
32
+
reading_collars=ReaderFilesHelper(
33
+
file_or_buffer=raw_borehole_data_csv,
34
+
index_col="name",
35
+
usecols=['x', 'y', 'altitude', "name"]
36
+
)
37
+
38
+
reading_collars
39
+
# %%
40
+
fromdataclassesimportasdict
41
+
42
+
asdict(reading_collars)
43
+
# %%
44
+
collar=read_collar(reading_collars)
45
+
46
+
collar
47
+
# %%
48
+
# Your code here:
49
+
survey=read_survey(
50
+
ReaderFilesHelper(
51
+
file_or_buffer=raw_borehole_data_csv,
52
+
index_col="name",
53
+
usecols=["name", "md"]
54
+
)
55
+
)
56
+
57
+
survey
58
+
# %%
59
+
# Your code here:
60
+
lith=read_lith(
61
+
ReaderFilesHelper(
62
+
file_or_buffer=raw_borehole_data_csv,
63
+
usecols=['name', 'top', 'base', 'formation'],
64
+
columns_map={'top' : 'top',
65
+
'base' : 'base',
66
+
'formation': 'component lith',
67
+
}
68
+
)
69
+
)
70
+
71
+
lith
72
+
73
+
# %% md
74
+
# ### Welly
75
+
#
76
+
# Welly is a family of classes to facilitate the loading, processing, and analysis of subsurface wells and well data, such as striplogs, formation tops, well log curves, and synthetic seismograms.
77
+
#
78
+
# We are using welly to convert pandas data frames into classes to manipulate well data. The final goal is to extract 3D coordinates and properties for multiple wells.
79
+
#
80
+
# The class `WellyToSubsurfaceHelper` contains the methods to create a `welly` project and export it to a `subsurface` data class.
# In the field p is stored a welly project (https://github.com/agile-geoscience/welly/blob/master/tutorial/04_Project.ipynb)and we can use it to explore and visualize properties of each well.
85
+
# %%
86
+
wts.p
87
+
# %%
88
+
stripLog=wts.p[0].data['lith']
89
+
stripLog
90
+
# %%
91
+
stripLog.plot()
92
+
plt.gcf()
93
+
# %%
94
+
welly_well=wts.p[0].data["lith_log"]
95
+
welly_well
96
+
# %% md
97
+
# ## Welly to Subsurface
98
+
#
99
+
# Welly is a very powerful tool to inspect well data but it was not design for 3D. However they have a method to export XYZ coordinates of each of the well that we can take advanatage of to create a `subsurface.UnstructuredData` object. This object is one of the core data class of `subsurface` and we will use it from now on to keep working in 3D.
# At each core `UstructuredData` is a wrapper of a `xarray.Dataset`. Although slightly flexible, any `UnstructuredData` will contain 4 `xarray.DataArray` objects containing vertex, cells, cell attributes and vertex attibutes. This is the minimum amount of information necessary to work in 3D.
111
+
# %% md
112
+
# From an `UnstructuredData` we can construct *elements*. *elements* are a higher level construct and includes the definion of type of geometric representation - e.g. points, lines, surfaces, etc. For the case of borehole we will use LineSets. *elements* have a very close relation to `vtk` data structures what enables easily to plot the data using `pyvista`
# `GemPy` interpolates the bottom of a unit, therefore we need to be able to extract those points to be able tointerpolate them. `xarray`, `pandas` and `numpy` are using the same type of memory representation what makes possible to use the same or at least similar methods to manipulate the data to our will.
# This new `UnstructuredData` object instead containing data that represent lines, contain point data at the bottom of each unit. We can plot it very similar as before:
# The temptation at this point is to bring all the points into `gempy` and just interpolate. However, often that strategy results in ill posed problems due to noise or irregularities in the data. `gempy` has been design to being able to iterate rapidly and therefore a much better workflow use to be creating the model step by step.
203
+
#
204
+
# To do that, lets define a function that we can pass the name of the formation and get the assotiated vertex. Grab from the `interf_us` the XYZ coordinates of the first layer:
0 commit comments