geodetic_engine.welltrajectory

Well trajectories: directional surveys positioned in a CRS.

Public entry points:

  • TrajectoryInput – everything a trajectory is computed from: the survey, the wellhead, the CRS and the settings. Built from arrays, rows, a DataFrame, a survey file or an OSDU request body, and computed with TrajectoryInput.compute().

  • WellTrajectory – the result: positions, angles and dogleg severity at every point, with their provenance.

  • compute_trajectory() – the same computation from a Survey, a wellhead and a CRS given separately.

  • MinimumCurvature – the minimum curvature method on its own, free of any CRS, for offsets, dogleg severity and interpolation along the arcs.

  • Method – how offsets are georeferenced in the CRS.

  • plot_trajectory() and open_in_browser() – a 3D view to rotate, pan and zoom, in a notebook or a browser; needs the plot extra.

The input and the result are in geodetic_engine.welltrajectory.datamodels; a synthetic survey file to try them on is in the example_data folder beside this file. See README.md there too, for the conventions.

Example

>>> from geodetic_engine.welltrajectory import TrajectoryInput
>>> well = TrajectoryInput.from_arrays(
...     md=[0, 1000, 2000],
...     inclination=[0, 30, 60],
...     azimuth=[45, 45, 45],
...     wellhead=(500000.0, 6600000.0, 25.0),
...     crs="EPSG:32631",
...     north_reference="GN",
... )
>>> well.compute().to_dataframe()

Functions

angle_factor

Radians per unit, as geodetic_engine.units.angle_unit() reads it.

compute_trajectory

Position a surveyed wellbore in a CRS.

length_factor

Metres per unit, as geodetic_engine.units.length_unit() reads it.

open_in_browser

Open a plotly figure in the default browser, and return its address.

plot_trajectory

Draw trajectories as an interactive plotly figure.

Classes

LocalFrame

The wellhead, and the CRS and datum a trajectory is placed in.

Method

How offsets from the wellhead are georeferenced in the trajectory CRS.

MinimumCurvature

Positions along a surveyed wellbore by the minimum curvature method.

NorthReference

What a survey's azimuths are measured from, "GN" or "TN".

Placement

Where a method put the stations.

Stations

Survey points with the positions minimum curvature gives them.

Survey

Survey stations, with the units their values are stated in.

TrajectoryInput

Everything a well trajectory is computed from.

TrajectoryOptions

The optional settings of a TrajectoryInput, as keyword arguments.

Wellhead

Where the survey starts: the position of its first station.

WellTrajectory

Positions along a wellbore, with how they were arrived at.

Exceptions

DegenerateSurveyError

Two stations point in opposite directions, leaving the arc plane undefined.

InvalidInputError

A trajectory input is incomplete or malformed.

InvalidSurveyError

The survey cannot describe a wellbore as given.

UnitError

A unit was not recognised, or is not a unit of the quantity needed.

WellTrajectoryError

Base class for all well trajectory failures.