ERP#

DC-1D Resistivty drilling location Auto-detecting

Notes

This module is one of the earlier module designed for predicting flow rate by computing the electrical parameters. Originaly the idea was to automate everything to ease the task for the users. All things, the users need to do, is to arrange the electrical data according to the arrangement proposed by the library in watex.property.P such as:

*pk

*x

*y

*rho

sloc

shape

type

0

790210

1093010

230

low

10

790214

1093016

93

se

V

CP

20

790218 …

1093026

93

up

140

790255

1093116

138

where headers with * means compulsory data and optional otherwise. x and y are utm easting and northing coordinates respectively, while rho is the apparent resistivity at each measurement point(pk). sloc is the column of anomaly boundaries definition. The optional column names such as sloc, shape and type can be None. Inside the table:

  • low means the lower boundary of the selected anomaly, can also be ‘1’

  • up means the uper boundary of selected anomaly, can be 2

  • se means the sounding location on the survey area. can be ves or 0.

  • V anomaly-shape and can be ‘W’, ‘K’, ‘U’, ‘H’, ‘C’ and ‘M’

  • CP anomaly type and can be ‘CB2P’, ‘NC’ or ‘EC’

The main interesting part of this module is the collection of ERP where the module can rewrite the data and arrange it following the aforementioned disposal (above proposed by the library). If data is given in a separate sheets (from excel files), the parser exports each sheet and rewrite accordingly. The limit of this approach is that the parser only read the excel format.

Warning

Thus, once the data is well organized, the module is able to compute all the parameters and select the best location for drilling after analyzing all the different points in dataset. However, this seems too much perfect (not realistic) and far from the practice since in DC - resistivity, the low resistivity does not mean there is a water at that place thereby leading to a misinsterpretationin the choice of locating of the drilling points. To handle this issue, we recommended to use the module watex.method.electrical instead. To force use ERP module, be sure you are a background of the geology of the area and whether you are not in marshes or a complex geological area which unfortunately is something difficult to know in advance. To well organize the watex API and remediate to the problem of automation, it is recommended to use the watex.methods.electrical.DCProfiling. The latter provides fast and efficient way to compute the electrical parameters with a few margin of errors. The module will be deprecated in the future and should be rewritten. The automation of parameter computation from the erp parser sheets such as shape and type of anomaly will henceforth use the deep neural networks.

class watex.methods.erp.DCMagic(stations=None, dipole=10.0, auto=False, read_sheets=False, force=False, search=45.0, rho0=None, h0=1.0, strategy='HMCMC', vesorder=None, typeofop='mean', objective='coverall', **kws)[source]#

Bases: ElectricalMethods

A super class that deals with ERP and VES objects to generate single DC features for prediction.

DCMagic reads the :term:`VES and ERP data and compute the corresponding features through its summary method. Note the number of ERP profiles and sounding sites must be consistent as well as the coordinates at this points. The best practice to have full control of the computed parameters is to used the watex.methods.DCProfiling and watex.methods.DCSounding to compute the parameters of each line and site with their coordinates and constraints then call the fit methods to read each objects.

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.

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.

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.

fit_params: dict

Additional Electrical Resistivity Profiling keywords arguments

rtable_#

ERP table that contains the different parameters computed at the selected drilling points sves.

Type:

pd.DataFrame

vtable_#

VES table that contains the different parameters computed at the selected drilling points.

Type:

pd.DataFrame

table_#

The complete table that contains VES and term`ERP` data composing the DC-Features.

Type:

pd.DataFrame

Examples

>>> import watex as wx
>>> from watex.methods.erp import DCMagic
>>> erp_data = wx.make_erp ( seed =33 ).frame
>>> ves_data = wx.make_ves (seed =42).frame
>>> v = wx.DCSounding ().fit(wx.make_ves (seed =10, as_frame =True, add_xy =True))
>>> r = wx.DCProfiling().fit( wx.make_erp ( seed =77 , as_frame =True))
>>> res= wx.methods.ResistivityProfiling(station='S4').fit(erp_data)
>>> ves= wx.methods.VerticalSounding(search=60).fit(ves_data)
dc-ves  : 100%|################################| 1/1 [00:00<00:00, 111.13B/s]
dc-erp  : 100%|################################| 1/1 [00:00<00:00, 196.77B/s]
>>> m = DCMagic().fit(erp_data, ves_data, v, r, ves, res )
dc-erp  : 100%|################################| 2/2 [00:00<00:00, 307.40B/s]
dc-o:erp: 100%|################################| 1/1 [00:00<00:00, 499.74B/s]
dc-ves  : 100%|################################| 2/2 [00:00<00:00, 222.16B/s]
dc-o:ves: 100%|################################| 1/1 [00:00<00:00, 997.46B/s]
>>> m.summary(keep_params =True)
    longitude  latitude shape  ...       sfi  sves_resistivity  ohmic_area
0         NaN       NaN     W  ...  1.310417        707.609756  263.213572
1         NaN       NaN     K  ...  1.300024          1.000000  964.034554
2  109.332932  28.41193     U  ...  1.184614          1.000000  276.340744
fit(*data, **fit_params)[source]#

Fit the DC- electrical profiling and sounding objects.

Fit the Electrical Resistivity Profiling and Vertical Electrical Sounding curves and computed the DC-parameters.

Parameters:
  • data (list of path-like object, or DataFrames) – When reading the Vertical Electrical Sounding objects , data should be in ([D|F|P-types]). 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 for Vertical Electrical Sounding, 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) – Does nothing here, just for API purpose.

Returns:

self

Return type:

DCMAgic instanced object for chaining method.

property inspect#

Inspect object whether is fitted or not

summary(*, coerce=False, force=False, return_table=True, keep_params=False, like=Ellipsis)[source]#

Retrieve sites details and aggregate the table to compose unique DC features.

Parameters:
  • coerce (bool, default=True) – If coordinates data of sites are missing in a profile/site, setting coerce to True will use the Electrical Resistivity Profiling coordinates to fit each Vertical Electrical Sounding sites by default or vice-versa. To avoid an unexpected behavior, it is strongly recommended to provide the same sounding point coordinates used for the expecting drilling point passed in attribute sves_ in term:DC profiles.

  • force (bool, default=False) – In principle, number of profiles should be equals to number of sites where the drilling operations is perfomed. Force allows to aggregate the dataframe even this condition is not met, otherwise, an error raises.

  • return_table (bool, default=True,) – Returns DC-features in a pandas dataframe rather than DCMagic object.

  • keep_params (bool, default=False,) – If True , keeps only the predicted parameters in the summary table, otherwise returns all main DC-resistivity details of the site.

  • like (str, Optional) –

    Can be [‘ERP’ | ‘VES’]. When one of DC-methods such as VES or ERP is not supplied, summary method of DCMagic returns an DCError because DCMagic expects each sounding point to have its profiling data with expected drilling point coordinates ( passed in attributes sves_) explicity specified . However to constraint the DCMagic works like DCSounding or DCProfiling in order to return the table of VES or ERP, the parameter like can be turn to ERP or VES.

    Changed in version 0.2.2: Deprecated parameter work_as. like parameter operates simmilary as work_as did.

Returns:

self or table_ – Returns DCMagic object or DataFrame of sites details.

Return type:

DCMagic or DataFrame

Examples

>>> import watex as wx
>>> data = wx.make_erp (seed =42 , n_stations =12, as_frame =True )
>>> ro= wx.DCProfiling ().fit(data)
>>> ro.summary()
       dipole   longitude  latitude  ...  shape  type       sfi
line1      10  110.486111  26.05174  ...      C    EC  1.141844
>>> data_no_xy = wx.make_ves ( seed=0 , as_frame =True)
>>> vo = wx.methods.VerticalSounding (
    xycoords = (110.486111,   26.05174)).fit(data_no_xy).summary()
>>> vo.table_
         AB    MN   arrangememt  ... nareas   longitude  latitude
area                             ...
None  200.0  20.0  schlumberger  ...      1  110.486111  26.05174
>>> dm = wx.methods.DCMagic ().fit(vo, ro )
>>> dm.summary ()
   dipole  longitude  latitude  ...  max_depth  ohmic_area  nareas
0      10  110.48611  26.05174  ...      109.0  690.063003       1
>>> dm.summary (keep_params =True )
   longitude  latitude shape  ...       sfi  sves_resistivity  ohmic_area
0  110.48611  26.05174     C  ...  1.141844               1.0  690.063003
>>> list( dm.table_.columns )
['longitude',
 'latitude',
 'shape',
 'type',
 'magnitude',
 'power',
 'sfi',
 'sves_resistivity',
 'ohmic_area']
watex.methods.erp.ERPCollection(listOferpfn=None, listOfposMinMax=None, erpObjs=None, **kws)[source]#

Collection objects. The class collects all erp survey lines. Each erp is an singleton class object with their corresponding attributes. The goal is to build a container geao-elecricals to straigthforwardly given to watex.bases.features.GeoFeatures class.

Parameters:
  • listOferpfn (list, ndarray) – list of different erp files.

  • listOfposMinMax (list) –

    collection of different selected anomaly boundaries. If not provided, the auto will triggered. It’s recommanded to provided for all erp your convenient anomaly boundaries like:

    listOfposMinMax=[(90, 130), (10, 70), ...]
    

    where (90,130)``is boundaries of selected anomaly on the first `erp` line and ``(10,70) is the boundaries of the second erp survey line and so on.

  • erpObjs (list, ndarray) – Collection of objects from ERP. If objects are alread created. Gather them on a list and pass though the argument erpObjs.

  • arguments. (Holds others optionals infos passed as keyword)

  • =================================== (====================== =============)

  • Description (Attributes Type)

  • ===================================

  • User (list_of_dipole_lengths list Collection of dipoleLength.) – can provide the distance between sites measurements as performed on investigations site. If given, the automaticall dipoleLength computation will be turned off.

  • name. (fnames array_like Array of erp survey lines) – If each survey name is the location name then will keep it.

  • numbers (id array_like Each erp obj reference)

  • geo-electrical (erps_data nd.array Array composed of) – parameters. ndarray(nerp, 8) where num is the number of `erp`obj collected.

  • line (erpdf pd.DataFrame A dataFrame of collected erp) – and the number of lines correspond to the number of collected erp.

  • ===================================

  • of (It's posible to get from each erp collection the singular array)

  • properties:: (different parameters considered as) –

    >>> from watex.methods.erp import ERP_collection as ERPC
    >>> erpcol = ERPC(listOferpfn='list|path|filename')
    >>> erpcol.survey_ids
    >>> erpcol.selectedPoints
    

:param List of the ERP_collection attribute properties: :param ==================== ============== ===================================: :param Properties Type Description: :param ==================== ============== ===================================: :param selectedPoints array_like Collection of Best anomaly: position points. :param survey_ids array_like Collection of all erp survey: survey ids. Note that each ids is

following by the prefix e.

Parameters:
  • standard (sfis array_like Collection of best anomaly) – fracturation index value.

  • power (powers array_like Collection of best anomaly)

  • anomaly (magnitudes array_like Colection of best) – magnitude in ohm.m.

  • shape. (shapes array_like Collection of best anomaly) – For more details please refer to ERP.

  • type. (types array_like Collection of best anomaly) – Refer to ERP for more details.

  • =================================== (==================== ==============)

Examples

>>> from watex.methods.erp import ERPCollection
>>> erpObjs =ERP_collection(listOferpfn= 'data/erp')
>>> erpObjs.erpdf
>>> erpObjs.survey_ids
... ['e2059734331848' 'e2059734099144' 'e2059734345608']