Skip to content

Jose-Alvarez/SSTS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

SSTS: Seismic Strain Tensor Shape Analysis

SSTS is a Python-based utility developed for the statistical analysis of seismic strain tensors. It processes multiple moment tensor solutions, performs weighted averaging, and employs Monte Carlo simulations to estimate uncertainties in tensor components, principal axes (eigenvalues), and tensor axes orientations.

Features

  • Format Flexibility: Supports both GlobalCMT (spherical: r, t, p) and Cartesian (x, y, z) coordinate systems.
  • Weighted Averaging: Aggregates multiple tensor inputs based on user-defined weights.
  • Uncertainty Estimation: Uses Monte Carlo sampling to provide standard deviations for all derived parameters.
  • Shape Parameters: Calculates KM shape parameters and fCLVD (compensated linear vector dipole) components.
  • Axis Orientations: Automatically calculates mean azimuths and plunges for P (Pressure), B (Null), and T (Tension) axes using circular statistics.

Requirements

The program requires Python 3.x and the following libraries:

  • numpy
  • pandas
  • scipy

Installation

Ensure you have the dependencies installed via pip:

pip install numpy pandas scipy

Usage

You can run the script by providing an input file or piping data directly through stdin.

Command syntax:

python SSTS.py [infile] [-n SAMPLES] [-f FORMAT] [-o OUTPUT_FORMAT] [-v]

Arguments

Argument Description
infile Input file containing tensor components, errors, and weights.
-n Number of Monte Carlo samples to generate (default: 1000).
-f, --format Input tensor format (globalcmt or cartesian).
-o, --output-format Output tensor format (globalcmt or cartesian).
-v Verbose mode: prints average tensor and errors to stderr.

Input Data Format

The input must be a space-separated text file with at least 13 columns:

  1. Columns 1-6: Tensor components (e.g., Mrr, Mtt, Mpp, Mrt, Mrp, Mtp).
  2. Columns 7-12: Errors (standard deviations) for each of the 6 components in the same order.
  3. Column 13: Weight for the specific measurement.
  4. Columns 14+: Optional additional metadata.

Output

The script generates a tab-separated output containing:

  • Shape Parameters: KM and fCLVD (means and standard deviations).
  • Tensor Components: Mean and standard deviation of the 6 components in the requested output format.
  • Principal Values: M1, M2, M3 (eigenvalues).
  • Orientations: Azimuth and Plunge (with standard deviations) for the P, B, and T axes.
  • Metadata: Total weight processed and the number of valid Monte Carlo samples.

Example of Use

If you have a file named events.txt with GlobalCMT components:

# Mrr Mtt Mpp Mrt Mrp Mtp e1 e2 e3 e4 e5 e6 Weight
1.5 -1.2 -0.3 0.2 0.5 -0.8 0.1 0.1 0.1 0.05 0.05 0.05 1.0

Run the analysis with 5000 samples:

python SSTS.py events.txt -n 5000 -f globalcmt

Expected Output

The output is a single line of tab-separated values (preceded by a header) containing the statistical results:

#KM_mean	KM_std	fclvd_mean	fclvd_std	Mrr_mean	Mtt_mean	Mpp_mean	Mrt_mean	Mrp_mean	Mtp_mean	Mrr_std	Mtt_std	Mpp_std	Mrt_std	Mrp_std	Mtp_std	M1_mean	M1_std	M2_mean	M2_std	M3_mean	M3_std	P_az	P_az_std	P_pl	P_pl_std	B_az	B_az_std	B_pl	B_pl_std	T_az	T_az_std	T_pl	T_pl_std	total_weight	valid_samples
8.472642e-01	1.011235e-01	5.489743e-02	5.083950e-02	1.498653e+00	-1.201215e+00	-2.998289e-01	1.999133e-01	5.008336e-01	-7.995555e-01	9.838366e-02	9.909525e-02	9.891410e-02	4.919792e-02	5.013306e-02	5.077785e-02	1.631376e+00	9.575292e-02	9.486601e-02	8.758878e-02	-1.728633e+00	8.863680e-02	148.32	2.073292e+00	7.65	9.238728e-01	56.63	2.103062e+00	12.42	2.031756e+00	269.64	4.990446e+00	75.29	1.798622e+00	1.0	5000

About

Seismic Strain Tensor Shape Analysis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages