watex.methods.em.Processing.drop_frequencies#

Processing.drop_frequencies(freqs=None, tol=None, interpolate=False, rotate=0.0, export=False, **kws)[source]#

Drop useless frequencies in the EDI data.

Due to the terrain constraints, topographic and interferences noises some frequencies are not meaningful to be kept in the data. The function allows to explicitely remove the bad frequencies after analyses and interpolated the remains. If bad frequencies are not known which is common in real world, the tolerance parameter tol can be set to automatically detect with 50% smoothness in data selection.

New in version v0.2.0.

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. If None, the list of frequencies to drop must be provided. If the tol parameter is set to auto, the selection of useless frequencies is tolerate to 50%.

  • freqs (list , Optional) –

    The list of frequencies to remove in the: term:EDI`objects. If ``None`, the tol parameter must be provided, otherwise an error will raise. If the

    return the interpolated frequency if set to True.

  • Interpolate (bool, default=False,) – Interpolate the frequencies after bad frequencies removal.

  • rotate (float, default=0.) –

    Rotate Z array by angle alpha in degrees. All angles are referenced to geographic North, positive in clockwise direction. (Mathematically negative!). In non-rotated state, X refs to North and Y to East direction.

    Note that if rotate is given, it is only used in interpolation i.e interpolation is set to True.

  • export (bool , default =False,) – Output new sanitized EDIs.

Returns:

Zcol – return the quality control value and interpolated frequency if return_freq is set to True otherwise return the index of useless data.

Return type:

or (float, array-like, shape (N, ))

Examples

>>> import watex as wx
>>> sedis = wx.fetch_data ('huayuan', samples = 12 ,
                           return_data =True , key='raw')
>>> p = wx.EMProcessing ().fit(sedis)
>>> ff = [ len(ediobj.Z._freq)  for ediobj in p.ediObjs_]
>>> ff
[53, 52, 53, 55, 54, 55, 56, 51, 51, 53, 55, 53]
>>> p.ediObjs_[0].Z.z[:, 0, 1][:7]
array([ 4165.6 +2070.13j,  7072.81+6892.41j,  8725.84+5874.15j,
       14771.8 -2831.28j, 21243.7 -6802.36j,  6381.48+3411.65j,
        5927.85+5074.27j])
>>> Zcol = p.drop_frequencies (tol =.2 )
>>> Zcol [0].z[:, 0, 1 ][:7]
array([ 4165.6 +2070.13j,  7072.81+6892.41j,  8725.84+5874.15j,
       14771.8 -2831.28j, 21243.7 -6802.36j,  6381.48+3411.65j,
        5927.85+5074.27j])
>>> [ len(z.freq) for z in Zcol ]
[53, 52, 52, 53, 53, 53, 53, 50, 49, 53, 53, 52]
>>> p.verbose =True
>>> Zcol = p.drop_frequencies (tol =.2 , interpolate= True )
Frequencies:     1- 81920.0    2- 48.5294    3- 5.625  Hz have been dropped.
>>> [ len(z.freq) for z in Zcol ] # all are interpolated to 53 frequencies
[53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53]
>>> Zcol = p.drop_frequencies (tol =.2 , interpolate= True , export =True )
>>> # drop a specific frequencies
>>> # let visualize the 7 frequencies of our ediObjs
>>> p.freqs_ [:7]
array([81920., 70000., 58800., 49500., 41600., 35000., 29400.])
>>> # let try to drop 49500 and 29400 frequencies explicitly.
>>> Zcol = p.drop_frequencies (freqs = [49500 , 29400] )
>>> # let check whether this frequencies still available in the data
>>> Zcol [5].freq[:7]
array([81920., 70000., 58800., 41600., 35000., 24700., 20800.])
>>> # frequencies do not need to match exactly the value in frequeny
>>> # range. Here is an example
>>> Zcol = p.drop_frequencies (freqs = [49800 , 29700] )
Frequencies:     1- 49500.0    2- 29400.0  Hz have been dropped.
>>> # explicitly it drops the 49500 and 29400 Hz the closest.