Coverage for /opt/obspy/update-docs/src/obspy/obspy/signal/polarization : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
#!/usr/bin/env python #------------------------------------------------------------------- # Filename: polarization.py # Author: Conny Hammer # Email: conny.hammer@geo.uni-potsdam.de # # Copyright (C) 2008-2012 Conny Hammer #------------------------------------------------------------------- Polarization Analysis
:copyright: The ObsPy Development Team (devs@obspy.org) :license: GNU Lesser General Public License, Version 3 (http://www.gnu.org/copyleft/lesser.html) """
""" Polarization attributes of a signal.
Computes the rectilinearity, the planarity and the eigenvalues of the given data which can be windowed or not. The time derivatives are calculated by central differences and the parameter ``fk`` describes the coefficients of the used polynomial. The values of ``fk`` depend on the order of the derivative you want to calculate. If you do not want to use derivatives you can simply use [1,1,1,1,1] for ``fk``.
The algorithm is mainly based on the paper by Jurkevics. The rest is just the numerical differentiation by central differences (carried out by the routine :func:`scipy.signal.lfilter(data, 1, fk)`).
:type datax: :class:`~numpy.ndarray` :param datax: Data of x component. :type datay: :class:`~numpy.ndarray` :param datay: Data of y component. :type dataz: :class:`~numpy.ndarray` :param dataz: Data of z component. :type fk: list :param fk: Coefficients of polynomial used for calculating the time derivatives. :param normf: Factor for normalization. :return: **leigenv1, leigenv2, leigenv3, rect, plan, dleigenv, drect, dplan** - Smallest eigenvalue, Intermediate eigenvalue, Largest eigenvalue, Rectilinearity, Planarity, Time derivative of eigenvalues, time derivative of rectilinearity, Time derivative of planarity.
.. seealso:: [Jurkevics1988]_ """ rowvar=False)[0, 1] rowvar=False)[0, 1] rowvar=False)[0, 1]
leigenv1), [leigenv1[np.size(leigenv1) - 1]] * (np.size(fk) // 2)) #dleigenv1 = dleigenv1[np.size(fk) // 2:(np.size(dleigenv1) - np.size(fk) / # 2)]
leigenv2), [leigenv2[np.size(leigenv2) - 1]] * (np.size(fk) // 2)) #dleigenv2 = dleigenv2[np.size(fk) // 2:(np.size(dleigenv2) - np.size(fk) / # 2)]
leigenv3), [leigenv3[np.size(leigenv3) - 1]] * (np.size(fk) // 2)) #dleigenv3 = dleigenv3[np.size(fk) // 2:(np.size(dleigenv3) - np.size(fk) / # 2)]
rect), [rect[np.size(rect) - 1]] * (np.size(fk) // 2)) #drect = drect[np.size(fk) // 2:(np.size(drect3) - np.size(fk) // 2)]
plan), [plan[np.size(plan) - 1]] * (np.size(fk) // 2)) #dplan = dplan[np.size(fk) // 2:(np.size(dplan) - np.size(fk) // 2)]
|