Core geology#

The core module deals with geological data, the structural infos and borehole data.

class watex.geology.core.GeoBase(verbose=0, **kwargs)[source]#

Bases: object

Base class of container of geological informations for stratigraphy model log creation of exploration area.

Each station is condidered as an attribute and framed by two closest points from the station offsets. The class deals with the true resistivity values collected on exploration area from drilling or geolgical companies. Indeed, the input true resistivity values into the occam2d inversion data could yield an accuracy underground map. The challenge to build a pseudolog framed between two stations allow to know the layers disposal or supperposition from to top to the investigation depth. The aim is to emphasize a large conductive zone usefful in of groundwater exploration. The class Geodrill deals at this time with Occam 2D inversion files or Bo Yang model (x,y,z) files. We intend to extend later with other external softwares like the Modular System EM (MODEM) and else. It’s also possible to generate output straighforwardly for others external softwares like Golder sofwares(‘surfer’)or Oasis Montaj:

Note

If the user has a golder software installed on its computer, it ‘s possible to use the output files generated here to yield a 2D map so to compare both maps to see the difference between model map (

only inversion files and detail-sequences map after including the input true resistivity values and layer names)

Futhermore, the “pseudosequences model” could match and describe better the layers disposal (thcikness and contact) in underground than the raw model map which seems to be close to the reality when step descent parameter is not too small at all.

static findGeostructures(res, /, db_properties=['electrical_props', '__description'])[source]#

Find the layer from database and keep the ceiled value of _res calculated resistivities

static find_properties(data=None, *, constraint=Ellipsis, keep_acronyms=Ellipsis, fill_value=None, kind='geology', attribute='code', property='description')[source]#

Find rock/structural properties or constraint the geological info to fit the rock in AGSO database.

Parameters:
  • data (Arraylike one-dimensional or pd.Series, optional) – Arraylike containing the geological or structural informations.

  • constraint (bool, default=False) – fit the geological or structual info to match the AGSO geology or structural database infos.

  • keep_acronym (bool, default=False,) – Use the acronym of the structural and geological database info to replace the full geological/structural name.

  • fill_value (str, optional) –

    If None, the undetermined structured are not replaced. They are

    kept in the data. However, if the fill_value is provided, the missing structure from data is replaced by the fill_value.

    kind: str, default=’geology’

    Is the type of geo-data to fetch in the database. It can be [‘geology’|’samples’|’structural’]. Any other values except the ‘geology’ will returns the structural samples.

  • attribute (str, default='code') – The name of attribute to collect as the keys. It can be - ‘code’, ‘label’, ‘description’, ‘pattern’ or - ‘pat_size’, ‘pat_density’, ‘pat_thickness’, ‘color’

  • property (str, default='description') – The name of property to collect as the values. By default is the geological or structural mames.

Returns:

  • - attributes/property (tuple (str )) – A key, value in pair of the attribute and property fetched in the AGSO database.

  • - data constrainted. Pd.series or array – Data with items fitted with the property names in the AGSO database.

Examples

>>> from watex.geology.core import GeoBase
>>> GeoBase.find_properties () [:7]
Out[7]:
(('AGLT', 'argillite'),
 ('ALUV', 'alluvium'),
 ('AMP', 'amphibolite'),
 ('ANS', 'anorthosite'),
 ('ANT', 'andesite'),
 ('APL', 'aplite'),
 ('ARKS', 'arkose'))
>>> # make data
>>> geodata =['gran', 'basalt', 'migmatite', 'sand', 'tuff']
>>> GeoBase.find_properties (geodata, constraint =True )
Out[8]:
array(['granodior', 'basalt', 'migmatite', 'sandstone', 'tuff'],
      dtype='<U9')
>>> geodata +=['Unknow structure']
>>> GeoBase.find_properties (geodata, constraint =True,
                                fill_value='NA' )
Out[9]:
array(['granodiorite', 'basalt', 'migmatite', 'sandstone', 'tuff', 'NA'],
      dtype='<U16')
>>> GeoBase.find_properties (geodata, constraint =True,
                                fill_value='NA' , keep_acronyms=True )
Out[10]: array(['grd', 'blt', 'mig', 'sdst', 'tuf', 'NA'], dtype='<U16')
static getProperties(properties=['electrical_props', '__description'], sproperty='electrical_props')[source]#

Connect database and retrieve the ‘Eprops’columns and ‘LayerNames’

Parameters:

properties – DataBase columns.

:param spropertyproperty to sanitize. Mainly used for the properties

in database composed of double parenthesis. Property value should be removed and converted to tuple of float values.

Returns:

  • _gammaVal: the properties values put on list.

    The order of the retrieved values is function of the properties disposal.

watex.geology.core.get_agso_properties(config_file=None, orient='series')[source]#

Get the geostructures files from <’watex/etc/’> and set the properties according to the desire type. When orient is series it will return a dictionnary with key equal to properties name and values are the properties items.

Parameters:
  • config_file – Path_Like or str Can be any property file provided that its obey the disposal of property files found in AGSO_PROPERTIES.

  • orient – string value, (‘dict’, ‘list’, ‘series’, ‘split’, ‘records’, ‘’index’) Defines which dtype to convert Columns(series into).For example, ‘list’ would return a dictionary of lists with Key=Column name and Value=List (Converted series). For furthers details, please refer to https://www.geeksforgeeks.org/python-pandas-dataframe-to_dict/

Example:
>>> import watex.geology.core import get_agso_properties
>>> data=get_agso_properties('watex/etc/AGSO_STCODES.csv')
>>> code_descr={key:value for key , value in zip (data["CODE"],
                data['__DESCRIPTION'])}
watex.geology.core.mapping_stratum(download_files=True)[source]#

Map the rocks properties from _geocodes files and fit each rock to its properties.

Parameters:

download_files – bool Fetching data from repository if the geostrutures files are missing.

Returns:

Rocks and structures data in two diferent dictionnaries

watex.geology.core.set_agso_properties(download_files=True)[source]#

Set the rocks and their properties from inner files located in < ‘watex/etc/’> folder.