compute_trajectory

geodetic_engine.welltrajectory.compute_trajectory(survey, wellhead, crs, *, north=NorthReference.GRID, method=Method.AZIMUTHAL_EQUIDISTANT, z_unit='m', md_step=None, md_points=None, name=None)[source]

Position a surveyed wellbore in a CRS.

TrajectoryInput.compute() calls this with everything an input holds.

Parameters:
  • survey (Survey) – The survey stations.

  • wellhead (Wellhead | Sequence[float]) – The position of the first station, which TVD and the offsets count from: (x, y) or (x, y, z) in crs, with z its elevation in z_unit.

  • crs (Any) – The trajectory CRS: anything from_user_input() accepts, including an OSDU persistableReference or a bound CRS.

  • north (NorthReference | str, default: NorthReference.GRID) – What the azimuths are measured from, "GN" or "TN".

  • method (Method | Literal['AzimuthalEquidistant', 'GridNorthLocal', 'ENU', 'LMP'], default: Method.AZIMUTHAL_EQUIDISTANT) – How the offsets are georeferenced in crs: "AzimuthalEquidistant", the default, "GridNorthLocal", "ENU" or "LMP", or the Method member; see Method for what each does.

  • z_unit (str, default: "m") – Unit of the wellhead elevation and of every reported depth, elevation and offset.

  • md_step (float | None, default: None) – If given, also compute a point every md_step of MD, in the survey’s MD unit, between the surveyed stations.

  • md_points (ArrayLike | None, default: None) – If given, also compute a point at each of these measured depths, in the survey’s MD unit.

  • name (str | None, default: None) – The well’s name, carried to the result.

Return type:

WellTrajectory

Returns:

The positions, and how they were computed. Points added by md_step or md_points are in MD order among the stations, with is_survey_station False.

Raises:
  • InvalidInputError – If a wellhead value is not finite.

  • InvalidSurveyError – If the survey cannot describe a wellbore, or a depth in md_points is outside it.

  • UnitError – If a unit is not recognised.

  • geodetic_engine.geodesy.UnsupportedCRSError – If the CRS has no geographic or projected horizontal part, grid azimuths are given in a geographic CRS or in one whose projection does not preserve angles at the wellhead, or GridNorthLocal is asked for there.

Example

>>> survey = Survey([0, 1000, 2000], [0, 30, 60], [45, 45, 45])
>>> trajectory = compute_trajectory(
...     survey, (500000.0, 6600000.0, 25.0), "EPSG:32631", north="GN"
... )
>>> trajectory.tvd[-1].round(2), trajectory.z[-1].round(2)
(1653.99, -1628.99)