electrical computes some DC parameters from ERP and VES. From these parameters, it provides intelligent methods to propose the right place to locate a drill and predicts the flow rate before any drilling operations.

class watex.methods.electrical.DCProfiling(stations=None, dipole=10.0, auto=False, keep_params=False, read_sheets=False, force=False, **kws)[source]#

Bases: ElectricalMethods

A collection of DC-resistivity profiling classes.

It reads and compute electrical parameters. Each line compose a specific object and gather all the attributes of ResistivityProfiling for easy use. For instance, the expeced drilling location point and its resistivity value for two survey lines ( line1 and line2) can be fetched as:

>>> <object>.line1.sves_ ; <object>.line1.sves_resistivity_
>>> <object>.line2.sves_ ; <object>.line2.sves_resistivity_
Parameters:
  • stations (list or str (path-like object )) –

    list of station name where the drilling is expected to be located. It strongly linked to the name of used to specify the center position of each dipole when the survey data is collected. Each survey can have its own way for numbering the positions, howewer if the station is given it should be one ( presumed to be the suitable point for drilling) in the survey lines. Commonly it is called the sves which mean at this point, the DC-sounding will be operated. Be sure to provide the correct station to compute the electrical parameters.

    It is recommed to provide the positioning of the station expected to hold the drillings. However if stations is None, the auto-way for computing electrical features should be triggered. User can also provide the list of stations by hand. In that case, each station should numbered from 1 not 0. For instance:

    • in a survey line of 20 positions. We considered the station 13

      as the best point to locate the drilling. Therefore the name of the station should be ‘S13’. In other survey line (line2) the second point of my survey is considered the suitable one to locate my drilling. Considering the two survey lines, the list of stations sould be ‘[‘S13’, ‘S2’]

    • stations can also be arrange in a single to be parsed which

      refer to the string arguments.

  • dipole (float) – The dipole length used during the exploration area. If dipole value is set as keyword argument,i.e. the station name is overwritten and is henceforth named according to the value of the dipole. For instance for dipole equals to 10m, the first station should be S00, the second S10 , the third S20 and so on. However, it is recommend to name the station using counting numbers rather than using the dipole position.

  • auto (bool) – Auto dectect the best conductive zone. If True, the station position should be the station of the lower resistivity value in Electrical Resistivity Profiling.

  • keep_params (bool, default=False,) – If True , keeps only the predicted parameters in the summary table, otherwise, returns the usefull details of the line like geographical coordinates where the DC predicted parameters are computed.

  • read_sheets (bool,) – Read the data in sheets. Here its assumes the data of each survey lines are arrange in a single excell worksheets. Note that if read_sheets is set to True and the file is not in excell format, a TypError will raise.

  • force (bool, default=False,) –

    By default, DCProfiling expects users to provide either DC objects or pandas dataframe. This assumes users have already transformed its data from sheets to data frame. If not the case, setting force to True constrains the algorithm to do the both tasks at once.

    New in version 0.2.0.

  • fit_params (dict) – Additional Electrical Resistivity Profiling keywords arguments

Examples

  1. -> Get DC -resistivity profiling from the individual Resistivity object

>>> from watex.methods import ResistivityProfiling
>>> from watex.methods import DCProfiling
>>> robj1= ResistivityProfiling(auto=True) # auto detection
>>> robj1.utm_zone = '50N'
>>> robj1.fit('data/erp/testsafedata.xlsx')
>>> robj1.sves_
... 'S036'
>>> robj2= ResistivityProfiling(auto=True, utm_zone='40S')
>>> robj2.fit('data/erp/l11_gbalo.xlsx')
>>> robj2.sves_
... 'S006'
>>> # read the both objects
>>> dcobjs = DCProfiling()
>>> dcobjs.fit([robj1, robj2])
>>> dcobjs.sves_
... array(['S036', 'S006'], dtype=object)
>>> dcobjs.line1.sves_ # => robj1.sves_
>>> dcobjs.line2.sves_ # => robj2.sves_
  1. -> Read from a collection of excell data

>>> datapath = r'data/erp'
>>> dcobjs.read_sheets=True
>>> dcobjs.fit(datapath)
>>> dcobjs.nlines_  # getting the number of survey lines
... 9
>>> dcobjs.sves_ # stations of the best conductive zone
... array(['S017', 'S006', 'S000', 'S036', 'S036', 'S036', 'S036', 'S036',
       'S001'], dtype='<U33')
>>> dcobjs.sves_resistivities_ # the lower conductive resistivities
... array([  80,   50, 1101,  500,  500,  500,  500,  500,   93], dtype=int64)
>>> dcobjs.powers_
... array([ 50,  60,  30,  60,  60, 180, 180, 180,  40])
>>> dcobjs.sves_ # stations of the best conductive zone
... array(['S017', 'S006', 'S000', 'S036', 'S036', 'S036', 'S036', 'S036',
       'S001'], dtype='<U33')

(3) -> Read data and all sheets, assumes all data are arranged in a sheets >>> dcobjs.read_sheets=True >>> dcobjs.fit(datapath) >>> dcobjs.nlines_ # here it assumes all the data are in single worksheets. … 4 >>> dcobjs.line4.conductive_zone_ # conductive zone of the line 4 … array([1460, 1450, 950, 500, 1300, 1630, 1400], dtype=int64) >>> dcobjs.sfis_ >>> array([1.05085691, 0.07639077, 0.03592814, 0.07639077, 0.07639077,

0.07639077, 0.07639077, 0.07639077, 1.08655919])

>>> dcobjs.line3.sfi_ # => robj1.sfi_
... array([0.03592814]) # for line 3
fit(*data, **fit_params)[source]#

Read and fit the collections of data

Parameters:
  • **data** (List of path-like obj, or ResistivityProfiling) – object. Data containing the collection of DC-resistivity values of of multiple survey areas.

  • **fit_params** (str,) – Additional keyword from :func:watex.utils.coreutils.parseStations`. It refers to the station_delimiter parameters. If the attribute stations is given as a path-like object. If the stations are disposed in the same line, it is convenient to provide the delimiter to parse the stations.

Return type:

object instanciated from ResistivityProfiling.

Notes

The stations should numbered from 1 not 0 and might fit the number of the survey line. Each survey line expect to hold one positionning drilling.

property inspect#

Inspect object whether is fitted or not

summary(return_table=True)[source]#

Agregate the DC-Profiling parameters to compose a param-table

Parameters:

return_table – bool, default=True returns table of DC parameters at all sites if True and ‘DCProfiling’ instanciated object otherwise.

Returns:

  • table if return_table is True and DCProfiling

instanciated object otherwise.

class watex.methods.electrical.DCSounding(search=45.0, rho0=None, h0=1.0, read_sheets=False, strategy='HMCMC', vesorder=None, typeofop='mean', objective='coverall', keep_params=False, **kws)[source]#

Bases: ElectricalMethods

Direct-Current Electrical Sounding

A collection of Vertical Electrical Sounding class and computed predictors paramaters accordingly.

The VES is carried out to speculate about the existence of a fracture zone and the layer thicknesses. Commonly, it comes as supplement methods to Electrical Resistivity Profiling after selecting the best conductive zone when survey is made on one-dimensional. Data from each DC-sounding site can be retrieved using:

>>> <object>.site<number>.<:attr:`~.VerticalSounding.<attr>_`

For instance to fetch the DC-sounding data position and the resistivity in depth of the fractured zone for the first site, we use:

>>> <object>.site1.fractured_zone_
>>> <object>.site1.fractured_zone_resistivity_
Parameters:
search: float , list of float

The collection of the depth in meters from which one expects to find a fracture zone outside of pollutions. Indeed, the search parameter is used to speculate about the expected groundwater in the fractured rocks under the average level of water inrush in a specific area. For instance in Bagoue region , the average depth of water inrush is around 45m.So the search can be specified via the water inrush average value.

rho0: float

Value of the starting resistivity model. If None, rho0 should be the half minumm value of the apparent resistivity collected. Units is in Ω.m not log10(Ω.m)

h0: float

Thickness in meter of the first layers in meters.If None, it should be the minimum thickess as possible 1.m .

strategy: str

Type of inversion scheme. The defaut is Hybrid Monte Carlo (HMC) known as HMCMC. Another scheme is Bayesian neural network approach (BNN).

vesorder: int

The index to retrieve the resistivity data of a specific sounding point. Sometimes the sounding data are composed of the different sounding values collected in the same survey area into different Electrical Resistivity Profiling line. For instance:

AB/2

MN/2

SE1

SE2

SE3

SEn

Where SE are the electrical sounding data values and n is the number of the sounding points selected. SE1, SE2 and SE3 are three points selected for Vertical Electrical Sounding i.e. 3 sounding points carried out either in the same Electrical Resistivity Profiling or somewhere else. These sounding data are the resistivity data with a specific numbers. Commonly the number are randomly chosen. It does not refer to the expected best fracture zone selected after the prior-interpretation. After transformation via the function vesSelector(), the header of the data should hold the resistivity. For instance, refering to the table above, the data should be:

AB

MN

resistivity

resistivity

resistivity

Therefore, the vesorder is used to select the specific resistivity values i.e. select the corresponding sounding number of the Vertical Electrical Sounding expecting to locate the drilling operations or for computation. For esample, `vesorder`=1 should figure out:

AB/2

MN/2

SE2

–>

AB

MN

resistivity

If vesorder is None and the number of sounding curves are more than one, by default the first sounding curve is selected ie rhoaIndex equals to 0

typeofop: str

Type of operation to apply to the resistivity values rhoa of the duplicated spacing points AB. The default operation is mean. Sometimes at the potential electrodes ( MN ),the measurement of AB are collected twice after modifying the distance of MN a bit. At this point, two or many resistivity values are targetted to the same distance AB (AB still remains unchangeable while while MN is changed). So the operation consists whether to the average ( mean ) resistiviy values or to take the median values or to leaveOneOut (i.e. keep one value of resistivity among the different values collected at the same point AB ) at the same spacing AB. Note that for the LeaveOneOut, the selected resistivity value is randomly chosen.

objective: str

Type operation to output. By default, the function outputs the value of pseudo-area in \($ohm.m^2$\). However, for plotting purpose by setting the argument to view, its gives an alternatively outputs of X and Y, recomputed and projected as weel as the X and Y values of the expected fractured zone. Where X is the AB dipole spacing when imaging to the depth and Y is the apparent resistivity computed.

keep_params: bool, default=False,

If True , keeps only the predicted parameters in the summary table, otherwise, returns the usefull details of the site like the depth AB/2 where the DC predicted area parameter is computed.

kws: dict

Additionnal keywords arguments from Vertical Electrical Sounding data operations. See watex.utils.exmath.vesDataOperator() for futher details.

. _Cote d’Ivoire: https://en.wikipedia.org/wiki/Ivory_Coast

fit(*data, **fit_params)[source]#

Fit the DC- electrical sounding

Fit the sounding Vertical Electrical Sounding curves and computed the ohmic-area and set all the features for demarcating fractured zone from the selected anomaly.

Parameters:
  • data (list of path-like object, or DataFrames) – The string argument is a path-like object. It must be a valid file wich encompasses the collected data on the field. It shoud be composed of spacing values AB and the apparent resistivity values rhoa. By convention AB is half-space data i.e AB/2. So, if data is given, params AB and rhoa should be kept to None. If AB and rhoa is expected to be inputted, user must set the data to None values for API purpose. If not an error will raise. Or the recommended way is to use the vesSelector tool in watex.utils.vesSelector() to buid the Vertical Electrical Sounding data before feeding it to the algorithm. See the example below.

  • fit_params (dict) – additional keywords arguments, specific to the readable files. Refer to :method:`watex.property.Config.parsers` . Use the key() to get all the readables format.

Returns:

object

Return type:

A collection of Vertical Electrical Sounding objects

property inspect#

Inspect object whether is fitted or not

summary(return_table=True)[source]#

Agregate the DC-Sounding parameters to compose a param-table

Parameters:

return_table – bool, default=True returns table of DC parameters at all sites if True and ‘DCSounding’ instanciated object otherwise.

Returns:

  • table if return_table is True and DCSounding instanciated

object otherwise.

class watex.methods.electrical.ResistivityProfiling(station=None, dipole=10.0, auto=False, constraints=None, coerce=False, force=False, **kws)[source]#

Bases: ElectricalMethods

Class deals with the Electrical Resistivity Profiling (ERP).

The electrical resistivity profiling is one of the cheap geophysical subsurface imaging method. It is most preferred to find groundwater during the campaigns of drinking water supply, especially in developing countries. Commonly, it is used in combinaision with the the vertical electrical sounding Vertical Electrical Sounding to speculated about the layer thickesses and the existence of the fracture zone.

Parameters:
station: str

Station name where the drilling is expected to be located. The station should numbered from 1 not 0. So if S00` is given, the station name should be set to ``S01. Moreover, if dipole value is set as keyword argument,i.e. the station is named according to the value of the dipole. For instance for dipole equals to 10m, the first station should be S00, the second S10 , the third S20 and so on. However, it is recommend to name the station using counting numbers rather than using the dipole position.

