Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integrating inc, azi and dls for all interpolated points #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading