use principal component analysis to project 3D earthquake locations into best 2D fault coordinate system
1_create_ranLoc.py: - Run this script to generate random 3D earthquake locations. The resulting point cloud will be planar with hig aspect ratio for large enough values of spatial decay exponent, alpha. Results can be checked by looking at the 3D plot which is also saved as .png
2_pca_fitPlane.py: - This script is doing the actual analysis and projection into the fault coordinate system. First step is to compute eigenvectors and eigenvalues by PCA. The eigenvectors are sorted starting with the largest principal component. The second step is then to project the original locations into the fault coordinate system by taking the dot product between sorted eigenvectors and the earthquake coordiantes.
Examples of how this code has been applied to actual data can be found here:
https://academic.oup.com/gji/article/197/3/1705/654505 Goebel, T. H. W., Becker, T. W., Sammis, C. G., Dresen, G. & Schorlemmer, D. Off-fault damage and acoustic emission distributions during the evolution of structurally complex faults over series of stick-slip events. Geophys. J. Int. 197, 1705–1718 (2014).