dipole: float

The dipole length used during the exploration area.

auto: bool

Auto dectect the best conductive zone. If True, the station position should be the station of the lower resistivity value in Electrical Resistivity Profiling.

constraints: list or dict,

It determines the restriction observed in the site during the survey area. Any station close to a restriction area must be listed and should be ignored when the best location for drilling operations is automatically detected. A restricted stations can be enumerated as a dictionnary of key='restricted station' and value='reason why the station must be ignored. For instance:

constraints ={'S10': 'Heritage site, no authorization for drilling'
              'S25': 'Close to the household waste'
              "S45": 'Station close to a municipality domain'
              'S50': 'Marsh area'
              ...
              }

Note that, commonly constraints is mostly needed when the automatic detection is triggered. However, it can be coerce with the explicit defined station.

force: bool, default=False,
By default, ResistivityProfiling expects users to provide

either DC objects or pandas dataframe. This supposes users have already

transformed its data from sheets to data frame. If not the case, setting force to True constrains the algorithm to do the both tasks at once.

New in version 0.2.0.

kws: dict

Additional Electrical Resistivity Profiling keywords arguments

. _Cote d’Ivoire: https://en.wikipedia.org/wiki/Ivory_Coast

fit(data, **fit_params)[source]#

Fitting the ResistivityProfiling and populate the class attributes.

Parameters:
  • **data** (Path-like obj, Array, Series, Dataframe.) – Data containing the the collected resistivity values in survey area.

  • **columns** (list,) – Only necessary if the data is given as an array. No need to to explicitly define it when data is a dataframe or a Pathlike object.

  • **fit_params** (dict,) – Additional keyword arguments; e.g. to force the station to match at least the best minimal resistivity value in the whole data collected in the survey area.

Returns:

self

Return type:

object instanciated for chaining methods.

Notes

