Skip to content

Commit

Permalink
update returns statements and high_tan math
Browse files Browse the repository at this point in the history
  • Loading branch information
Zabamund committed Aug 19, 2019
1 parent 78ae65f commit b2a38dc
Showing 1 changed file with 55 additions and 43 deletions.
98 changes: 55 additions & 43 deletions wellpathpy/tan.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@
from .checkarrays import checkarrays

def tan_method(md, inc, azi, choice='avg'):
"""
Calculate TVD using one of the tangential method.
"""Calculate TVD using one of the tangential method.
Parameters
----------
md: float, measured depth in m or ft
inc: float, well deviation in degrees
azi: float, well azimuth in degrees
choice: str, choice of tangential method to run
md : float
measured depth
inc : float
well deviation in degrees
azi : float
well azimuth in degrees
choice : str
choice of tangential method to run
Returns
-------
Deviation converted to TVD, easting, northing
tvd,
northing,
easting
tvd : array_like of float
true vertical depth
northing : array_like of float
easting : array_like of float
"""

if choice == 'bal':
Expand Down Expand Up @@ -61,38 +64,48 @@ def tan_method(md, inc, azi, choice='avg'):
return tvd, northing, easting

def high_tan(md, inc, azi):
"""
Calculate TVD using high tangential method.
"""Calculate TVD using high tangential method.
This method takes the sines and cosines of the inclination and azimuth
at the bottom of the survey interval to estimate tvd.
This method is not recommended as it can make gross tvd and offset
errors in typical deviated wells.
Formula
-------
northing = sum((md_lower - md_upper) * sin(inc_lower) * cos(azi_lower))
easting = sum((md_lower - md_upper) * sin(inc_lower) * sin(azi_lower))
tvd = sum((md_lower - md_upper) * cos(azi_lower))
Parameters
----------
md : float
measured depth
inc : float
well deviation in degrees
azi : float
well azimuth in degrees
Notes
-----
Formulae:
.. math::
northing = \sum (md_l - md_u) \cdot sin(inc_l) \cdot cos(azi_l)
.. math::
easting = \sum(md_l - md_u) \cdot sin(inc_l) \cdot sin(azi_l)
.. math::
tvd = \sum(md_l - md_u) \cdot cos(azi_l)
where:
md_upper: upper survey station depth MD
md_lower: lower survey station depth MD
inc_lower: lower survey station inclination in degrees
azi_lower: lower survey station azimuth in degrees
Parameters
----------
md: float, measured depth in m or ft
inc: float, well deviation in degrees
azi: float, well azimuth in degrees
:math:`md_u`: upper survey station depth MD
:math:`md_l`: lower survey station depth MD
:math:`inc_l`: lower survey station inclination in degrees
:math:`azi_l`: lower survey station azimuth in degrees
Returns
-------
Deviation converted to TVD, easting, northing
tvd in m or feet,
northing in m or feet,
easting in m or feet
tvd : array_like of float
true vertical depth
northing : array_like of float
easting : array_like of float
"""
return tan_method(md, inc, azi, choice='high')

Expand Down Expand Up @@ -125,10 +138,10 @@ def low_tan(md, inc, azi):
Returns
-------
Deviation converted to TVD, easting, northing
tvd in m or feet,
northing in m or feet,
easting in m or feet
tvd : array_like of float
true vertical depth
northing : array_like of float
easting : array_like of float
"""
return tan_method(md, inc, azi, choice='low')

Expand Down Expand Up @@ -161,10 +174,10 @@ def average_tan(md, inc, azi):
Returns
-------
Deviation converted to TVD, easting, northing
tvd in m or feet,
northing in m or feet,
easting in m or feet
tvd : array_like of float
true vertical depth
northing : array_like of float
easting : array_like of float
"""
return tan_method(md, inc, azi, choice='avg')

Expand Down Expand Up @@ -200,11 +213,10 @@ def balanced_tan(md, inc, azi):
Returns
-------
Deviation converted to TVD, easting, northing
tvd in m or feet,
northing in m or feet,
easting in m or feet
tvd : array_like of float
true vertical depth
northing : array_like of float
easting : array_like of float
"""
md, inc, azi = checkarrays(md, inc, azi)

Expand Down

0 comments on commit b2a38dc

Please sign in to comment.