Hamlet Architecture and Testing Workflow¶
Hamlet performs spatial-temporal hazard model checks and statistical evaluation of model consistency and performance against an observed earthquake catalog.
Hamlet follows this workflow:
Read in YAML configuration file, that specifies:
Which tests and evaluations to run, and their parameters
Input files:
Seismic Source Model files
Seismic catalog (observed earthquakes)
GIS file of spatial bins (optional)
What to output:
Reports
GIS files
JSON results
Read and process SSM:
Load sources from a single logic tree branch (or iterate over all branches if
branch: iterateis set)Sort sources based on their type
Sort the ruptures from all sources by magnitude and into spatial bins:
Uses H3 hexagonal cells (by default) to spatially bin ruptures and observed earthquakes
Computes both model and empirical Magnitude-Frequency Distributions (MFDs) for each spatial bin
Run the tests and evaluations:
Basic sanity checks (e.g., whether the observed earthquake maximum magnitude exceeds the model maximum magnitude in each spatial bin)
Statistical consistency tests (N-test, M-test, S-test, L-test, comparing count, magnitude, spatial, and likelihood consistency)
Evaluations (MFD comparisons, moment rate analysis, rupture matching, ground motion evaluation)
Multiple tests and evaluations can be run sequentially, and multiple frameworks can be used in a single run
Write output:
HTML reports summarizing the results with maps, plots, and tables
GIS files (GeoJSON) with the test results for each spatial bin
JSON files with structured results
Branch Iteration¶
When branch: iterate is set in the configuration, Hamlet evaluates each
logic tree branch independently in a single run:
The earthquake catalog is loaded once (shared across all branches)
The complete source model is loaded, and all branches are extracted
For each branch:
Ruptures are processed for that branch only
Input data is grouped into spatial bins
All configured tests and evaluations are run
Results are collected and memory is freed
Results from all branches are combined into a single report