python.odpy.dbman
¶
Module Contents¶
Functions¶
|
Gets information on survey database wells |
|
Gets info from database list with obj key or name |
|
Gets object info by name |
|
Gets datbase info on well |
|
Gets database dict with command |
|
Gets value of specified database list key |
|
Gets object ID key from database info |
|
|
|
Gets full file path |
|
Registers a new OpendTect dataset to database |
Attributes¶
- python.odpy.dbman.dbmanexe = od_DBMan¶
- python.odpy.dbman.getDBList(translnm, alltrlsgrps=False, exenm=dbmanexe, args=None)¶
Gets information on survey database wells
- Parameters:
translnm (string): default value=’Well’
alltrlsgrps (bool): if True, returns information on TranslatorGroups for available wells
exenm (string): database executable file
args (dict, optional): Dictionary with the members ‘dtectdata’ and ‘survey’ as single element lists, and/or ‘dtectexec’ (see odpy.common.getODSoftwareDir)
- Returns:
dict: Dictionary containing database survey well information (size, IDs, Names, Formats, Status)
- python.odpy.dbman.getInfoFromDBListByNameOrKey(nm_or_key, dblist)¶
Gets info from database list with obj key or name
- Parameters:
nm_or_key (str): object key or name
dblist (dict): survey database list, check odpy.getDBList for docs
- Returns:
dict: info on database object (Name,ID, Format, Type, TranslatorGroup iff available)
- python.odpy.dbman.getInfoByName(objnm, translnm, exenm=dbmanexe, args=None)¶
Gets object info by name
- Parameters:
objnm (str): database object to get info on
translnm (str):
exenm (str): executable file, defaults to dbmanexe=od_DBMan
args (dict, optional): Dictionary with the members ‘dtectdata’ and ‘survey’ as single element lists, and/or ‘dtectexec’ (see odpy.common.getODSoftwareDir)
- Returns:
dict: information on object, dict keys include; ID, Name, file name, etc
Example: >>> import odpy.dbman as dbman >>> dbman.getInfoByName(objnm=’F02-1’, translnm=’Well’)
- {‘ID’: ‘100050.2’,
‘Name’: ‘F02-1’, ‘Format’: ‘dGB’, ‘TranslatorGroup’: ‘Well’, ‘File_name’: ‘C:UsersOLAWALE IBRAHIMDTECT_DATAF3_Demo_2020WellInfoF02-1.well’, ‘Status’: ‘OK’}
- python.odpy.dbman.getInfoByKey(objkey, exenm=dbmanexe, args=None)¶
Gets datbase info on well
- Parameters:
objkey (str): well ID key
exenm (str): executable file name
args (dict, optional): Dictionary with the members ‘dtectdata’ and ‘survey’ as single element lists, and/or ‘dtectexec’ (see odpy.common.getODSoftwareDir)
- Returns:
dict: file info (ID, Name, Format, File name, etc)
- python.odpy.dbman.getDBDict(cmd, args=None)¶
Gets database dict with command
- Parameters:
cmd (str): command to be executed
args (dict, optional): Dictionary with the members ‘dtectdata’ and ‘survey’ as single element lists, and/or ‘dtectexec’ (see odpy.common.getODSoftwareDir)
- python.odpy.dbman.getByName(dblist, retname, keystr)¶
Gets value of specified database list key
- Parameters:
dblist (dict): survey database list, check odpy.getDBList for docs
retname (str): key to return from dblist
keystr (str): value to return from retname
- Returns:
str: database object value
Example:
>>> import odpy.dbman as dbman >>> dbman.getByName(dblist, 'F03-4', 'IDs') '100050.4'
- python.odpy.dbman.getDBKeyForName(dblist, retname)¶
Gets object ID key from database info
- Parameters:
dblist (dict): survey database list, check odpy.getDBList for docs
retname (str): key to return from dblist
- Returns:
str: ID of database object (well)
- python.odpy.dbman.retFileLoc(bstdout)¶
- python.odpy.dbman.getFileLocation(dbkey, args=None)¶
Gets full file path
- Parameters:
dbkey (str): object database key
args (dict, optional): Dictionary with the members ‘dtectdata’ and ‘survey’ as single element lists, and/or ‘dtectexec’ (see odpy.common.getODSoftwareDir)
- Returns:
str: full path to file
- python.odpy.dbman.getNewEntryFileName(objnm, dirid, trgrp, trl, ext, ftype=None, args=None)¶
Registers a new OpendTect dataset to database
- Parameters:
objnm (str): file name
dirid (internal: int)
trgrp (str): TranslatorGroup e.g. Well, Seismic, etc
ext (str): file extension
- Returns:
file path to the object created with write permission