The station should numbered from 1 not 0. So if S00`  is given, the station name should be set to ``S01. Moreover, if dipole value is set as keyword argument, i.e. the station is named according to the value of the dipole. For instance for dipole equals to 10m, the first station should be S00, the second S10, the third S20 and so on. However, it is recommend to name the station using counting numbers rather than using the dipole position.

property inspect#

Inspect object whether is fitted or not

plotAnomaly(**plot_kws)[source]#

Plot the best conductive zone found in the Electrical Resistivity Profiling

Parameters:

plot_kws – dict, additional keyword arguments passed to plotAnomaly().

summary(keep_params=False, return_table=False)[source]#

Summarize the most import parameters for prediction purpose.

Parameters:
  • keep_params (bool, default=False,) – If keep_params is set to True. Method should output only the main important params for prediction purpose. Otherwise, returns all main DC-resistivity attributes

  • return_tables (bool, default=False,) – Returns attributes of parameters in a pandas dataframe.

Returns:

self or table_ – Returns DC- profiling object or dataframe.

Return type:

ResistivityProfiling or class:pd.DataFrame

class watex.methods.electrical.VerticalSounding(search=45.0, rho0=None, h0=1.0, strategy='HMCMC', vesorder=None, typeofop='mean', objective='coverall', xycoords=None, **kws)[source]#

Bases: ElectricalMethods

Vertical Electrical Sounding (VES) class; inherits of ElectricalMethods base class.

The VES is carried out to speculate about the existence of a fracture zone and the layer thicknesses. Commonly, it comes as supplement methods to Electrical Resistivity Profiling after selecting the best conductive zone when survey is made on one-dimensional.

Parameters:
**search: float**

The depth in meters from which one expects to find a fracture zone outside of pollutions. Indeed, the search parameter is used to speculate about the expected groundwater in the fractured rocks under the average level of water inrush in a specific area. For instance in Bagoue region , the average depth of water inrush is around 45m.So the search can be specified via the water inrush average value.

**rho0: float**

Value of the starting resistivity model. If None, rho0 should be the half minumm value of the apparent resistivity collected. Units is in Ω.m not log10(Ω.m)

**h0: float**

Thickness in meter of the first layers in meters.If None, it should be the minimum thickess as possible 1.m .

**strategy: str**

Type of inversion scheme. The defaut is Hybrid Monte Carlo (HMC) known as HMCMC. Another scheme is Bayesian neural network approach (BNN).

**vesorder: int**

The index to retrieve the resistivity data of a specific sounding point. Sometimes the sounding data are composed of the different sounding values collected in the same survey area into different Electrical Resistivity Profiling line. For instance:

AB/2

MN/2

SE1

SE2

SE3

SEn

Where SE are the electrical sounding data values and n is the number of the sounding points selected. SE1, SE2 and SE3 are three points selected for Vertical Electrical Sounding i.e. 3 sounding points carried out either in the same Electrical Resistivity Profiling or somewhere else. These sounding data are the resistivity data with a specific numbers. Commonly the number are randomly chosen. It does not refer to the expected best fracture zone selected after the prior-interpretation. After transformation via the function vesSelector(), the header of the data should hold the resistivity. For instance, refering to the table above, the data should be:

AB

MN

resistivity

resistivity

resistivity

Therefore, the vesorder is used to select the specific resistivity values i.e. select the corresponding sounding number of the Vertical Electrical Sounding expecting to locate the drilling operations or for computation. For esample, `vesorder`=1 should figure out:

AB/2

MN/2

SE2

–>

AB

MN

resistivity

If vesorder is None and the number of sounding curves are more than one, by default the first sounding curve is selected ie rhoaIndex equals to 0

**typeofop: str**

Type of operation to apply to the resistivity values rhoa of the duplicated spacing points AB. The default operation is mean. Sometimes at the potential electrodes ( MN ),the measurement of AB are collected twice after modifying the distance of MN a bit. At this point, two or many resistivity values are targetted to the same distance AB (AB still remains unchangeable while while MN is changed). So the operation consists whether to the average ( mean ) resistiviy values or to take the median values or to leaveOneOut (i.e. keep one value of resistivity among the different values collected at the same point AB ) at the same spacing AB. Note that for the LeaveOneOut, the selected resistivity value is randomly chosen.

**objective: str**

Type operation to output. By default, the function outputs the value of pseudo-area in \($ohm.m^2$\). However, for plotting purpose by setting the argument to view, its gives an alternatively outputs of X and Y, recomputed and projected as weel as the X and Y values of the expected fractured zone. Where X is the AB dipole spacing when imaging to the depth and Y is the apparent resistivity computed.

**kws: dict**

Additionnal keywords arguments from Vertical Electrical Sounding data operations. See watex.utils.exmath.vesDataOperator() for futher details.

. _Cote d’Ivoire: https://en.wikipedia.org/wiki/Ivory_Coast

fit(data, **fit_params)[source]#

Fit the sounding Vertical Electrical Sounding curves and computed the ohmic-area and set all the features for demarcating fractured zone from the selected anomaly.

Parameters:
  • data (Path-like object, DataFrame) – The string argument is a path-like object. It must be a valid file wich encompasses the collected data on the field. It shoud be composed of spacing values AB and the apparent resistivity values rhoa. By convention AB is half-space data i.e AB/2. So, if data is given, params AB and rhoa should be kept to None. If AB and rhoa is expected to be inputted, user must set the data to None values for API purpose. If not an error will raise. Or the recommended way is to use the vesSelector tool in watex.utils.vesSelector() to buid the Vertical Electrical Sounding data before feeding it to the algorithm. See the example below.

  • AB (array-like) – The spacing of the current electrodes when exploring in deeper. Units are in meters. Note that the AB is by convention equals to AB/2. It’s taken as half-space of the investigation depth.

  • MN (array-like) – Potential electrodes distances at each investigation depth. Note by convention the values are half-space and equals to MN/2.

  • rhoa (array-like) – Apparent resistivity values collected in imaging in depth. Units are in Ω.m not log10(Ω.m)

  • fit_params (dict) – additional keywords arguments, specific to the readable files. Refer to :method:`watex.property.Config.parsers` . Use the key() to get all the readables format.

Returns:

object

Return type:

a DC -resistivity Vertical Electrical Sounding object.

property inspect#

Inspect object whether is fitted or not

invert(data, strategy=None, **kwd)[source]#

Invert1D the Vertical Electrical Sounding data collected in the exporation area.

Parameters:
  • data (Dataframe pandas) – contains the depth measurement AB from current electrodes, the potentials electrodes MN and the collected apparent resistivities.

  • rho0 (float -) – Value of the starting resistivity model. If None, rho0 should be the half minumm value of the apparent resistivity collected. Units is in Ω.m not log10(Ω.m)

  • h0 (float - Thickness in meter of the first layers in meters.) – If None, it should be the minimum thickess as possible ``1.``m.

  • strategy (str - Type of inversion scheme. The defaut is Hybrid Monte) – Carlo (HMC) known as HMCMC. Another scheme is Bayesian neural network approach (BNN).

  • kwd (dict - Additionnal keywords arguments from Vertical Electrical Sounding data) – operations. See watex.utils.exmath.vesDataOperator for futherdetails.

  • replace (.. VES) –

plotOhmicArea(fbtw=False, **plot_kws)[source]#

Plot the ohmic-area from selected fractured zone.

Parameters:
  • fbtw – bool, default=False, If True, filled the computed fractured zone.

  • plot_kws – dict, Additional keywords arguments passed to plotOhmicArea().

summary(keep_params=False, return_table=False)[source]#

Summarize the most import features for prediction purpose.

Parameters:
  • keep_params (bool, default=False,) – If keep_params is set to True. Method should output only the main important params for prediction purpose. Otherwise, returns all main DC-resistivity attributes

  • return_tables (bool, default=False,) – if True, returns only the summarized table

Returns:

self or table_ – Returns DC- Sounding object or dataframe.

Return type:

VerticalSounding or class:pd.DataFrame