Package: watex
WATex: machine learning research in water explorationLife is much better with potable waterOverviewWATexis a Python-based library mainly focused on the groundwater exploration (GWE). It brings novel approaches
for reducing numerous losses during the hydro-geophysical exploration projects. It encompasses
the Direct-current (DC) resistivity ( Electrical profiling (ERP) & vertical electrical sounding (VES)),
short-periods electromagnetic (EM), geology and hydrogeology methods. From methodologies based on Machine Learning,it allows to:auto-detect the right position to locate the drilling operations to minimize the rate of unsuccessful drillings
and unsustainable boreholes;predict the water content in the well such as the groundwater flow rate, the level of water inrush, ...recover the EM loss signals in area with huge interferences noises ...etc.DocumentationVisit thelibrary websitefor more resources. You can also quick browse the softwareAPI referenceand flip through theexamples pageto see some of expected results. Furthermore, thestep-by-step guideis elaborated for real-world
engineering problems such as computing DC parameters and predicting the k-parameter...LicenceWATexis underBSD-3-ClauseLicense.InstallationThe system requires preferably Python 3.9+.frompipWATexcan beinstalledfromPyPIplatform distribution as:pipinstallwatexfromcondaTheinstallationfromconda-forgedistribution channel can be achieved with :condainstall-cconda-forgewatexTo get the latest development of the code, it is recommended to install it from source using:gitclonehttps://github.com/WEgeophysics/watex.gitFurthermore, for step-by-step guide about the installation and how to manage the
dependencies, visit ourinstallation guidepage.Some demos1. Drilling location auto-detectionFor this example, we randomly generate 50 stations of synthetic ERP resistivity data withminimumandmaximumresistivity values equal to1e1and1e4ohm.m  respectively as:importwatexaswxdata=wx.make_erp(n_stations=50,max_rho=1e4,min_rho=10.,as_frame=True,seed=42)Naive auto-detection (NAD)The NAD automatically proposes a suitable location with NO restrictions (constraints) observed in the survey site
during the GWE. We may understand bysuitable, a location expecting to give a flow rate greater
than 1m3/hr at least.robj=wx.ResistivityProfiling(auto=True).fit(data)robj.sves_Out[1]:'S025'The suitable drilling location is proposed at stationS25(stored in the attributesves_).Auto-detection with constraints (ADC)The constraints refer to the restrictions observed in the survey area during the DWSC. This is common
in real-world exploration. For instance, a station close to a heritage site should be discarded
since no drilling operations are authorized at that place. When many restrictions
are enumerated in the survey site, they must be listed in a dictionary with a reason and passed to the parameterconstraintsso these stations should be ignored during the automatic detection. Here is an example of constraints
application to our example.restrictions={'S10':'Household waste site, avoid contamination','S27':'Municipality site, no authorization to make a drill','S29':'Heritage site, drilling prohibited','S42':'Anthropic polluted place, avoid contamination within a few years','S46':'Marsh zone, borehole will dry up during the dry season'}robj=wx.ResistivityProfiling(constraints=restrictions,auto=True).fit(data)robj.sves_Out[2]:'S033'Notice, the stationS25is no longer considered as thesuitablelocation and henceforth, proposeS33as the
priority for drilling operations. However, if the station is close to a restricted area, a warning should raise to
inform the user to avoid taking a risk to perform a drilling location at that location.Note that before the drilling operations commence, make sure to carry out the DC-sounding (VES) at that point.WATexcomputes
another parameter calledohmic-area(ohmS)to detect the effectiveness of the existing fracture zone at that point. See more in
the softwaredocumentation.2. EM tensors recovering and analysesFor a basic illustration, we fetch 20 audio-frequency magnetotelluric (AMT) data
stored as EDI objects collected in ahuayuanarea (Hunan province, China) with
multiple interferences noised as:importwatexaswxe=wx.fetch_data('huayuan',samples=20,key='noised')# returns an EM -objetsedi_data=e.data# get the array  of EDI objectsBefore EM data restoration, we can analyse the quality control (QC) of the data and
show the confidence interval that makes us confident about the data at each station.
By default the confidence test uses the errors in the resistivity tensor. Let's getting
started:po=wx.EMProcessing().fit(edi_data)# make a EM processing objectr=po.qc(tol=0.2,return_ratio=True)# consider good data from 80% significance.rOut[9]:0.95We can then visualizate the confidence interval at the 20 AMT stations as:wx.plot_confidence_in(edi_data)Alternatively, we can use theqcfunction (more consistent) to get the valid data and
the interpolated frequencies. For instance, we want to known the number of frequencies dropped
during the control analysis. Just do it:QCo=wx.qc(edi_data,tol=.2,return_qco=True)# returns the quality control objectlen(e.emo.freqs_)# number of frequency in noised dataOut[10]:56len(QCo.freqs_)# number of frequency in valid data after QCOut[11]:53QCo.invalid_freqs_# get the useless frequencies based on tol param so we can drop them into the EM dataOut[12]:array([8.19200e+04,4.85294e+01,5.62500e+00])#  81920.0, 48.53 and 5.625 HzTheplot_confidence_infunction allows to assert whether tensor values can be recovered
for these three frequencies at each station. Note that the threshold for the EM data
to be restored is set to50%. Below this value, data is unrecoverable.
Furthermore, if our QC rater=95%is not to be yet satisfactory in our AMT data, we can
process to the impedance tensorZrestoration as:Z=po.zrestore()# returns 3D tensors (Nfrequency, 2, 2), 2x2 for XX, XY, YX and YY components.Now, let's evaluate the new QC ratio to verify the recovering efficaciousness such as:r,=wx.qc(Z)rOut[13]:1.0Great! As we can see, the tensor is restored at each station with100%ratio and we notice
that the confidence line is above 95% in alongside the 20 investigation sites and
compare to the previous plot (rate =75%). The snippet below can allow to visualize
this improvement with the confidence interval as:wx.plot_confidence_in(Z)Besides, user can flip through the following links for more examples aboutEM tensor restoring,thesknewnessanalysis plots,
thestrikeplot,
thefilteringdata, and else...CitationsIf thesoftwareseemed useful to you in any published work, we will appreciate to cite the paper below:Kouadio, K.L., Liu, J., Liu, R., 2023. watex: machine learning research in water exploration. SoftwareX . 101367(2023).https://doi.org/10.1016/j.softx.2023.101367In most situations whereWATexis cited, a citation toscikit-learnwould also be appropriate.See also somecase historypapers usingWATex.ContributionsDepartment of Geophysics, School of Geosciences & Info-physics,Central South University, China.Hunan Key Laboratory of Nonferrous Resources and Geological Hazards Exploration Changsha, Hunan, ChinaLaboratoire de Geologie Ressources Minerales et Energetiques, UFR des Sciences de la Terre et des Ressources Minières,Université Félix Houphouët-Boigny, Cote d'Ivoire.Developer:L. Kouadio<etanoyau@gmail.com>