From 6e327b64b2273fd5941ee2eaec71d7986b78cda4 Mon Sep 17 00:00:00 2001 From: Roman Shor Date: Fri, 2 Jun 2023 11:28:56 +0200 Subject: [PATCH 1/2] Allow defined INC,AZI at surf,corrected interp bug --- well_profile/equations.py | 4 ++++ well_profile/load_trajectory.py | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/well_profile/equations.py b/well_profile/equations.py index ad74445..bb22874 100644 --- a/well_profile/equations.py +++ b/well_profile/equations.py @@ -266,6 +266,8 @@ def interp_hold(inner_point, md, p1, p2): 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' @@ -276,6 +278,8 @@ def interp_vertical(inner_point, md, p1): 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' diff --git a/well_profile/load_trajectory.py b/well_profile/load_trajectory.py index 133d611..1468917 100644 --- a/well_profile/load_trajectory.py +++ b/well_profile/load_trajectory.py @@ -110,7 +110,12 @@ 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 From 72feb48c62854a77a96d9909e4012e6310fb7f97 Mon Sep 17 00:00:00 2001 From: Roman Shor Date: Fri, 2 Jun 2023 11:40:37 +0200 Subject: [PATCH 2/2] Updated to version 0.7.4, added to CHANGELOG --- CHANGELOG.md | 5 +++++ setup.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d73bd76..2180e49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [v0.7.4] - 2023-06-02 +### Changed +- if first row of survey starts with MD=0 and non-zero INC or AZ, those values are used +- added 'inc' and 'azi' to returned interpolated point for points in hold and vertical sections + ## [v0.6.0] - 2021-06-16 ### Added - Top view plot diff --git a/setup.py b/setup.py index 89a0add..0f5c92a 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='well_profile', packages=['well_profile'], - version='0.7.3', + version='0.7.4', license='LGPL v3', description='Well Profile Builder', long_description=long_description,