pca¶
- exception PCAError[source]¶
Bases:
owlpy.error.OwlPyErrorRaised when PCA failed.
- pca(traces)[source]¶
Perform principal component analysis (PCA) of 2- or multi-component signal.
- Parameters
traces (list of
obspy.Traceorpyrocko.Traceobjects) – Waveforms of the signals to be analysed. Components are expected in the order and polarity[east, north]or[east, north, up]. The traces must be of same length, sampling rate and data type.- Raises
OwlPyErrorif the input traces are incompatible,PCAErrorif the traces are too short.- Returns
(cov, evals, evecs, azimuth, incidence)wherecovis the covariance matrix of the data,evalsare the eigenvalues,evecsare the eigenvectors,azimuthis the horizontal direction of the principal component, measured clockwise from north andincidenceis incidence angle of the principal component, measured from vertical. The azimuth is wrapped to the range[0, 180)because of its +-180 deg ambiguity, the incidence angle returned in the range[0, 90]. An incidence angle of 90 deg is returned, if no vertical component is available. Both angles are returned in [deg].- Return type
5-
tuple: threenumpy.ndarrayand twofloat.
PCA is useful to find the polarisation of a signal contained in a 2- or 3-component seismic recording. This function estimates the covariance of the signal, the eigen-system of the covariance and the angles of the first principal component. Note that the polarity of the polarisation direction cannot be determined from the PCA alone.