Skip to content

Commit

Permalink
EditFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderJuestel committed Jan 27, 2024
1 parent 758bf8d commit 5afae97
Show file tree
Hide file tree
Showing 7 changed files with 311 additions and 193 deletions.
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Welcome to PyBorehole's documentation!
about
installation
contributing
tutorials
modules


Expand Down
101 changes: 45 additions & 56 deletions docs/source/notebooks/02_Adding_Deviation_to_Borehole_Object.ipynb

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions docs/source/tutorials.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _tutorials_ref:

Tutorials
=========

.. toctree::
:maxdepth: 1
:caption: Examples

notebooks/01_Creating_a_new_Borehole_Object
notebooks/02_Adding_Deviation_to_Borehole_Object
notebooks/03_Adding_Casing_Scheme
notebooks/04_Adding_Well_Logs
notebooks/05_Calculating_Properties_from_Well_Logs
285 changes: 171 additions & 114 deletions pyborehole/borehole.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pyborehole/design.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class WellDesign:
>>> borehole.add_well_design()
>>>
.. versionadded:: 0.0.1
"""

def __init__(self,
Expand Down
98 changes: 77 additions & 21 deletions pyborehole/deviation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pandas as pd
import numpy as np
from typing import Union
from typing import Union, Tuple
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection

Expand All @@ -17,13 +18,13 @@ class Deviation:
step : float, default: ``5``
Step for resampling the deviation data, e.g. ``step=5``.
md_column : str, default: ``'MD'``
Column containing the measured depths.
Column containing the measured depths, e.g. ``md_column='MD'``.
dip_column : str, default: ``'DIP'``
Column containing the dip values.
Column containing the dip values, e.g. ``dip_column='DIP'``.
azimuth_column : str, default: ``'AZI'``
Column containing the azimuth values.
Column containing the azimuth values, e.g. ``azimtuh_column='AZI'``.
add_origin: bool, default: ``True``
Boolean value to add the location of the borehole to survey DataFrames.
Boolean value to add the location of the borehole to survey DataFrames, e.g. ``add_origin=True``.
Returns
_______
Expand All @@ -42,17 +43,21 @@ class Deviation:
>>> borehole.init_properties(address='Am Kraftwerk 17, 52249 Eschweiler, Deutschland', location=(6.313031, 50.835676), crs='EPSG:4326', altitude_above_sea_level=136, borehole_id='DABO123456')
>>> borehole.add_deviation(path='Deviation.csv', delimiter=';', md_column='MD', dip_column='DIP', azimuth_column='AZI')
>>> borehole.deviation.deviation_df
Measured Depth Inclination Azimuth
0 0.05 0.0 0.0
1 0.10 0.0 0.0
2 0.15 0.0 0.0
======= ================ ============= =========
Index Measured Depth Inclination Azimuth
======= ================ ============= =========
0 0.05 0.0 0.0
1 0.10 0.0 0.0
2 0.15 0.0 0.0
======= ================ ============= =========
See Also
________
add_litholog : Add LithoLog to the Borehole Object.
add_well_design : Add Well Design to the Borehole Object.
add_well_logs : Add Well Logs to the Borehole Object.
add_well_tops : Add Well Tops to the Borehole Object.
pyborehole.borehole.Borehole.add_litholog : Add LithoLog to the Borehole Object.
pyborehole.borehole.Borehole.add_well_design : Add Well Design to the Borehole Object.
pyborehole.borehole.Borehole.add_well_logs : Add Well Logs to the Borehole Object.
pyborehole.borehole.Borehole.add_well_tops : Add Well Tops to the Borehole Object.
.. versionadded:: 0.0.1
"""
Expand Down Expand Up @@ -261,9 +266,33 @@ def add_origin_to_desurveying(self,
________
>>> from pyborehole.borehole import Borehole
>>> borehole = Borehole(name='Weisweiler R1')
>>> borehole.init_properties(address='Am Kraftwerk 17, 52249 Eschweiler, Deutschland', location=(6.313031, 50.835676), crs='EPSG:4326', altitude_above_sea_level=136, borehole_id='DABO123456')
>>> borehole.init_properties(address='Am Kraftwerk 17, 52249 Eschweiler, Deutschland', location=(310805, 5634992), crs='EPSG:25832', altitude_above_sea_level=136, borehole_id='DABO123456')
>>> borehole.add_deviation(path='Deviation.csv', delimiter=';', md_column='MD', dip_column='DIP', azimuth_column='AZI')
>>> borehole.deviation.add_origin_to_desurveying(x=100, y=100, z=000)
>>> borehole.deviation.desurveyed_df.head()
======= =================== ============ ===========
Index True Vertical Depth Northing_rel Easting_rel
======= =================== ============ ===========
0 0.0 0.0 0.0
1 5.0 0.0 0.0
2 10.0 0.0 0.0
3 15.0 0.0 0.0
4 20.0 0.0 0.0
======= =================== ============ ===========
>>> borehole.deviation.add_origin_to_desurveying()
>>> borehole.deviation.desurveyed_df.head()
======= ===================== ============== ============= ========== ========== ======================================
Index True Vertical Depth Northing_rel Easting_rel Easting Northing True Vertical Depth Below Sea Level
======= ===================== ============== ============= ========== ========== ======================================
0 0.0 0.0 0.0 310805 5634992 136
1 5.0 0.0 0.0 310805 5634992 131
2 10.0 0.0 0.0 310805 5634992 126
3 15.0 0.0 0.0 310805 5634992 121
4 20.0 0.0 0.0 310805 5634992 116
======= ===================== ============== ============= ========== ========== ======================================
See Also
________
Expand Down Expand Up @@ -298,10 +327,10 @@ def add_origin_to_desurveying(self,
z = self._borehole.altitude_above_sea_level

# Adding the X coordinate
self.desurveyed_df['Northing'] = self.desurveyed_df['Northing_rel'] + y
self.desurveyed_df['Easting'] = self.desurveyed_df['Easting_rel'] + x

# Adding the Y coordinate
self.desurveyed_df['Easting'] = self.desurveyed_df['Easting_rel'] + x
self.desurveyed_df['Northing'] = self.desurveyed_df['Northing_rel'] + y

# Adding the Z coordinate
self.desurveyed_df['True Vertical Depth Below Sea Level'] = z - self.desurveyed_df['True Vertical Depth']
Expand All @@ -322,7 +351,7 @@ def plot_deviation_polar_plot(self,
c: np.ndarray = None,
vmin: Union[float, int] = None,
vmax: Union[float, int] = None,
cmap: str = 'viridis'):
cmap: str = 'viridis') -> Tuple[matplotlib.figure.Figure, matplotlib.axes.Axes]:
"""Add polar plot representing the deviation of a borehole.
Parameters
Expand All @@ -336,6 +365,13 @@ def plot_deviation_polar_plot(self,
cmap : str, default: ``'viridis'``
Name of the colormap to be used, e.g. ``cmap='viridis'``.
Returns
_______
fig : matplotlib.figure.Figure
Matplotlib figure.
ax : matplotlib.axes.Axes
Matplotlib axis.
Raises
______
TypeError
Expand Down Expand Up @@ -423,7 +459,7 @@ def plot_deviation_3d(self,
elev: Union[float, int] = 45,
azim: Union[float, int] = 45,
roll: Union[float, int] = 0,
relative: bool = False):
relative: bool = False) -> Tuple[matplotlib.figure.Figure, matplotlib.axes.Axes]:
"""Create 3D Deviation Plot.
Parameters
Expand All @@ -439,7 +475,7 @@ def plot_deviation_3d(self,
Returns
_______
fig : matplotlib.figure
fig : matplotlib.figure.Figure
Matplotlib figure.
ax : matplotlib.axes.Axes
Matplotlib axis.
Expand Down Expand Up @@ -529,7 +565,7 @@ def get_borehole_tube(self,
Returns
_______
tube : pv.Tube
tube : pv.core.pointset.PolyData
PyVista Tube of the borehole.
Raises
Expand All @@ -545,6 +581,26 @@ def get_borehole_tube(self,
>>> borehole.add_deviation(path='Deviation.csv', delimiter=';', md_column='MD', dip_column='DIP', azimuth_column='AZI')
>>> borehole.deviation.get_borehole_tube(radius=10)
========== =======================
PolyData Information
========== =======================
N Cells 220
N Points 800
N Strips 220
X Bounds 3.108e+05, 3.108e+05
Y Bounds 5.635e+06, 5.635e+06
Z Bounds -1.000e+02, 0.000e+00
N Arrays 2
========== =======================
============= ========= ========= ======== ============ ============
Name Field Type N Comp Min Max
============= ========= ========= ======== ============ ============
TubeNormals Points float32 3 -1.000e+00 1.000e+00
TVD Points float64 1 -1.000e+02 0.000e+00
============= ========= ========= ======== ============ ============
See Also
________
add_origin_to_desurveying : Add origin to desurveying.
Expand Down
4 changes: 2 additions & 2 deletions pyborehole/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ def plot_well_logs(self,
__________
tracks : Union[str, list]
Name/s of the logs to be plotted, e.g. ``tracks='SGR'`` or ``tracks=['SGR', 'K'].
Name/s of the logs to be plotted, e.g. ``tracks='SGR'`` or ``tracks=['SGR', 'K']``.
depth_column : str
Name of the column holding the depths, e.g. ``depth_column='MD'``.
colors : Union[str, list]
Colors of the logs, e.g. ``colors='black'`` or ``colors=['black', 'blue'].
Colors of the logs, e.g. ``colors='black'`` or ``colors=['black', 'blue']``.
add_well_tops : bool, default = False
Boolean to add well tops to the plot.
add_well_design : bool, default = False
Expand Down

0 comments on commit 5afae97

Please sign in to comment.