watex.methods.em.Processing.zrestore#

Processing.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.

Parameters:
  • tensor (str, optional, ["resistivity"|"phase"|"z"|"frequency"]) – Name of the tensor. If the name of tensor is given, function returns the tensor valuein two-dimensionals composed of (n_freq , n_sites) where n_freq=number of frequency and n_sations number of sites. Note that if the tensor is passed as boolean values True, the resistivity tensor is exported by default and the ``component``should be the component passed to Processing at 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 , default='pd') – Method of Z interpolation. Use base for scipy interpolation, mean or bff for scaling methods and pd for 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, when mean argument 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 for bff method. Conversely, rather than averaging the nonzeros values, it uses the backward and forward strategy to fill the NaN before scaling. mean and bff are 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.

  • fill_value (array-like, str, optional, default='extrapolate',) – 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 two-element in 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.

  • kws (dict) – Additional keyword arguments from interpolate1d().

Returns:

  • Array-like of watex.external.z.Z objects

  • Array collection of new Z impedances objects with dead-band tensor

  • recovered. watex.externals.z..Z are ndarray (nfreq, 2, 2).

  • 2x2 matrices for components xx, xy and yx, yy. If tensor given,

  • it returns a collection of 2D tensor of each stations.