odbind.survey

Classes

Survey

A class for an OpendTect survey/project.

_SurveyObject

Base class for OpendTect survey objects - not useful on its own

Module Contents

class odbind.survey.Survey(survey_name: str, basedir: str = None)

Bases: object

A class for an OpendTect survey/project.

_new
_del
_errmsg
_isok
_bin
_bincoords
_coords
_crlrange
_feature
_features
_has2d
_has3d
_hasobject
_getobjinfo
_getobjinfobyid
_getobjinfos
_removeobj
_removeobjbyid
_createobj
_getobjnames
_info
_infos
_inlrange
_names
_path
_type
_zrange
_handle
__del__()
property handle: ctypes.c_void_p

Return the ctypes pointer to the underlying C/C++ Survey object .

property isok: bool

Return the current status of the underlying C/C++ Survey object.

property errmsg: str

Return the current error message string of the underlying C/C++ Survey object.

property has2d: bool

bool: True if the survey contains 2D data, False otherwise (readonly)

property has3d: bool

bool: True if the survey contains 3D data, False otherwise (readonly)

property survey_type: str

str: Survey type: one of 2D, 3D or 2D3D (readonly)

property zrange: list[float]

list[float]: Z range in survey definition (readonly)

property inlrange: list[int]

list[int]: inline range in survey definition (readonly)

property crlrange: list[int]

list[int]: crossline range in survey definition (readonly)

bin(x: float, y: float) tuple[int, int]

Return the nearest inline and crossline location to the given X and Y coordinates.

Parameters

xfloat

x or easting in the survey’s coordinate system

yfloat

y or northing in the survey’s coordinate system

Returns

tuple[int, int] : The nearest inline and crossline location to the given X and Y coordinates

bincoords(x: float, y: float) tuple[float, float]

Return the decimal inline and crossline location of the given X and Y coordinates.

Parameters

xfloat

x or easting in the survey’s coordinate system

yfloat

y or northing in the survey’s coordinate system

Returns

tuple[float, float] : The decimal inline and crossline location equivalent to the given X and Y coordinates

coords(iline: int, xline: int) tuple[float, float]

Return the X and Y coordinates corresponding to the given inline and crossline.

Parameters

ilineint

Inline number

xlineintfloat

Crossline number

Returns

tuple[float, float] : The X and Y coordinates equivalent to the given inline and crossline

feature() dict

Return a GeoJSON feature for the survey

info() dict

Return basic information for the OpendTect survey.

Returns

dict

has_object(objname: str, trgrpnm: str = None) bool

Return True if the specified object exists for the specified translator group in the current survey

Parameters

objnamestr

the object name

trgrpnmstr

the translator group name

Returns

True of it exists, False otherwise

get_object_info(objname: str, trgrpnm: str = None) dict

Return information for the specified object and translator group in the current survey.

Parameters

objnamestr

the object name

trgrpnmstr

the translator group name

Returns

dict

get_object_info_byid(id: str) dict

Return information for the specfied database id

Parameters

idstr

the database id

Returns

dict

get_object_infos(trgrpnm: str, all: bool = False) dict

Return information for all objects of the specified translator group.

Parameters

trgrpnmstr

the translator group name

Returns

dict

remove_object(objname: str, trgrpnm: str = None)

Remove the specified object in the specified translator group from the current survey.

Parameters

objnamestr

the object name

trgrpnmstr

the translator group name

remove_object_byid(id: str)

Remove the object associated with the specified database id in the current survey.

Parameters

idstr

the database id

create_object(objname: str, trgrpnm: str, translkey: str, overwrite: bool = False)

Create a new object associated with the specified parameters, optionally overwriting if an object of the given name already exists in the current survey.

Parameters

objnamestr

the object name

trgrpnmstr

the translator group name

translkey: str

the specific translator to use for output

overwritebool=False

if True any existing objname/trgrpnm will be overwritten

get_object_names(trgrpnm: str) list[str]

Return the names of all objects in the specified translator group

Parameters

trgrpnmstr

the translator group name

Returns

list[str]

static names(basedir: str = None) list[str]

Return the names of all surveys

Parameters

basedirstr=None

(Optional) an OpendTect data directory/folder to use, defaults to location set in user’s OpendTect settings

Returns

list[str]

static infos(fornms: list = [], basedir: str = None) dict

Return basic information for all or a subset of surveys

Parameters

fornmslist[str]=[]

(Optional) a list of survey names to use. For an empty list information for all surveys is provided.

basedirstr=None

(Optional) an OpendTect data directory/folder to use, defaults to location set in user’s OpendTect settings

Returns

dict

static infos_dataframe(fornms: list = [], basedir: str = None)

Return basic information for all or a subset of surveys as a Pandas DataFrame.

Parameters

fornmslist[str]=[]

(Optional) a list of survey names to use. For an empty list information for all surveys is provided.

basedirstr=None

(Optional) an OpendTect data directory/folder to use, defaults to location set in user’s OpendTect settings

Returns

Pandas DataFrame

static features(fornms: list = [], basedir: str = None) str

Return a GeoJSON Feature Collection with the outlines and basic information for all or a subset of surveys.

Parameters

fornmslist[str]=[]

(Optional) a list of survey names to use. For an empty list information for all surveys is provided.

basedirstr=None

(Optional) an OpendTect data directory/folder to use, defaults to location set in user’s OpendTect settings

Returns

dict

class odbind.survey._SurveyObject(survey: Survey, name: str)

Bases: object

Base class for OpendTect survey objects - not useful on its own

use_xarray = True
use_dataframe = True
classmethod _initbasebindings(bindnm)
_survey
_handle
property survey: Survey

Return the Survey object that this item is from.

property handle: ctypes.c_void_p

Return the ctypes pointer to the underlying C/C++ object .

property isok: bool

Return the current status of the underlying C/C++ object.

property errmsg: str

Return the current error message string of the underlying C/C++ object.

property zistime: bool
__del__()
feature() dict

Return a GeoJSON feature for the object

classmethod dictlist_to_dataframe(inlist: list[dict])

Convert list of Python dicts to a Pandas DataFrame.

Requires all dicts to have the same keys. The keys of the first dict of the list are used for the DataFrame column names

Parameters

inlistlist[dict]

a list of Python dicts. All dicts must have identical keys.

Returns

Pandas Dataframe

classmethod features(survey: Survey, fornms: list = []) str

Return a GeoJSON Feature Collection for all or a subset of objects in the given survey.

Parameters

surveySurvey

An OpendTect survey object

fornmslist[str]

A list of object names to use, an empty list will give information for all objects.

Returns

dict

info() dict

Return basic information for this object.

Returns

dict

wrapindex(i)
classmethod infos(survey: Survey, fornms: list = [])

Return basic information for all or a subset of objects in the given survey.

Parameters

surveySurvey

An OpendTect survey object

fornmslist[str]

A list of object names to use, an empty list will give information for all objects.

Returns

dict or Pandas Dataframe

classmethod names(survey: Survey) list[str]

Return the names of this object type in the given survey

Parameters

surveySurvey

An OpendTect survey object

Returns

list[str]

classmethod delete(survey: Survey, nms: list[str])

Removes the listed objects from the given survey.

Parameters

surveySurvey

An OpendTect survey object

nmslist[str]

A list of object names to remove.