Skip to content

KennyGraham1/STEPModel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

STEP Model

Overview

STEP (Short-Term Earthquake Probability) is a Java-based application that generates earthquake forecasts using catalog data. The system can be run either directly on a host machine or via Docker.

System Components

Key Files

  • input/step_config.yaml: Main configuration file for forecast parameters
  • STEP/run.py: Main execution script
  • STEP/params_handler.py: Python script that updates STEP parameters from config
  • STEP/catalog_handler.py: Python script for processing earthquake catalogs
  • STEP/OpenSHA/: Core application directory containing Java classes and libraries

Configuration Files

  1. input/step_config.yaml: Contains primary settings for:

    • Data paths and file locations
    • Catalog date ranges
    • Magnitude thresholds
    • Forecast parameters
    • Grid specifications
  2. input/defaults_template.properties: Contains default application settings, and is handled internally by STEP/params_handler.py

Input Data Format

Catalog Format

The system accepts earthquake catalogs in two formats:

  1. Input CSEP ascii Format:

    • Columns: longitude, latitude, magnitude, origin_time, depth, cat_id(optional), event_id(optional)
    • Time format: ISO format (e.g., "2023-07-03T10:25:00.000Z")
  2. STEP Format (converted automatically by modify_catalog.py):

    • Space-separated values
    • Format: longitude latitude year month day magnitude hour minute second depth 0 0 0 publicid
    • Example: 175.234 -41.123 2023 7 3 4.5 10 25 0.0 12.5 0 0 0 2023p123456

Catalog Processing

The modify_catalog.py script handles:

  • Converting from CSV to STEP format
  • Filtering events based on:
    • Geographic bounds
    • Magnitude thresholds
    • Depth constraints
  • Output filename format: Cat_YYYY-MM-DD-HH-MM_STEP.txt (based on latest event in catalog)

Running STEP

Method 1: Direct Execution

  1. Install python<=3.11 and system dependencies:

    sudo apt-get update && sudo apt-get install -y --no-install-recommends gmt openjdk-8-jre tcsh ant
  2. Setup virtual environment and install STEP package

    python -m venv venv
    source venv/bin/activate
    pip install -e .
  3. Configure the forecast in step_config.yaml. Paths must be either relative to where step_config.yml is located or absolute:

    paths:
      data_dir: ./        
      catalog_file: catalog.csep   # located in ./input
      bg_rates: NZZeroRate05.dat  # located in ./input 
      output_dir: ../forecasts/
      output_file: NGSTEP_90days.txt
    
    catalog:
      start_date: "2016-09-23T13:00:00"
      end_date: "2018-05-07T00:00:00"
      min_magnitude: 3.0
      max_magnitude: 8.0
      delta_magnitude: 0.1
    
    forecast:
      length_days: 90
      min_magnitude: 5.0
      region_code: 90
      parameters:
        a_value: -1.59
        b_value: 1.03
        p_value: 1.07
        c_value: 0.04
    
    grid:
      spacing: 0.05
      precision: 0.01
      anchor: 0.0
      cutoff: 0.5
      bounds:
        lat_min: -43.5
        lat_max: -40.7
        lon_min: 171.7
        lon_max: 175.5
  4. Execute the forecast:

    run

    which will use input/step_config.yml. Alternatively, a specific configuration file can be passed as:

    run config.yml

Method 2: Docker Execution

Install the Docker engine for your distribution

  1. Build the Docker image:

    docker build \
    --build-arg USER_UID=$(id -u) \
    --build-arg USER_GID=$(id -g) \
    -t step-model .
  2. Run the container:

    docker run --rm \
    -u $(id -u):$(id -g) \
    -v "$PWD/input:/app/input" \
    -v "$PWD/forecasts:/app/forecasts" \
    step-model

Output Files

The system generates several output files in the forecasts/ directory:

  • NGSTEP_90days.txt: Main forecast output file

File Structure

.
├── Dockerfile
├── runSTEP.sh
├── step_config.yaml
├── Update_parameters.py
├── ModifyCatalog.py
└── STEP/
    └── OpenSHA/
        ├── build/
        │   ├── lib/
        │   └── bin/
        └── config/
   ├── params_handler.py
   ├── catalog_handler.py
   └── run.py

Requirements

Java Dependencies

  • commons-httpclient.jar
  • commons-logging.jar
  • commons-math-1.1.jar
  • dom4j.jar
  • jargs.jar
  • jquakeml-1.0.1-2.0.1-RC1.jar
  • log4j-1.2.4.jar
  • step-aftershock.jar

System Requirements

  • Java Runtime Environment
  • Python 3.x (for parameter updates and catalog processing)
  • GMT (for visualization)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •