em module is related for a few meter exploration in
the case of groundwater exploration. Module provides some basics processing
steps for EMAP data filtering and remove noises.
- class watex.methods.em.EM(survey_name=None, verbose=0)[source]#
Bases:
IsEdiCreate EM object as a collection of EDI-file.
Collect edifiles and create an EM object. It sets the properties from audio-magnetotelluric. The two(2) components XY and YX will be set and calculated.Can read MT data instead, however the full handling transfer function like Tipper and Spectra is not completed. Use other MT softwares for a long periods data.
- Parameters:
survey_name (str) – location name where the date where collected . If surveyname is None can chech on edifiles.
- ediObjs_#
array of the collection of edifiles read_sucessfully
- Type:
Array-like of shape (N,)
- data_#
array of all edifiles feed in the EM modules whatever sucessuffuly read or not.
- Type:
Array-like of shape (N, )
- edinames_#
array of all edi-names sucessfully read
- Type:
array-like of shape (N,)
- edifiles_#
array of all edifiles if given.
- Type:
array of shape (N, )
- freqs_#
Array of the frequency range from EDIs
- Type:
array-like of shape (N, )
- refreq_#
Reference refrequency for data correction. Note the reference frequency is the highest frequency with clean data.
- Type:
float,
- Properties#
- ------------
- longitude#
longitude coordinate values collected from EDIs
- Type:
array-like, shape (N,)
- latitude#
Latitude coordinate values collected from EDIs
- Type:
array-like, shape (N, )
- elevation#
Elevation coordinates collected from EDIs
- Type:
array-like, shape (N,)
- property elevation#
- exportedis(ediObj, new_Z, savepath=None, **kws)[source]#
Export new EDI files from the former object with a given new impedance tensors.
The export is assumed a new output EDI resulting from multiples corrections applications.
- Parameters:
ediObj (str or
watex.edi.Edi) – Full path to Edi file/object or object from `pycsamt`_ or `MTpy`_new_Z (ndarray (nfreq, 2, 2)) – Ndarray of impendance tensors Z. The tensor Z is 3D array composed of number of frequency nfreq`and four components (``xx`,
xy,yx, andyy) in 2X2 matrices. The tensor Z is a complex number.
- Return type:
ediObj from pycsamt.core.edi.Edi
- fit(data)[source]#
Assert and make EM object from a collection EDIs.
- Parameters:
data (str, or list or
pycsamt.core.edi.Ediobject) – Full path to EDI files or collection of EDI-objects- Returns:
self
- Return type:
EM object from a collection EDIs
Examples
>>> from watex.methods.em import EM >>> emObjs = EM().fit (r'data/edis') >>> emObjs.ediObjs_ ...
- getfullfrequency(to_log10=False)[source]#
Get the frequency with clean data.
The full or plain frequency is array frequency with no missing data during the data collection. Note that when using Natural Source Audio-Magnetotellurics, some data are missing due to the weak of missing frequency at certain band especially in the attenuation band.
- Parameters:
to_log10 (bool, default=False,) – export frequency to base 10 logarithm
- Returns:
f – frequency with clean data. Out of attenuation band if survey is completed with Natural Source Audio-Magnetotellurics.
- Return type:
Arraylike 1d of shape(N, )
See also
watex.utils.exmath.get_full_frequencyGet the complete frequency with no missing signals.
Example
>>> import watex as wx >>> edi_sample = wx.fetch_data ('edis', return_data=True, samples = 12 ) >>> wx.EM().fit(edi_sample).getfullfrequency(to_log10 =True ) array([4.76937733, 4.71707639, 4.66477553, 4.61247466, 4.56017382, 4.50787287, 4.45557204, 4.40327104, 4.35097021, 4.29866928, 4.24636832, 4.19406761, 4.14176668, 4.08946565, 4.03716465, ... 2.67734228, 2.62504479, 2.57274385, 2.52044423, 2.46814047, 2.41584107, 2.36353677, 2.31124512, 2.25892448, 2.20663701, 2.15433266, 2.10202186, 2.04972182, 1.99743007])
- getreferencefrequency(to_log10=False)[source]#
Get the reference frequency from collection Edis objects.
The highest frequency with clean data should be selected as the reference frequency
- Parameters:
data (list of pycsamt.core.edi.Edi or mtpy.core.edi.Edi objects) – Collections of EDI-objects from `pycsamt`_
to_log10 (bool,) – outputs the reference frequency into base 10 logarithm in Hz.
- Returns:
rf – the reference frequency at the clean data in Hz
- Return type:
float
Examples
>>> from watex.methods.em import EM >>> edipath ='data/3edis' >>> ref = EM().getreferencefrequency(edipath, to_log10=True) >>> ref ... 4.845098040014257 # in Hz
References
- property inspect#
Inspect object whether is fitted or not
- is_valid(obj)[source]#
Assert that the given argument is an EDI -object from modules EDI or EDI from pycsamt and MTpy packages. A TypeError will occurs otherwise.
- Parameters:
obj (str,
pycsamt.core.edi.Ediormtpy.core.edi.Edi) – Full path EDI file or `pycsamt`_ or `MTpy`_ objects.- Returns:
obj – Identical object after asserting.
- Return type:
str,
pycsamt.core.edi.Ediormtpy.core.edi.Edi
- property latitude#
- property longitude#
- make2d(out='resxy', *, kind='complex', **kws)[source]#
Out 2D resistivity, phase-error and tensor matrix from a collection of EDI-objects.
Matrix depends of the number of frequency times number of sites. The function asserts whether all data from all frequencies are available. The missing values should be filled by NaN.
- Parameters:
data (Path-like object or list of pycsamt.core.edi objects) – Collections of EDI-objects from `pycsamt`_ or full path to EDI files.
out (str) – kind of data to output. Be sure to provide the component to retrieve the attribute from the collection object. Except the error and frequency attribute, the missing component to the attribute will raise an error. for instance
resxyfor xy component. Default isresxy.kind (bool or str) – focuses on the tensor output. Note that the tensor is a complex number of ndarray (nfreq, 2,2 ). If set to``modulus`, the modulus of the complex tensor should be outputted. If
realor``imag``, it returns only the specific one. Default iscomplex.kws (dict) – Additional keywords arguments from :func:`~.getfullfrequency `.
- Returns:
mat2d – the matrix of number of frequency and number of Edi-collectes which correspond to the number of the stations/sites.
- Return type:
np.ndarray(nfreq, nstations)
Examples
>>> from watex.methods.em import EM >>> edipath ='data/edis' >>> emObjs= EM().fit(edipath) >>> phyx = EM().make2d ('phaseyx') >>> phyx ... array([[ 26.42546593, 32.71066454, 30.9222746 ], [ 44.25990541, 40.77911136, 41.0339148 ], ... [ 37.66594686, 33.03375863, 35.75420802], [ nan, nan, 44.04498791]]) >>> phyx.shape ... (55, 3) >>> # get the real number of the yy componet of tensor z >>> zyy_r = make2d (ediObjs, 'zyx', kind ='real') ... array([[ 4165.6 , 8665.64 , 5285.47 ], [ 7072.81 , 11663.1 , 6900.33 ], ... [ 90.7099, 119.505 , 122.343 ], [ nan, nan, 88.0624]]) >>> # get the resistivity error of component 'xy' >>> resxy_err = EM.make2d ('resxy_err') >>> resxy_err ... array([[0.01329037, 0.02942557, 0.0176034 ], [0.0335909 , 0.05238863, 0.03111475], ... [3.33359942, 4.14684926, 4.38562271], [ nan, nan, 4.35605603]]) >>> phyx.shape ,zyy_r.shape, resxy_err.shape ... ((55, 3), (55, 3), (55, 3))
- rewrite(*, by='name', prefix=None, dataid=None, savepath=None, how='py', correct_ll=True, make_coords=False, reflong=None, reflat=None, step='1km', edi_prefix=None, export=True, **kws)[source]#
Rewrite Edis, correct station coordinates and dipole length.
Can rename the dataid, customize sites and correct the positioning latitudes and longitudes.
- Parameters:
dataid (list) – list of ids to rename the existing EDI-dataid from
Head.dataid. If given, it should match the length of the collections of ediObjs. A ValueError will occurs if the length of ids provided is out of the range of the number of EDis objectsby (str) – Rename according to the inner module Id. Can be
name,id,number. Default isname. Ifsurvey_nameis given, the whole survey name should be overwritten. Conversly, the argumentixoutputs the number of formating stations excluding the survey name.prefix (str) – Prefix the number of the site. It could be the abbreviation of the survey area.
correct_ll (bool,) – Write the scaled positions( longitude and latitude). Default is
True.make_coords (bool) – Useful to hide the real coordinates of the sites by generating a ‘fake’ coordinates for a specific purposes. When setting to
Truebe sure to provide the reflong and reflat values otherwise and error will occurs.reflong (float or string) – Reference longitude in degree decimal or in DD:MM:SS for the site considered as the origin of the lamdmark.
reflat (float or string) – Reference latitude in degree decimal or in DD:MM:SS for the reference site considered as the landmark origin.
step (float or str) – Offset or the distance of seperation between different sites in meters. If the value is given as string type, except the
km, it should be considered as amvalue. Only meters and kilometers are accepables. Default value of seperation between the site is1km.savepath (str) – Full path of the save directory. If not given, EDIs should be outputed in the created directory.
how (str) – The way to index the stations. Default is the Python indexing i.e. the counting starts by 0. Any other value will start counting the site from 1.
export (bool,) – Export new edi-files
kws (dict) – Additionnal keyword arguments from ~Edi.write_edifile and
watex.utils.coreutils.makeCoords().
- Returns:
EM – Returns
selffor easy method chaining.- Return type:
EMinstance
Examples
>>> from watex.methods.em import EM >>> edipath = r'data/edis' >>> savepath = r'/Users/Daniel/Desktop/ediout' >>> emObjs = EM().fit(edipath) >>> emObjs.rewrite_edis(by='id', edi_prefix ='b1', savepath =savepath) >>> # >>> # second example to write 7 samples of edi from >>> # Edi objects inner datasets >>> # >>> import watex as wx >>> edi_sample = wx.fetch_data ('edis', key ='edi', samples =7, return_data =True ) >>> emobj = wx.EM ().fit(edi_sample) >>> emobj.rewrite(by='station', prefix='PS')
- property stnames#
- class watex.methods.em.Processing(window_size=5, component='xy', mode='same', method='slinear', out='srho', c=2, **kws)[source]#
Bases:
EMBase processing of EM object
Fast process EMAP and AMT data. Tools are used for data sanitizing, removing noises and filtering.
- Parameters:
data (Path-like object or list of pycsamt.core.edi.Edi objects) – Collections of EDI-objects from `pycsamt`_
freqs (array-like, shape (N)) – Frequency array. It should be the complete frequency used during the survey area. It can be get using the :func:`getfullfrequency ` No need if ediObjs is provided.
window_size (int) – the length of the window. Must be greater than 1 and preferably an odd integer number. Default is
5component (str) – field tensors direction. It can be
xx,xy,``yx``,yy. If arr2d` is provided, no need to give an argument. It become useful when a collection of EDI-objects is provided. If don’t specify, the resistivity and phase value at component xy should be fetched for correction by default. Change the component value to get the appropriate data for correction. Default isxy.mode (str) – mode of the border trimming. Should be ‘valid’ or ‘same’.’valid’ is used for regular trimimg whereas the ‘same’ is used for appending the first and last value of resistivity. Any other argument except ‘valid’ should be considered as ‘same’ argument. Default is
same.method (str, default
slinear) – Interpolation technique to use. Can benearest``or ``pad. Refer to the documentation of ~.interpolate2d.out (str) – Value to export. Can be
sfactor,tensorfor corrections factor and impedance tensor. Any other values will export the static corrected resistivity.c (int,) – A window-width expansion factor that must be input to the filter adaptation process to control the roll-off characteristics of the applied Hanning window. It is recommended to select c between
1and4. Default is2.
Examples
>>> import matplotlib.pyplot as plt >>> from watex.methods.em import Processing >>> edipath = 'data/edis' >>> p = Processing().fit(edipath) >>> p.window_size =2 >>> p.component ='yx' >>> rc= p.tma() >>> # get the resistivy value of the third frequency at all stations >>> p.res2d_[3, :] ... array([ 447.05423001, 1016.54352954, 1415.90992189, 536.54293994, 1307.84456036, 65.44806698, 86.66817791, 241.76592273, ... 248.29077039, 247.71452712, 17.03888414]) >>> # get the resistivity value corrected at the third frequency >>> rc [3, :] ... array([ 447.05423001, 763.92416768, 929.33837349, 881.49992091, 404.93382163, 190.58264151, 160.71917654, 163.30034875, 394.2727092 , 679.71542811, 953.2796567 , 1212.42883944, ... 164.58282866, 96.60082159, 17.03888414]) >>> plt.semilogy (np.arange (p.res2d_.shape[1] ), p.res2d_[3, :], '--', np.arange (p.res2d_.shape[1] ), rc[3, :], 'ok--')
References
- ama()[source]#
Use an adaptive-moving-average filter to estimate average apparent resistivities at a single static-correction-reference frequency..
The AMA filter estimates static-corrected apparent resistivities at a single reference frequency by calculating a profile of average impedances along the length of the line. Sounding curves are then shifted so that they intersect the averaged profile.
- Parameters:
data (path-like object or list of pycsamt.core.edi.Edi) – Collections of EDI-objects from `pycsamt`_
- Returns:
rc or z – EMAP apparent resistivity static shift corrected or static correction tensor
- Return type:
np.ndarray, shape (N, M)
References
[2]Torres-Verdin and Bostick, 1992, Principles of spatial surface electric field filtering in magnetotellurics: electromagnetic array profiling (EMAP), Geophysics, v57, p603-622.https://doi.org/10.1190/1.2400625
- static controlFrequencyBuffer(freq, buffer=None)[source]#
Assert buffer and find the nearest value if the value of the buffer is not in frequency ranges .
- Parameters:
freq – array-like of frequencies
buffer – list of maximum and minimum frequency. It should contains only two values. If None, the max and min frequencies are selected
- Returns:
Buffer frequency range
- Example:
>>> import numpy as np >>> from watex.methods.em import Processing >>> freq_ = np.linspace(7e7, 1e0, 20) # 20 frequencies as reference >>> buffer = Processing.controlFrequencyBuffer(freq_, buffer =[5.70e7, 2e1]) >>> freq_ ... array([7.00000000e+07, 6.63157895e+07, 6.26315791e+07, 5.89473686e+07, 5.52631581e+07, 5.15789476e+07, 4.78947372e+07, 4.42105267e+07, 4.05263162e+07, 3.68421057e+07, 3.31578953e+07, 2.94736848e+07, 2.57894743e+07, 2.21052638e+07, 1.84210534e+07, 1.47368429e+07, 1.10526324e+07, 7.36842195e+06, 3.68421147e+06, 1.00000000e+00]) >>> buffer ... array([5.52631581e+07, 1.00000000e+00])
- flma()[source]#
A fixed-length-moving-average filter to estimate average apparent resistivities at a single static-correction-reference frequency.
The FLMA filter estimates static-corrected apparent resistivities at a single reference frequency by calculating a profile of average impedances along the length of the line. Sounding curves are then shifted so that they intersect the averaged profile.
- Parameters:
data (path-like object or list of pycsamt.core.edi.Edi) – Collections of EDI-objects from `pycsamt`_
- Returns:
rc or z – EMAP apparent resistivity static shift corrected or static correction impedance tensor.
- Return type:
np.ndarray, shape (N, M)
References
- static freqInterpolation(y, /, buffer=None, kind='freq')[source]#
Interpolate frequency in frequeny buffer range.
- Parameters:
y – array-like, shape(N, ) - Can be a frequency array or periods note that the frequency is not in log10 Hz.
buffer – list of maximum and minimum frequency. It should contains only two values. If None, the max and min frequencies are used
kind – str type of given data. Can be ‘period’ if the value is given as periods or ‘frequency’ otherwise. Any other value should be considered as a frequency values.
- Returns:
array_like, shape (N2, ) New interpolated frequency with N2 size
- Example:
>>> from watex.methods.em import Processing >>> pobj = Processing().fit('data/edis') >>> f = getfullfrequency (pobj.ediObjs_) >>> buffer = [5.86000e+04, 1.6300e+01] >>> f ... array([7.00000e+04, 5.88000e+04, 4.95000e+04, 4.16000e+04, 3.50000e+04, 2.94000e+04, 2.47000e+04, 2.08000e+04, 1.75000e+04, 1.47000e+04, ... 2.75000e+01, 2.25000e+01, 1.87500e+01, 1.62500e+01, 1.37500e+01, 1.12500e+01, 9.37500e+00, 8.12500e+00, 6.87500e+00, 5.62500e+00]) >>> new_f = freqInterpolation(f, buffer = buffer) >>> new_f ... array([5.88000000e+04, 4.93928459e+04, 4.14907012e+04, 3.48527859e+04, 2.92768416e+04, 2.45929681e+04, 2.06584471e+04, 1.73533927e+04, ... 2.74153120e+01, 2.30292565e+01, 1.93449068e+01, 1.62500000e+01])
- getValidTensors(tol=0.5, **kws)[source]#
Select valid tensors from tolerance threshold and write EDI if applicable.
Function analyzes the data and keep the good ones. The goodness of the data depends on the threshold rate. For instance 50% means to consider an impedance tensor ‘z’ valid if the quality control shows at least that score at each frequency of all stations.
- Parameters:
data (Path-like object or list of
pycsamt.core.edi.Edi) – collections of EDI-objects from `pycsamt`_ . data params is passed tofit()method.tol (float,) – tolerance parameter. The value indicates the rate from which the data can be consider as a valid. The valid data selection should be soft when the tolerance parameter is close to ‘1’ and hard otherwise. As the tol value decreases, the selection becomes severe. Default is
.5means 50 %kws (dict ,) – Additional keywords arguments for EDI file exporting
- Returns:
Zc
- Return type:
watex.externals.z.Zimpedance tensor objects.
Examples
>>> from watex.methods.em import Processing >>> pObj = Processing ().fit('data/edis') >>> f= pObj.freqs_ >>> len(f) ... 55 >>> zObjs_hard = pObj.getValidTensors (tol= 0.3 ) # None doesn't export EDI-file >>> len(zObjs_hard[0]._freq) # suppress 3 tensor data ... 52 >>> zObjs_soft = pObj.getValidTensors(p.ediObjs_, tol = 0.6 , option ='write') >>> len(zObjs_soft[0]._freq) # suppress only two ... 53
- qc(tol=0.5, *, return_freq=False, return_ratio=False, to_log10=True)[source]#
Check the quality control of the collected EDIs.
Analyse the data in the EDI collection and return the quality control value. It indicates how percentage are the data to be representative.
- Parameters:
tol – float, the tolerance parameter. The value indicates the rate from which the data can be consider as meaningful. Preferably it should be less than 1 and greater than 0. At this value. Default is
.5means 50 %return_freq – bool return the interpolated frequency if set to
True. Default isFalse.return_ratio –
bool, default=False, return only the ratio of the representation of the data.
New in version 0.1.5.
- :param to_log10:bool, default=False
convert the interpolated frequency into a log10.
- Returns:
Tuple (float , index ) or (float, array-like, shape (N, )) return the quality control value and interpolated frequency if return_freq is set to
Trueotherwise return the index of useless data.- Example:
>>> from watex.methods.em import Processing >>> pobj = Processing().fit('data/edis') >>> f = pobj.getfullfrequency () >>> # len(f) >>> # ... 55 # 55 frequencies >>> c,_ = pobj.qc ( tol = .4 ) # mean 60% to consider the data as >>> # representatives >>> c # the representative rate in the whole EDI- collection >>> # ... 0.95 # the whole data at all stations is safe to 95%. >>> # now check the interpolated frequency >>> c, freq_new = pobj.qc ( tol=.6 , return_freq =True)
- skew(method='swift', return_skewness=False, suppress_outliers=False)[source]#
The conventional asymmetry parameter based on the Z magnitude.
The EM signal is influenced by several factors such as the dimensionality of the propagation medium and the physical anomalies, which can distort the EM field both locally and regionally. The distortion of Z was determined from the quantification of its asymmetry and the deviation from the conditions that define its dimensionality. The parameters used for this purpose are all rotational invariant because the Z components involved in its definition are independent of the orientation system used. The conventional asymmetry parameter based on the Z magnitude is the skew defined by Swift (1967) as follows:
\[skew_{swift}= |\frac{Z_{xx} + Z_{yy}}{ Z_{xy} - Z_{yx}}|\]When the \(skew_{swift}\) is close to
0., we assume a 1D or 2D model when the \(skew_{swift}\) is greater than>=0.2, we assume 3D local anomaly (Bahr, 1991; Reddy et al., 1977). It is generally considered that an electrical structure of \(skew < 0.4\) can be treated as a 2D medium.Furthermore, Bahr (1988) proposed the phase sensitive skew which calculates the skew taking into account the distortions produced in Z over 2D structures by shallow conductive anomalies and is defined as follows:
\[ \begin{align}\begin{aligned}skew_{Bahr} & = & \sqrt{ \frac{|[D_1, S_2] -[S_1, D_2]|}{|D_2|}} \quad \text{where}\\S_1 & = & Z_{xx} + Z_{yy} \quad ; \quad S_2 = Z_{xy} + Z_{yx}\\D_1 & = & Z_{xx} - Z_{yy} \quad ; \quad D_2 = Z_{xy} - Z_{yx}\end{aligned}\end{align} \]Note that The phase differences between two complex numbers \(C_1\) and \(C_2\) and the corresponding amplitude products are now abbreviated by the commutators:
\[ \begin{align}\begin{aligned}\[C_1, C_2] & = & \text{Im} C_2*C_1^*\\\[C_1, C_2] & = & \text{Re} C_1 * \text{Im}C_2 - R_e(C_2)* \text{Im}C_1\end{aligned}\end{align} \]Indeed, \(skew_{Bahr}\) measures the deviation from the symmetry condition through the phase differences between each pair of tensor elements,considering that phases are less sensitive to surface distortions(i.e. galvanic distortion). The \(skew_{Bahr}\) threshold is set at
0.3and higher values mean 3D structures (Bahr, 1991).- Parameters:
data (str of path-like or list of pycsamt.core.edi.Edi) – EDI data or EDI object with full impedance tensor Z.
method (str) – Kind of correction. Can be
swiftfor the remove distorsion proposed by Swift in 1967. The value close to 0. assume the 1D and 2D structures and 3D otherwise. Conversly tobahrfor the remove distorsion proposed by Bahr in 1991. The latter threshold is set to 0.3. Above this value the structures is 3D.return_skewness (str,) – Typically returns the type of skewness.
'skew'ormufor skew and rotation- all invariant values respectively. Any other value return both skew and rotational invariant.suppress_outliers (bool, default=False,) –
Remove the outliers (if applicable in the data ) before normalizing.
New in version 0.1.6.
- Returns:
skw, mu –
Array of skew at each frequency
rotational invariant
muat each frequency that measures of phase differences in the impedance tensor.
- Return type:
Tuple of ndarray-like , shape (N, M )
See also
watex.utils.plot_skewFor phase sensistive skew visualization - naive plot.
watex.view.TPlot.plotSkewFor consistent plot of phase sensitive skew visualization. Allow customize plots.
watex.view.TPlot.plot_phase_tensorsPlot skew as ellipsis visualization by turning the tensor parameter to
skew.
Examples
>>> from watex.methods.em import Processing >>> edipath = 'data/edis' >>> p = Processing().fit(edipath) >>> sk,_ = p.skew() >>> sk[0:, ] ... array([0.45475527, 0.7876896 , 0.44986397])
References
- Bahr, K., 1991. Geological noise in magnetotelluric data: a classification
of distortion types. Physics of the Earth and Planetary Interiors 66 (1–2), 24–38.
- Barcelona, H., Favetto, A., Peri, V.G., Pomposiello, C., Ungarelli, C., 2013.
The potential of audiomagnetotellurics in the study of geothermal fields: A case study from the northern segment of the La Candelaria Range, northwestern Argentina. J. Appl. Geophys. 88, 83–93. https://doi.org/10.1016/j.jappgeo.2012.10.004
- Swift, C., 1967. A magnetotelluric investigation of an electrical conductivity
anomaly in the southwestern United States. Ph.D. Thesis, MIT Press. Cambridge.
- tma()[source]#
A trimmed-moving-average filter to estimate average apparent resistivities at a single static-correction-reference frequency.
The TMA filter option estimates near-surface resistivities by averaging apparent resistivities along line at the selected static-correction reference frequency. The highest frequency with clean data should be selected as the reference frequency.
- Parameters:
data (path-like object or list of pycsamt.core.edi.Edi) – Collections of EDI-objects from `pycsamt`_
- Returns:
rc or cf – EMAP apparent resistivity static shift corrected or static correction factor or impedance tensor.
- Return type:
np.ndarray, shape (N, M)
References
- zrestore(*, tensor=None, component=None, buffer=None, method='pd', **kws)[source]#
Fix the weak and missing signal at the ‘dead-band`- and recover the missing impedance tensor values.
The function uses the complete frequency (frequency with clean data) collected thoughout the survey to recover by inter/extrapolating the missing or weak frequencies thereby restoring the impedance tensors at that ‘dead-band’. Note that the ‘dead- band’ also known as ‘attenuation -band’ is where the AMT signal is weak or generally abscent.
One main problem in collecting Natural Source Audio-Magnetotellurics data is the signal level in the ‘attenuation band’. Compared to the Controlled Source Audio-Magnetotellurics method (Wang and Tan, 2017; Zonge and Hughes, 1991),the natural signals are not under our control and suffer from frequency ranges with little or no signal. Most notably, the Natural Source Audio-Magnetotellurics ‘dead-band’ between approximately 1 kHz and 4 kHz, but also a signal low in the vicinityof 1 Hz where the transition to magnetospheric energy sources occurs (Goldak and Olson, 2015). In this band, natural source signals are generally absent. The EM energy is dissipated and often cultural electromagnetic noise fills the gap (Zonge, 2000). The response is extrapolated from results observed top frequencies( For instance at 20, 40, 250, and 500 Hz).Experience indicates that the natural source signal level at 2000 Hz can be expected to approach 10-6 γ/√Hz (Zheng, 2010; Zonge, 2000).
- Parameters:
tensor (str, optional) – Name of the tensor. It can be [ resistivity|phase|z|frequency]. If the name of tensor is given, function returns the tensor value in two-dimensionals composed of (n_freq , n_sites) where
n_freq=number of frequencyandn_sationsnumber of sites. Note that if the tensor is passed as boolean valuesTrue, theresistivitytensor is exported by default and thecomponentshould be the component passed toProcessingat initialization.buffer (list [max, min] frequency in Hz) – list of maximum and minimum frequencies. It must contain only two values. If None, the max and min of the clean frequencies are selected. Moreover the [min, max] frequency should not compulsory to fit the frequency range in the data. The given frequency can be interpolated to match the best closest frequencies in the data.
method (str, optional) – Method of interpolation. Can be
basefor scipy.interpolate.interp1dmeanorbfffor scaling methods andpdfor pandas interpolation methods. Note that the first method is fast and efficient when the number of NaN in the array if relatively few. It is less accurate to use the base interpolation when the data is composed of many missing values. Alternatively, the scaled method(the second one) is proposed to be the alternative way more efficient. Indeed, whenmeanargument is set, function replaces the NaN values by the nonzeros in the raw array and then uses the mean to fit the data. The result of fitting creates a smooth curve where the index of each NaN in the raw array is replaced by its corresponding values in the fit results. The same approach is used forbffmethod. Conversely, rather than averaging the nonzeros values, it uses the backward and forward strategy to fill the NaN before scaling.meanandbffare more efficient when the data are composed of a lot of missing values. When the interpolation method is set to pd, function uses the pandas interpolation but ended the interpolation with forward/backward NaN filling since the interpolation with pandas does not deal with all NaN at the begining or at the end of the array. Default ispd.fill_value (array-like or
extrapolate, optional) – If a ndarray (or float), this value will be used to fill in for requested points outside of the data range. If not provided, then the default is NaN. The array-like must broadcast properly to the dimensions of the non-interpolation axes. If a two-element tuple, then the first element is used as a fill value for x_new < x[0] and the second element is used for x_new > x[-1]. Anything that is not a 2-element tuple (e.g., list or ndarray, regardless of shape) is taken to be a single array-like argument meant to be used for both bounds as below, above = fill_value, fill_value. Using a two-element tuple or ndarray requires bounds_error=False. Default isextrapolate.kws (dict) – Additional keyword arguments from
interpolate1d().
- Returns:
Array-like of
watex.external.z.ZobjectsArray collection of new Z impedances objects with dead-band tensor
recovered.
watex.externals.z..Zare ndarray (nfreq, 2, 2).2x2 matrices for components xx, xy and yx, yy.
References
- Goldak, D.K., Olson, R.W., 2015. New developments in Audio-Magnetotellurics exploration :
Case study from Darnley Bay. CSEG Rec. 22–27.
- Wang, K., Tan, H., 2017. Research on the forward modeling of Controlled Source Audio-Magnetotellurics in
three-dimensional axial anisotropic media. J. Appl. Geophys. 146, 27–36. https://doi.org/10.1016/j.jappgeo.2017.08.007
Zonge, I., 2000. Natural Source Audio-Magnetotellurics Imaging. 3322 East Fort Lowell Road, Tucson, AZ 85716 USA. Zonge, L., Hughes, L.J., 1991. Controlled Source Audio-Magnetotellurics. Soc. Explor. Geophys. 2, 713–809.
Examples
>>> import numpy as np >>> import matplotlib.pyplot as plt >>> from watex.methods.em import Processing >>> path2edi = 'data/edis' >>> pObjs= Processing().fit(path2edi) >>> # One can specify the frequency buffer like the example below, However >>> # it is not necessaray at least there is a a specific reason to fix the frequencies >>> buffer = [1.45000e+04,1.11500e+01] >>> zobjs_b = pObjs.zrestore(buffer = buffer ) # with buffer