Skip to content

Commit

Permalink
integrating inc, azi and dls for all interpolated points
Browse files Browse the repository at this point in the history
  • Loading branch information
jcamiloangarita committed Oct 23, 2023
1 parent e774408 commit e125bd2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
setup(
name='well_profile',
packages=['well_profile'],
version='0.7.3',
version='0.8.0',
license='LGPL v3',
description='Well Profile Builder',
long_description=long_description,
Expand Down
6 changes: 6 additions & 0 deletions well_profile/equations.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,19 +263,25 @@ def interp_hold(inner_point, md, p1, p2):
dn = (p2['north']-p1['north']) / (p2['md'] - p1['md'])
de = (p2['east'] - p1['east']) / (p2['md'] - p1['md'])
dv = (p2['tvd'] - p1['tvd']) / (p2['md'] - p1['md'])
inner_point['dls'] = 0
inner_point['north'] = p1['north'] + (md - p1['md']) * dn
inner_point['east'] = p1['east'] + (md - p1['md']) * de
inner_point['tvd'] = p1['tvd'] + (md - p1['md']) * dv
inner_point['inc'] = p1['inc']
inner_point['azi'] = p1['azi']
inner_point['pointType'] = 'interpolated'
inner_point['sectionType'] = 'hold'

return inner_point


def interp_vertical(inner_point, md, p1):
inner_point['dls'] = 0
inner_point['north'] = p1['north']
inner_point['east'] = p1['east']
inner_point['tvd'] = p1['tvd'] + (md - p1['md'])
inner_point['inc'] = p1['inc']
inner_point['azi'] = p1['azi']
inner_point['pointType'] = 'interpolated'
inner_point['sectionType'] = 'vertical'

Expand Down
8 changes: 7 additions & 1 deletion well_profile/load_trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@ def load(data, **kwargs):
az[a] += change_azimuth

# CREATING TRAJECTORY POINTS
trajectory = [{'md': 0, 'inc': 0, 'azi': 0, 'dl': 0, 'tvd': 0, 'sectionType': 'vertical', 'pointType': 'survey'}]
# if the first survey point is at MD=0, use it as the initial point
if md[0] == 0:
trajectory = [{'md': 0, 'inc': inc[0], 'azi': az[0], 'dl': 0, 'tvd': 0, 'sectionType': 'vertical',
'pointType': 'survey'}]
else:
trajectory = [
{'md': 0, 'inc': 0, 'azi': 0, 'dl': 0, 'tvd': 0, 'sectionType': 'vertical', 'pointType': 'survey'}]
trajectory[-1].update(initial_point)
inner_pts += 2

Expand Down
5 changes: 3 additions & 2 deletions well_profile/tests/test_well.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ def test_get_point(self):

# interpolating vertical section
p = well.get_point(100)
self.assertTrue(p == {'md': 100, 'dl': 0.0, 'north': 0, 'east': 0, 'tvd': 100, 'pointType': 'interpolated',
'sectionType': 'vertical'})
self.assertTrue(p == {'md': 100, 'dl': 0.0, 'dls': 0, 'north': 0, 'east': 0, 'tvd': 100,
'inc': 0, 'azi': 0,
'pointType': 'interpolated', 'sectionType': 'vertical'})
# getting two survey points
p1 = well.get_point(3722.9)
p2 = well.get_point(3761.8)
Expand Down

0 comments on commit e125bd2

Please sign in to comment.