wwz_basic (pyleoclim.utils.wavelet.wwz_basic)
- pyleoclim.utils.wavelet.wwz_basic(ys, ts, freq, tau, c=0.012665147955292222, Neff=3, nproc=1, detrend=False, sg_kwargs=None, gaussianize=False, standardize=False)[source]
Return the weighted wavelet amplitude (WWA).
The Weighted wavelet Z-transform (WWZ) is based on Morlet wavelet estimation, using least squares minimization to suppress the energy leakage caused by the data gaps. WWZ does not rely on interpolation or detrending, and is appropriate for unevenly-spaced datasets. In particular, we use the variant of Kirchner & Neal (2013), in which basis rotations mitigate the numerical instability that occurs in pathological cases with the original algorithm (Foster, 1996). The WWZ method has one adjustable parameter, a decay constant c that balances the time and frequency resolutions of the analysis. This application uses the larger value (8π2)−1, justified elsewhere (Witt & Schumann, 2005).
No multiprocessing is applied by Default.
- Parameters
ys (array) – a time series
ts (array) – time axis of the time series
freq (array) – vector of frequency
tau (array) – the evenly-spaced time points, namely the time shift for wavelet analysis
c (float) – the decay constant that determines the analytical resolution of frequency for analysis, the smaller the higher resolution; the default value 1/(8*np.pi**2) is good for most of the wavelet analysis cases
Neff (int) – the threshold of the number of effective degrees of freedom
nproc (int) – fake argument, just for convenience
detrend (string) – None - the original time series is assumed to have no trend; ‘linear’ - a linear least-squares fit to ys is subtracted; ‘constant’ - the mean of ys is subtracted ‘savitzy-golay’ - ys is filtered using the Savitzky-Golay filters and the resulting filtered series is subtracted from y. Empirical mode decomposition. The last mode is assumed to be the trend and removed from the series
sg_kwargs (dict) – The parameters for the Savitzky-Golay filters. see pyleoclim.utils.filter.savitzy_golay for details.
gaussianize (bool) – If True, gaussianizes the timeseries
standardize (bool) – If True, standardizes the timeseries
- Returns
wwa (array) – the weighted wavelet amplitude
phase (array) – the weighted wavelet phase
Neffs (array) – the matrix of effective number of points in the time-scale coordinates
coeff (array) – the wavelet transform coefficients (a0, a1, a2)
References
Foster, G. Wavelets for period analysis of unevenly sampled time series. The Astronomical Journal 112, 1709 (1996).
Witt, A. & Schumann, A. Y. Holocene climate variability on millennial scales recorded in Greenland ice cores.
Nonlinear Processes in Geophysics 12, 345–352 (2005). - Kirchner, J. W. and Neal, C. (2013). Universal fractal scaling in stream chemistry and its implications for solute transport and water quality trend detection. Proc Natl Acad Sci USA 110:12213–12218.
See also
pyleoclim.utils.wavelet.wwz_nproc
Returns the weighted wavelet amplitude using the original method from Kirchner. Supports multiprocessing
pyleoclim.utils.wavelet.kirchner_basic
Return the weighted wavelet amplitude (WWA) modified by Kirchner. No multiprocessing
pyleoclim.utils.wavelet.kirchner_nproc
Returns the weighted wavelet amplitude (WWA) modified by Kirchner. Supports multiprocessing
pyleoclim.utils.wavelet.kirchner_numba
Return the weighted wavelet amplitude (WWA) modified by Kirchner using Numba package.
pyleoclim.utils.wavelet.kirchner_f2py
Returns the weighted wavelet amplitude (WWA) modified by Kirchner. Uses Fortran. Fastest method but requires a compiler.
pyleoclim.utils.filter.savitzky_golay
Smooth (and optionally differentiate) data with a Savitzky-Golay filter.