The kinematic inversion pipeline now supports an event-run folder workflow, allowing you to run multiple earthquake inversions while keeping inputs and outputs organized in dedicated directories.
# Run inversion in a specific folder
python main.py --run /path/to/my_event
# Run inversion in current directory (default)
python main.py
# Skip plot generation
python main.py --run /path/to/my_event --no-plotEach run folder (<RUN_DIR>) must contain:
<RUN_DIR>/
├── input.ctl # ✓ REQUIRED: Configuration file
├── DATA/ # ✓ REQUIRED: Observed data directory
│ ├── real_disp_x # Option 1: Flat files (if units=1)
│ ├── real_disp_y
│ ├── real_disp_z
│ └── RAW/ # Option 2: SAC/MiniSEED files
│ ├── *.sac or *.mseed
│ └── [inventory files] # (optional, for response removal)
└── [optional] AXITRA2024/ # Optional: Local copy of AXITRA2024
| File/Folder | Required? | Purpose |
|---|---|---|
input.ctl |
YES | Control file with configuration parameters |
DATA/ |
YES | Observed data (flat files or RAW/) |
AXITRA2024/ |
NO | AXITRA executables; defaults to src/AXITRA2024 if not present |
The pipeline creates an output/ subdirectory:
<RUN_DIR>/
└── output/
├── na_results.json # Results in JSON format
├── na_results.csv # Results in CSV format
└── Figures/
└── NA_results_summary.png # Summary plot
The input.ctl file contains all inversion parameters. Each run folder should have its own, tuned for that specific earthquake event.
- Observed Data Parameters: time window, sampling, units
- Source Position & Focal Mechanism: latitude, longitude, depth, strike, dip, rake
- Optional but recommended for
DATA/RAW/: event origin UTC date/time
- Optional but recommended for
- Fault Plane Parameters: dimensions, hypocenter location, subfault grid
- Ellipse Parameters: number of ellipses, frequency band, time shift
- Parameters to Invert: which fault parameters to vary and their bounds
- Inversion Process: algorithm, iterations, sampling strategy
- Moment Tensor (optional): if inverting for full moment tensor
- Station Parameters: seismic station coordinates
See input.ctl for a complete example.
Place flat ASCII files in <RUN_DIR>/DATA/:
real_disp_x # For units=1 (displacement)
real_disp_y
real_disp_z
Or:
real_vel_x # For units=2 (velocity)
real_vel_y
real_vel_z
Format: 2 columns (time, value) with npts * nstations rows.
Place waveform files in <RUN_DIR>/DATA/RAW/:
DATA/
└── RAW/
├── 20200603T073534-A05C-HNE.sac
├── 20200603T073534-A05C-HNN.sac
├── 20200603T073534-A05C-HNZ.sac
├── ...
└── [optional_inventory.xml]
Notes:
- Files are automatically bandpass-filtered to the frequency range in
input.ctl - Station name is extracted from file metadata
- If inventory files present, instrument response is removed
- If
Event Origin Date/Timeis set ininput.ctl, windowing uses event origin +t1 - Requires:
obspyfor SAC/MiniSEED reading
mkdir my_event_2025
cd my_event_2025# Copy and customize config for your event
cp ../input.ctl .
vim input.ctl # Edit for your event
# Copy or link observed data
mkdir DATA
cp /path/to/observed_data/real_disp_* DATA/cd ..
python main.py --run my_event_2025ls my_event_2025/output/
cat my_event_2025/output/na_results.json | jq .best_modelIf you have a local copy of AXITRA2024 in your run folder:
my_event_2025/
├── input.ctl
├── DATA/
│ └── ...
└── AXITRA2024/ # Preferred over src/AXITRA2024
├── axitra
└── ...
The pipeline will use it automatically.
To skip plot generation (useful for batch processing):
python main.py --run my_event_2025 --no-plotCheck:
- ✓
<RUN_DIR>/input.ctlexists and is readable - ✓
<RUN_DIR>/DATA/exists and is a directory - ✓ Data files are present in
DATA/(either flat files orRAW/subdirectory)
Solutions:
- Option 1: Copy
src/AXITRA2024to your run folder - Option 2: Ensure
src/AXITRA2024exists in the project root - Option 3: Use absolute paths if running from different working directory
Check:
input.ctlspecifies correct units (1=displacement, 2=velocity)- File names match expected format:
real_disp_x/y/zorreal_vel_x/y/z - Files contain correct number of rows:
npts * nstations
Solution: Install obspy for P/S time calculations:
pip install obspy- Pre-process data: Generate flat files from SAC/MiniSEED once, reuse for multiple runs
- Parallel runs: Run inversions on different events simultaneously (each in own folder)
- Resource limits: Adjust
ss1andss_otherininput.ctlif runs are memory-intensive
If you have projects using the old single-directory structure:
# Old structure
Kinematic_inversion/
├── main.py
├── input.ctl ← Move to run folder
├── DATA/ ← Move to run folder
└── src/
# New structure
Kinematic_inversion/
├── main.py
├── src/
│ └── AXITRA2024/
└── my_event/ ← New run folder
├── input.ctl
├── DATA/
└── output/ ← Auto-createdThen run:
python main.py --run my_event- input.ctl - Complete configuration file example
src/config_parser.py- Configuration parsing logicsrc/signal_utils.py- Data loading and filtering