Skip to main content

deviation2welltrajectory

A script to help converting deviation surveys exported from Petrel (Schlumber) to include files apropriate for ECHELON (Stone Ridge Technology) using the ECHELON keyword WELL_TRAJECTORY, or for OPM flow using WELTRAJ keyword.

How to use:

from the command line or terminal

run the python command:
python -m deviation2welltrajectory input_path [output_filepath] [-e [extension]] [-r [recursive]] [-m [md_col]] [-x [x_col]] [-y [y_col]] [-z [z_col]] [-i [negate_x]] [-j [negate_y]] [-k [negate_z]] [-u [output_units]]

where input_path can be:

  • the path to the deviation survey file to be converted
  • a folder containing the deviation files - all the files will be converted -
  • a pattern representing the files to be processed

The rest of the parameters are described under the Parameters section.

from Python

import deviation2welltrajectory as d2wt
d2wt.convert( input filepath, [output path] )

Parameters

Only the fist parameter, input_filepath, indicative of the input file or directorty from which to look for deviation files, is mandatory.

input and output parameters

input_filepath: str
a string representing one of the following:
- the path to the input deviation file.
- the path to the folder containing the deviation files, all the .dev files will be processed.
- a pattern that will find the files to be processed.

output_filepath: [optional] str or None
a string representing the path to the file where to write out the keyword.
if None, the same input_filepath will be used, appending the suffix _WELL_TRAJECTORY to the name, and using the extension .INC.
default: None

extension: [optional] str
the extension for the deviation files to look for.
default: '.dev'

recursive: [optional] bool
if a folder is provided as input_filepath, set recursive True to search for deviation files in subfolders.
default: True

keyword_format: [optional] str 'echelon', 'flow', or 'resinsight'
Set the format of the output file to be written for Echelon simulator, OPM flow simulator, or ResInsight visualization.
default: 'echelon'

suffix: [optional] str
A string to appended as suffix to the orinal file name when writting the keyword include file. To remove the suffix use the bool False or empty string ''. default: 'WELL_TRAJECTORY' when keyword_format='echelon' 'WELTRAJ' when keyword_format='flow'

to set alternative input colums

md_col: [optional] str
string indicating the name of the MD column in the deviation survey
default: 'MD'

x_col: [optional] str
string indicating the name of the X coordinate column in the deviation survey
default: 'X'

y_col: [optional] str
string indicating the name of the Y coordinate column in the deviation survey
default: 'Y'

z_col: [optional] str
string indicating the name of the Z coordinate column in the deviation survey
default: 'Z'

to correct coordinates system, units, and well name case

output_units: [optional] str 'field' or 'metric' or None the output will be converted to requested units, assuming original units as per the header description at the lines following these patterns:
- # DX DY ARE GIVEN IN * *-UNITS
- # DEPTH (Z, tvd_z) GIVEN IN *-UNITS default: None

negate_x, negate_y: [optional] bool
if set to True the values from X column will be multiplied by -1.
if False, will not be change.
default: False

negate_z: [optional] bool
if set to True the values from Z column will be multiplied by -1. - deviation surveys normally consider the vertical axes as height (positive towards the sky with reference at sea level), therefore, values below the sea level are expressed as negative numbers.
- ECHELON simulator considers the vertical axes positive towards the earth centre, thus, negative values from deviation surveys must be multiplied by -1 in order to intersect the grid.
if False, will not be change.
default: False

wellname_case: str 'upper', 'lower' or 'title', or None A string indicating if the wellnames case should be changed, to uppercase or lowercase, or left as original. - 'upper' to convert the wellnames to 'UPPER CASE'. - 'lower' to convert the wellnames to 'lower case'. - 'title' to convert the wellnames to 'Title Case'. - None to leave the wellname as stated in the deviation survey. default: None

convert_md_to, convert_x_to, convert_y_to, convert_z_to: [optional] float, str or None
These parameters overide the automatic conversion settings!
The values provided with any of these parameters will ignore the automatic conversion from the output_units parameter.
The coordinates not indicated by any of the convert_*?*_to keywords will be reported as per their original values.
The alternative values accepted by these keywords are:
- if a float is provided, the deviation column will be multiplied by that number.
- if one the strings 'ft' or 'm' is provided, the corresponding multiplier to convert m->ft or ft->m will be applied.
- if None, the conversion will be based on the output_units argument and the input data inferred from the header of the deviation survey.
default: None

Release files for deviation2welltrajectory 0.0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deviation2welltrajectory 0.0.12
File Size Uploaded
deviation2welltrajectory-0.0.12.tar.gz 16.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for deviation2welltrajectory 0.0.12
File Interpreter ABI Platform
deviation2welltrajectory-0.0.12-py3-none-any.whl Python 3 none any Details

Total release size: 38.7 kB

Release files / deviation2welltrajectory-0.0.12.tar.gz

Download URL deviation2welltrajectory-0.0.12.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5ae1859f82d2e8456f1231272496e998b40a4873f48480778517c1449e8231d1
BLAKE2b-256 checksum
How to use checksums
eaed9e506f92a7ed1b20bc511ee1a839f7afb77167f5d734bcc000e775a8303e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / deviation2welltrajectory-0.0.12-py3-none-any.whl

Download URL deviation2welltrajectory-0.0.12-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae1dfaa8b9339dea02767ac2a50df0a8da88179590f9a3368deb60a1f943dad7
BLAKE2b-256 checksum
How to use checksums
fca8df66b77f3b9770c2f2d894d81ae9a88e4c21027600c67acbd6ada7401f11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

0.0.12 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page